Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Camping Script and Rolling Restarts or Sim Reset

Joella Nico
Registered User
Join date: 14 Jun 2005
Posts: 49
02-07-2008 21:22
I'm having a big problem lately with my camping scripts. If someone is on the camper and the island has a rollback or reset it will boot everyone but when the island is back up the camping spots are acting like someone is still on it. No one can go on them and the money they earn still continues to grow.
Anyone else having this happen? And does anyone know how to fix this?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-07-2008 21:45
the scripts keep their state (most of the time) on resets, so they aren't getting a message that the av got up, the way to stop this is to periodically check if the av is still there, or check to see if a new av sits on it w/o getting a message that the last one left.
_____________________
|
| . "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...
| -
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
02-07-2008 23:30
if (llAvatarOnSitTarget() == NULL_KEY)
{
// reset script and/or pay out last sitter
}

Advanced stuff:
it is also possible to read out the current sim state like, shutting down / starting up and act on these.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-08-2008 00:28
slight modification of the above

if (!llAvatarOnSitTarget()){

if a datatype is key, as long as there's a valid key in there it evaluates as true, if it's not valid, it's false... (and NULL_KEY (00000000-0000-0000-0000-000000000000) is considered invalid, even though it follows format, oddly)

more specifically as long as the key follows the format it's valid, except if all zeros... anything else is false

since av on sit target returns either an av key, or null key, it's easy to treat it as a true/false, faster smaller code
_____________________
|
| . "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...
| -