Jump to content
  • 0

Problem with OnClock


ohyono

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   15
  • Joined:  01/10/12
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  83
  • Reputation:   3
  • Joined:  10/22/17
  • Last Seen:  

-	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? :) 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   15
  • Joined:  01/10/12
  • Last Seen:  

I'm not occurred that way, let me try

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   1
  • Joined:  02/14/18
  • Last Seen:  

-	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;

}

 

Link to comment
Share on other sites

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.

×
×
  • Create New...