Don't click here unless you want to be banned.

LSL Wiki : llScriptDanger

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawling22.us.archive.org
integer llScriptDanger(vector pos)

llScriptDanger is an outdated function. llGetParcelFlags should be used in its place
Returns TRUE if pos is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts. This function allows a script to find out if it's in danger of getting deleted or disabled.

Note: this will still return TRUE if the containing object is located more than 45 meters above no-script ground. The no-script "field" extends only 45m in the air, but only stops scripts from executing if they're not already running when they enter the zone (parcel/region/simulator). (Say, if they're in attachments and the user teleports in, or if the user tries to start a new script.) Scripts that are already running when they enter the zone will still work.

To find out if the land is public, use llGetLandOwnerAt.

llScriptDanger utility function:
integer LAND_UNEDITABLE = 1;
integer LAND_PUBLIC     = 2;
integer LAND_NO_SCRIPT  = 4;
// Returns as much data as possible about
// the status of the land at the position
// because llScriptDanger is so limited, 
// the integer it returns is a "best guess"
// to the reason for the danger.
integer landStatus(vector pos) {
    if (llGetLandOwnerAt(pos) == NULL_KEY) {
        return LAND_PUBLIC;
    }
    
    integer scriptDanger = llScriptDanger(pos);
    if (!scriptDanger)
        return 0;
    
    integer status = LAND_UNEDITABLE;
    // Check if the position is below the no-script height limit.
    // (Note: no-script land will be set as no-script anywhere over it,
    // but only scripts that attempt to START running under
    // 45m above the ground height will be disabled.
    // Scripts already running when they enter the parcel,
    // or those that start OVER 45m above the parcel will
    // all run within the no-script zone.)
    if (llGround(pos - llGetPos()) <= 45) {
        status = status | LAND_NO_SCRIPT;
    }
    return status;
}

Q: Is there a function to find out if the land has scripts off, or is no-build? Anything other than all-in-one?
A: No, there's only llScriptDanger, which returns all or nothing. You could check the results of llGetLandOwnerAt to see if the land is public, but there's no way for a script to access any data beyond that.
After the 1.9 update, we'll be able to use llGetParcelFlags to get all this info, though that will not work in the main grid yet.

Q: In versions past, certain script functions wouldn't run in no-script zones, even if the scripts were otherwise already running. Is this still the case, and if so, is there a list of functions that currently do not run?
A: llParticleSystem and llSetBuoyancy continue running (but can't be re-executed) in no-script areas. There are probably other functions but I haven't tested them. -EepQuirk


Functions | Land | Simulator | Script
Comments [Hide comments/form]
You can't exactly get around the time delay with llMessageLinked(). The slave script that calls llScriptDanger() will delay before it is able to get the information back to the main script :)
-- LexNeva (2005-02-23 15:14:44)
I was getting some "false positives" from this, so I did some digging... as near as I can tell, if there is any kind of return timer on the land in question this function will return true. This is not mentioned above, and may be new. I also might be wrong. Can someone confirm this?
-- StickMan (2006-02-02 04:57:06)
That doesn't supprise me, though i don't know if the behaivor is new. They probably added it, as it makes good sence. Though llScriptDanger isn't the most useful function as it doesn't give you any info about the lands attributes.
-- BlindWanderer (2006-02-02 19:36:24)
Now we have llGetRegionFlags, is this function depreciated?
-- TiPBaKeR (2006-03-16 00:13:19)
Probably not, but you will get better results with llGetRegionFlags.
-- BlindWanderer (2006-03-16 01:06:04)
Attach a comment to this page: