Jump to content
  • 0

Problem with OnClock


Question

Posted

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

  • 0
Posted
-	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? :) 

  • 0
Posted
-	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;

}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...