Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

weird timer/email problem

Lance Corrimal
I don't do stupid.
Join date: 9 Jun 2006
Posts: 877
01-13-2010 01:21
Hi,

I'm having the weirdest timer/email problem here...

I have a script that runs a timer every 5 minutes.

the timer event looks like this:


string thedate;

timer()
{
if(thedate!=llGetDate())
{
do_my_stuff();
thedate=llGetDate();
}
}



do_my_stuff() basically formats some gathered data and then sends it to my email address.

Now here's the riddle:
I have two objects with that script.
One is sitting on a mainland sim and works fine...
The other one is sitting on an estate homestead sim, and it simply sits there... looks like do_my_stuff() is never called.


Anyone got hints for me?


thanks,
LC
_____________________
From: Ralektra Breda
Your maturity rating is directly reflected by the number of question marks you place at the end of a question.
From: Lindal Kidd
Those who enter any virtual world with the main purpose of making money at it...probably won't.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-13-2010 02:30
First I'd look at the "running" check box, then I'd stick in some llOwnerSay ("I'm here!";) statements to see what exactly is working and what isn't.

ETA: I'd also check for the "no scripts" icon on the estate land.
Lance Corrimal
I don't do stupid.
Join date: 9 Jun 2006
Posts: 877
01-13-2010 02:50
everything else in my thingie works.
just the timer-triggered email doesn't.
and it's only one script in my object.
_____________________
From: Ralektra Breda
Your maturity rating is directly reflected by the number of question marks you place at the end of a question.
From: Lindal Kidd
Those who enter any virtual world with the main purpose of making money at it...probably won't.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-13-2010 02:56
Well the only two possibilities I can see from the code you've offered are that either the timer or the string thedate aren't being set properly.
Lance Corrimal
I don't do stupid.
Join date: 9 Jun 2006
Posts: 877
01-13-2010 03:05
then the other copy of exactly the same object wouldn't work without any problems in a different sim...
_____________________
From: Ralektra Breda
Your maturity rating is directly reflected by the number of question marks you place at the end of a question.
From: Lindal Kidd
Those who enter any virtual world with the main purpose of making money at it...probably won't.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-13-2010 04:07
lols, then I'd be looking at every llGetPos, llGetRegionName, etc, call, and every call that has anything to do with parcels or regions or land or object ownership...

And I'd be peppering the script with llOwnerSay ("variable = " + (string) variable)) statements to try to find what *is* different between the one that works and the one that doesn't.
Lance Corrimal
I don't do stupid.
Join date: 9 Jun 2006
Posts: 877
01-13-2010 04:29
Here's what i did to "install" my two objects:

scripted the stuff, made one object, rezzed it at the mainland location & let it run for a few days to see if it does what it should be doing.

then I went back there, took a copy of the object, and rezzed that copy over at the homestead... where it doesnT work properly.
_____________________
From: Ralektra Breda
Your maturity rating is directly reflected by the number of question marks you place at the end of a question.
From: Lindal Kidd
Those who enter any virtual world with the main purpose of making money at it...probably won't.
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
01-13-2010 08:29
if(thedate! >= llGetDate())

Oops! read that wrong assumed it was "thedate!" but now noticed it was thedate != ...

ignore this. You should really use a space to separate your operands. Makes for better reading.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-13-2010 09:59
Have you tried resetting the script in the estate version?
Lance Corrimal
I don't do stupid.
Join date: 9 Jun 2006
Posts: 877
01-13-2010 11:50
From: Pete Olihenge
Have you tried resetting the script in the estate version?


yep, did that.
didn't help.
_____________________
From: Ralektra Breda
Your maturity rating is directly reflected by the number of question marks you place at the end of a question.
From: Lindal Kidd
Those who enter any virtual world with the main purpose of making money at it...probably won't.
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
01-13-2010 13:09
OK, I give up. What's the answer?
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
01-13-2010 17:22
From: Lance Corrimal


string thedate;

timer()
{
if(thedate!=llGetDate())
{
do_my_stuff();
thedate=llGetDate();
}
}


That really isn't much information to go on, there could be a hundred different reasons why things aren't working as you expect.
Have you tried replacing the line do_my_stuff();
with something like llOwnerSay ?
At least that will help isolate the problem.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-13-2010 17:37
timer runs every 5 minutes, but do_my_stuff shouldn't fire more than once a day (within ~5min of the new day in UTC time).... thedate != llGetDate()

anywhere that compares thedate should be checked for proper comparison operators, vs assignment operators, especially any that are inside if/else chains (a reason it might be broken in one script and not the identical other, one forced a bad test written as assignment based on it's conditions.

as for not firing at all.... nothing in THAT code looks bad, so I'd guess it's somewhere else... OOC is the non working version deeded?
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -