Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer lchan = 5000; // listen on channel 5000;
- integer llisten; // listen handle
- default
- {
- attach(key id)
- {
- if(id) // if object is attached to an avatar/ id is the avatar's uuid
- {
- // set up the listen relay
- llListenRemove(llisten);
- llisten = llListen(lchan,"",llGetOwner(),"");
- //-------------------
- llSetTimerEvent(0.0);
- llSetTimerEvent(5.0); // set a timer to limit how long to listen for the RLV command.
- llOwnerSay("@versionnew="+(string)lchan); // send version number to lchan channel 5000 or whatever lchan is set to.
- }
- }
- listen(integer chan, string name, key id, string msg)
- {
- if(chan == lchan)
- {
- // heard the RLV message on the lchan channel so lets stop the timer and do RLV stuff
- llSetTimerEvent(0.0);
- llOwnerSay("Your RLV is on. Your version is: " + msg); // inform owner that RLV is on and their verion number. Delete this if not needed.
- // do RLV stuff here
- }
- }
- timer()
- {
- // no message received on channel so stop the timer, remove the listen handle , and inform owner that their rlv is off.
- llSetTimerEvent(0.0);
- llListenRemove(llisten);
- llOwnerSay("Your RLV is off.");
- }
- }
Add Comment
Please, Sign In to add comment