ohyono Posted February 16, 2018 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 56 Reputation: 15 Joined: 01/10/12 Last Seen: June 8, 2023 Share 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 Link to comment Share on other sites More sharing options...
0 drifterxxxx2 Posted February 16, 2018 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 83 Reputation: 3 Joined: 10/22/17 Last Seen: June 5, 2021 Share 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 Link to comment Share on other sites More sharing options...
0 ohyono Posted February 16, 2018 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 56 Reputation: 15 Joined: 01/10/12 Last Seen: June 8, 2023 Author Share Posted February 16, 2018 I'm not occurred that way, let me try Quote Link to comment Share on other sites More sharing options...
0 Orion Posted February 17, 2018 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 9 Reputation: 1 Joined: 02/14/18 Last Seen: March 11, 2018 Share 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 Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
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.