Difference between revisions of "User:Daemonika Nightfire/Scripts/Region Reboot Messenger"

From Second Life Wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
'''Script Time!'''
'''Script Time!'''
  The Script 0.002 - 0.003 ms.
  The Script 0.002 - 0.003 ms.
<lsl>
<source lang="lsl2">
// *DS* Region Reboot Messenger by Daemonika Nightfire (daemonika.nightfire)     
// *DS* Region Reboot Messenger by Daemonika Nightfire (daemonika.nightfire)     
// Ready for Multi-User, you can set more than one Person to get a message when the Sim where this script is running has restart.
// Ready for Multi-User, you can set more than one Person to get a message when the Sim where this script is running has restart.
Line 58: Line 58:
     }
     }
}
}
</lsl>
</source>


==Single-User (Owner) Version==
==Single-User (Owner) Version==
Line 65: Line 65:
'''Script Time!'''
'''Script Time!'''
  The Script 0.002 - 0.003 ms.
  The Script 0.002 - 0.003 ms.
<lsl>
<source lang="lsl2">
key Owner;
key Owner;


Line 107: Line 107:
     }
     }
}
}
</lsl>
</source>
[http://www.slinfo.de/vb_forum/suche-item-objekt-script/73581-eine-sim-restart-infoscript.html German Diskusion]
[http://www.slinfo.de/vb_forum/suche-item-objekt-script/73581-eine-sim-restart-infoscript.html German Diskusion]

Latest revision as of 09:28, 6 February 2015

*DS* Region Reboot Messenger

Multi-User Version

With this script, find all that are specified in the list when the Sim is back after a restart. So you must then not always look on the map, if the sim is back there.

This is very useful if the sim is restarted during a party.

Script Time!

The Script 0.002 - 0.003 ms.
// *DS* Region Reboot Messenger by Daemonika Nightfire (daemonika.nightfire)    
// Ready for Multi-User, you can set more than one Person to get a message when the Sim where this script is running has restart.
// The Messenger tell you the SLurl to the Region too.

// change in this Memberslist the UUIDs with the Keys from the People you need to get a message.
list Members = ["61ee201a-81cf-4322-b9a8-a5eb8da777c2",  // its me
                "61ee201a-81cf-4322-b9a8-a5eb8da777c2",  // me again
                "61ee201a-81cf-4322-b9a8-a5eb8da777c2"]; // another one me (list expandable)

string SLurl;
string BuildSlurl(string region_name, vector pos)
{
    return "http://slurl.com/secondlife/" + llEscapeURL(region_name) 
            + "/"+ (string)((integer)pos.x) 
            + "/"+ (string)((integer)pos.y) 
            + "/"+ (string)(llCeil(pos.z));
}

default
{
    state_entry()
    {
        llSetText("Landmark to the Club/Mainstore",<1,1,1>,1.0); // floating text
        SLurl = BuildSlurl(llGetRegionName(),llGetPos());
    }

    changed(integer ch)
    {
        if(ch & CHANGED_REGION_START)
        {
            integer i;
            for(i=0; i<llGetListLength(Members); i++)
            {
                llInstantMessage(llList2String(Members,i),"Region has Restarted @ " + SLurl);
            }
        }
    }

    touch_start(integer nd)
    {
        if(llGetInventoryNumber(INVENTORY_LANDMARK) > 0) // LM giver
        {
            llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_LANDMARK, 0));
        }
    }

    on_rez(integer Dae)
    {
        llResetScript();
    }
}

Single-User (Owner) Version

With this script, disguised as "LM giver" you are always up to date, how many times your rented shop, a sim restart is exposed.

Script Time!

The Script 0.002 - 0.003 ms.
key Owner;

string SLurl;
string BuildSlurl(string region_name, vector pos)
{
    return "http://slurl.com/secondlife/" + llEscapeURL(region_name) 
            + "/"+ (string)((integer)pos.x) 
            + "/"+ (string)((integer)pos.y) 
            + "/"+ (string)(llCeil(pos.z));
}

default
{
    state_entry()
    {
        Owner = llGetOwner();
        llSetText("Landmark to the Club/Mainstore",<1,1,1>,1.0); // floating text
        SLurl = BuildSlurl(llGetRegionName(),llGetPos());
    }

    changed(integer ch)
    {
        if(ch & CHANGED_REGION_START)
        {
            llInstantMessage(Owner,"Region has Restarted @ " + SLurl);
        }
    }

    touch_start(integer nd)
    {
        if(llGetInventoryNumber(INVENTORY_LANDMARK) > 0) // LM giver
        {
            llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_LANDMARK, 0));
        }
    }

    on_rez(integer Dae)
    {
        llResetScript();
    }
}

German Diskusion