Leic Posted April 11, 2018 Posted April 11, 2018 (edited) requesting for all "dailysupply" in char_reg_num to be deleted on all characters every 00:00 server time Edited April 11, 2018 by Leic Quote
0 AnnieRuru Posted April 11, 2018 Posted April 11, 2018 HAHAHA I just answer this question on the discord yesterday I just copy paste the chat log then Question : (Hyperion) how to reset the #BOSSNIAPOINTS using sql? i want to reset all players Answer : (me) actually there's a misconception that "I want to reset the variable" so I attachrid everyone and remove the variable from sql this method is wrong, or should I say this method consume a lot of server resources on your server the correct method is give it an ID, if the player doesn't match the ID, only remove that player http://upaste.me/4b0f495947cad8c0f the test1 example will tries to execute the SQL table, and because the key column isn't indexed (check main.sql file) it will perform a full table search and, if you run this query in a live server, with over 500,000 rows ... this can lag on your server also, addrid is evil, hercules doesn't even has this script command, it also promote bad scripting habit 2nd thing, there's also a catch, as you can see, it runs on OnClock0000: , which means if somehow your live server is under maintenance or shut down at the time that label isn't run at all its better to use another ID like in my example, since it reset daily, I hack it with gettime Question : (Hyperion) UPDATE acc_reg_num SET value=0 WHERE 'key'="#BOSSNIAPOINTS" Answer : (me) nope, com'on ... in *athena script language ... 0 = null setting a variable into 0 means delete that variable, but SQL isn't like that, SQL 0 != null . . . why pajodex today can do exactly like what I have predicted yesterday ? maybe I have super power check the upaste date, it was yesterday 1 Quote
1 pajodex Posted April 11, 2018 Posted April 11, 2018 (edited) 41 minutes ago, Leic said: requesting for all "dailysupply" in char_reg_num to be deleted on all characters every 00:00 server time OnClock0000: query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='dailysupply'"); addrid(0); dailysupply = 0; end; Edited April 11, 2018 by pajodex Quote
0 Leic Posted April 11, 2018 Author Posted April 11, 2018 20 minutes ago, pajodex said: OnClock0000: addrid(0); dailysupply = 0; end; just for clarification, will this be repeatable every set time? Quote
0 Leic Posted April 11, 2018 Author Posted April 11, 2018 (edited) odd tested it, still has dailysupply on char_reg_num (edit) nvm forgot 1 curly Edited April 11, 2018 by Leic Quote
0 pajodex Posted April 11, 2018 Posted April 11, 2018 22 minutes ago, Leic said: just for clarification, will this be repeatable every set time? yup depends on your wanting Quote
Question
Leic
requesting for all "dailysupply" in char_reg_num to be deleted on all characters every 00:00 server time
Edited by Leic6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.