Leic Posted April 11, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 48 Reputation: 0 Joined: 02/27/18 Last Seen: May 3, 2018 Share 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 Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted April 11, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
1 pajodex Posted April 11, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: Monday at 05:33 PM Share 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 Link to comment Share on other sites More sharing options...
0 Leic Posted April 11, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 48 Reputation: 0 Joined: 02/27/18 Last Seen: May 3, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 Leic Posted April 11, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 48 Reputation: 0 Joined: 02/27/18 Last Seen: May 3, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
0 pajodex Posted April 11, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: Monday at 05:33 PM Share 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 Link to comment Share on other sites More sharing options...
0 Leic Posted April 11, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.01 Content Count: 48 Reputation: 0 Joined: 02/27/18 Last Seen: May 3, 2018 Author Share Posted April 11, 2018 i hope i could join your discord too Quote Link to comment Share on other sites More sharing options...
Question
Leic
requesting for all "dailysupply" in char_reg_num to be deleted on all characters every 00:00 server time
Edited by LeicLink to comment
Share on other sites
6 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.