Distro: TFS 1.5
ACC: Gesior2012
So far everything is working okay but I am having one problem with online time since "online" column has been removed from
You can see from the code "--" commented out below which line I'm talking about. I know it's not as simple as switching online -> players_online since it also displays player ID now instead of just a 1/0.
@Gesior.pl - Do you have an update released for this that I'm not finding by search?
Update: Its also only updating XP counts when players log out.
Version 1
Version 2
ACC: Gesior2012
So far everything is working okay but I am having one problem with online time since "online" column has been removed from
players
table.You can see from the code "--" commented out below which line I'm talking about. I know it's not as simple as switching online -> players_online since it also displays player ID now instead of just a 1/0.
@Gesior.pl - Do you have an update released for this that I'm not finding by search?
Update: Its also only updating XP counts when players log out.
Version 1
Code:
function onThink(interval, lastExecution)
if (tonumber(os.date("%d")) ~= getGlobalStorageValueDB(23456)) then
setGlobalStorageValueDB(23456, (tonumber(os.date("%d"))))
db.query("UPDATE `players` SET `exphist7`=players.exphist6, `exphist6`=players.exphist5, `exphist5`=players.exphist4, `exphist4`=players.exphist3, `exphist3`=players.exphist2, `exphist2`=players.exphist1, `exphist1`=players.experience-players.exphist_lastexp, `exphist_lastexp`=players.experience;")
db.query("UPDATE `players` SET `onlinetime7`=players.onlinetime6, `onlinetime6`=players.onlinetime5, `onlinetime5`=players.onlinetime4, `onlinetime4`=players.onlinetime3, `onlinetime3`=players.onlinetime2, `onlinetime2`=players.onlinetime1, `onlinetime1`=players.onlinetimetoday, `onlinetimetoday`=0;")
end
--db.query("UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1;")
return TRUE
end
Version 2
Code:
function onThink(interval, lastExecution)
if (tonumber(os.date("%d")) ~= getGlobalStorageValueDB(23456)) then
setGlobalStorageValueDB(23456, (tonumber(os.date("%d"))))
db.query("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
db.query("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")
end
--db.query("UPDATE `players` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `online` = 1;")
return TRUE
end
Last edited: