Time-Based Event?

garjon

Member
Is it possible to create a script that runs when the system announces 5 or less minutes before rollover? I'd like to keep mafia up, chat occasionally, and not have to worry about the preposition sword.
 

mredge73

Member
I have some time based functions created by Alifar bundled in my function library script.
In particular you may find this one usefull:
Code:
//Returns how many minutes to rollover
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
int MinutesToRollover()
{
//get the html source
string source = visit_url("charpane.php");

//the start of the rollover var
int ROS = index_of( source, "var rollover = " ) + length( "var rollover = " );
//the end of the rollover var
int ROE = index_of( source, ";", ROS );
//the start of the rightnow var
int RNS = index_of( source, "var rightnow = " ) + length( "var rightnow = " );
//the end of the rightnow var
int RNE = index_of( source, ";", RNS );
//the start of the rightnow var

//extract the string containing the number part of the start of rollover
string rollover = substring(source, ROS, ROE);
//extract the string containing the number part of kol's version of rightnow
string rightnow = substring(source, RNS, RNE);

return ( to_int( rollover ) - to_int( rightnow ) ) / 60;
}
 

Spiny

Member
Not sure why you'd worry bout prep sword, when done with adventuring, put on rollover gear, use a wang and chat away ;)
 

shazbot

Member
Is there any sort of trigger for x minutes to rollover? I forgot to exit mafia before I took my dogs out, so my dinner script didn't run ( which equips rollover gear). I want to make it my last time. I realize I could use that script to get the current time, but AFAIK in order to use that to check for a certain time to rollover, I'd have to keep polling it.
 
Top