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

From Second Life Wiki
Jump to navigation Jump to search
(Created page with '==*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 alway...')
 
 
(3 intermediate revisions by the same user not shown)
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 32: Line 32:
         SLurl = BuildSlurl(llGetRegionName(),llGetPos());
         SLurl = BuildSlurl(llGetRegionName(),llGetPos());
     }
     }
     changed(integer ch)
     changed(integer ch)
     {
     {
Line 43: Line 44:
         }
         }
     }
     }
     touch_start(integer nd)
     touch_start(integer nd)
     {
     {
Line 50: Line 52:
         }
         }
     }
     }
     on_rez(integer st)
 
     on_rez(integer Dae)
     {
     {
         llResetScript();
         llResetScript();
     }
     }
}
}
</lsl>
</source>


==Single-User (Owner) Version==
==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.
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!'''
'''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 81: Line 85:
         SLurl = BuildSlurl(llGetRegionName(),llGetPos());
         SLurl = BuildSlurl(llGetRegionName(),llGetPos());
     }
     }
     changed(integer ch)
     changed(integer ch)
     {
     {
Line 88: Line 93:
         }
         }
     }
     }
     touch_start(integer nd)
     touch_start(integer nd)
     {
     {
Line 95: Line 101:
         }
         }
     }
     }
     on_rez(integer st)
 
     on_rez(integer Dae)
     {
     {
         llResetScript();
         llResetScript();
     }
     }
}
}
</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