Jump to content

Vendor board; daily reporting "I am here" - best way

Domitan Redenblack

Recommended Posts

In state_entry, llResetTime().  Then in your timer event

if (llGetTime() > 86400)


     //send message



Unless you really want high accuracy, getting your daily report at precisely the same time each day, you can set the timer event to something like 300 seconds (5 minutes) for negligible lag, or you can just piggyback on whatever your timer is already doing, if it's shorter than that.

Link to comment
Share on other sites

Ordinals is the simplest method, although potentially the least accurate depending on accumulated time dilation for the day.

the other two are more accurate in the frequency they report at (with an average deviance of half the timer cycle) but mean that all boards are going to report in at about the same time.

both Roligs and Ordinal's methods will be delayed by script down time (region offline, script set to to not running or taken back to inventory), that delay amount will set the new standard. Mad's will only be pushed to the next check after the delay, and then resume it's normal reporting time. Mad's does require a variable to save and check for the change

using a random number from 1 to 86400 generated at start up, and added to llGetUnixTime, and checking that in the timer versus a day change, would break up the reporting for all devices, as Ordinal's does, but still allow them to report at roughly the same time of day as Rolig's and Mad's do, and resumes normal reporting time after a delay as mad's does. it does require a global variable as Mad's does

code for generation would be something like

gIntNxt = llGetUnixTime() + (integer)llFrand( 86400.0 );

or if you like Ordinal's offset based on rez time...

gIntNxt = llGetUixTime() + gIntNxt = llGetUnixTime() % 86400;

and the check code would be

if (llGetUnixTime() > gIntNxt){
while (llGetUnixTime() > gIntNxt += 86400); //-- could be written as gIntNxt = llGetUnixTime / 86400 + gIntNxt % 86400;
//-- phone home


this is obviously the most complex code of all the options, which is the price you pay for incorporating all the features of the others....


the whole point being what limitations and benefits each method offers, depending on what your needs are... honestly fo most things I'd go with Ordinal's suggestion


you can get an extra timer for the current state only (gets wiped on state change) by using the no_sensor event, and llSensorRepeat( "Null", llGetKey(), AGENT, 0.01, PI, timer_length );

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...