ohyono Posted February 16, 2018 Posted February 16, 2018 I have a script that must erase all the data in a table exactly on Monday at 00:00, the problem is that every day at that time the data is deleted. I already tried it in several ways but I still have the same problem. - script GPtsRst -1,{ OnInit: if (gettime(4) == SUNDAY || gettime(4) == TUESDAY || gettime(4) == WEDNESDAY || gettime(4) == THURSDAY || gettime(4) == FRIDAY || gettime(4) == SATURDAY ) { end; } else if (gettime(4) == MONDAY) { OnClock0000: query_sql "UPDATE `guild_points` SET `total_points`=0"; query_sql "UPDATE `gid_points` SET `ind_pts`=0"; end; } } I would appreciate it if someone helped me to correct that problem or some idea of how to do it. Thank you Quote
0 drifterxxxx2 Posted February 16, 2018 Posted February 16, 2018 - script GPtsRst -1,{ end; OnClock0000: switch(gettime(4)) { case 1: query_sql "UPDATE `guild_points` SET `total_points`=0"; query_sql "UPDATE `gid_points` SET `ind_pts`=0"; break; } end; } not sure if this works, but maybe it gives you ideas? Quote
0 ohyono Posted February 16, 2018 Author Posted February 16, 2018 I'm not occurred that way, let me try Quote
0 Orion Posted February 17, 2018 Posted February 17, 2018 - script Orion -1,{ OnClock0000: if (gettime(DT_DAYOFWEEK) == MONDAY) query_sql "UPDATE `guild_points` SET `total_points`=0"; query_sql "UPDATE `gid_points` SET `ind_pts`=0"; end; } Quote
Question
ohyono
I have a script that must erase all the data in a table exactly on Monday at 00:00, the problem is that every day at that time the data is deleted. I already tried it in several ways but I still have the same problem.
- script GPtsRst -1,{ OnInit: if (gettime(4) == SUNDAY || gettime(4) == TUESDAY || gettime(4) == WEDNESDAY || gettime(4) == THURSDAY || gettime(4) == FRIDAY || gettime(4) == SATURDAY ) { end; } else if (gettime(4) == MONDAY) { OnClock0000: query_sql "UPDATE `guild_points` SET `total_points`=0"; query_sql "UPDATE `gid_points` SET `ind_pts`=0"; end; } }
I would appreciate it if someone helped me to correct that problem or some idea of how to do it.
Thank you
3 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.