From d2d1a8691390f55532eb18843289224a302abc29 Mon Sep 17 00:00:00 2001 From: Atte Date: Tue, 2 Sep 2014 18:30:50 +0300 Subject: [PATCH] Create powergamers.lua Please tell me how to improve it or if there are any mistakes on it --- LUA/TFS_10/other.md/powergamers.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 LUA/TFS_10/other.md/powergamers.lua diff --git a/LUA/TFS_10/other.md/powergamers.lua b/LUA/TFS_10/other.md/powergamers.lua new file mode 100644 index 0000000..d340bcb --- /dev/null +++ b/LUA/TFS_10/other.md/powergamers.lua @@ -0,0 +1,11 @@ +function onThink(interval, lastExecution, thinkInterval) + if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23856)) then + setGlobalStorageValue(23856, (tonumber(os.date("%d")))) + db.query("UPDATE `znote_players` `a` INNER JOIN `players` `b` ON `a`.`id`=`b`.`id` SET `a`.`exphist7`=`a`.`exphist6`, `a`.`exphist6`=`a`.`exphist5`, `a`.`exphist5`=`a`.`exphist4`, `a`.`exphist4`=`a`.`exphist3`, `a`.`exphist3`=`a`.`exphist2`, `a`.`exphist2`=`a`.`exphist1`, `a`.`exphist1`=`b`.`experience`-`a`.`exphist_lastexp`, `a`.`exphist_lastexp`=`b`.`experience`;") + end + return true +end + +TFS 1.0 (globalevents.xml) + +