Jump to content

Scripting RLV Help Understanding


2toe Bigboots
 Share

You are about to reply to a thread that has been inactive for 3238 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Im entering a diff type of scripting here (RLV) and would love some help understanding how it works. Ive seen the website and have been reffering to it. But still lost. i need to see a small script for RLV and someone to explane whats happening, i know that there is req for when certin commands work like has to be attached but again not clue.

Link to comment
Share on other sites

Hi,

you can get free RLV-orbs that contains full-perm scripts. There you can learn the basics of how to take/release control, the obstacles on doing that and the basic commands.

The rest is like standard LSL, search Internet for available commands and test them.

Some free Collars or Cuffs are full-perm.

Monti

Link to comment
Share on other sites

Before you confuse yourself more by starting to learn a different system, consider that RLV will have no effect whatsoever on most people.  As RLV is 'non-standard' it requires a RLV-enabled third-party viewer (TPV) to work.  Unless you know that whoever will be using your script(s) will also be using an RLV-TPV it would be better to stick to the basics until you are comfortable with them.

Link to comment
Share on other sites

First  you're going to have to decide if you're making something that only needs to affect the owner (e.g. a collar) or something something that affects anyone who uses RLV.    This is because all RLV commands are in the form llOwnerSay("@something"), so if you're making something that tries to affect people other than the owner, it has to issue commands in a form their RLV relay can understand, since the relay will -- if the command is properly formed and it's set to accept commands from your object -- parse the command into llOwnerSay().

Here's two very basic scripts to give you an idea of how it works and what the differences are.   The first checks if the owner is using RLV/RLVa and, if she or he is, force sits them and then removes their shirt and pants.    The second does the same, but works for anyone using a relay.   Notice the differences.

//use RLV to force sit the owner and then remove his or her shirt and pantsinteger MyChan;//channel the victim should useinteger handle;key owner;key victim;default{	state_entry()	{		llSitTarget(<0.0,0.0,0.5>,ZERO_ROTATION);//object has to have a sit target for this to work		MyChan = (integer)llFrand(1000000.0)+1000;//must be positive		owner = llGetOwner();	}	touch_start(integer total_number)	{		if(llDetectedKey(0)==owner){			victim ="";			llListenRemove(handle);			handle =llListen(MyChan,"",owner,"");			llOwnerSay("@versionnum="+(string)MyChan);//ask what version number of rlv the owner is using //and say what channel to use for the reply			llSetTimerEvent(2.0);//need to set a timer since, if the owner's not using rlv, //we won't hear back		}	}	changed(integer change)	{		if(change & CHANGED_OWNER){			owner = llGetOwner();		}		else if(change & CHANGED_LINK){			key k = llAvatarOnSitTarget();			if(k==owner){				if(victim){//if we've already established the owner has rlv, so as not to spam him or her					llOwnerSay("@remoutfit:shirt=force,remoutfit:pants=force");					//remove the owner's shirt and pants -- note how several commands can be issued				}			}		}	}		listen(integer channel, string name, key id, string message)	{		//we've heard back, so the owner is using rlv-- doesn't matter what version number for this script		llSetTimerEvent(0.0);		llListenRemove(handle);		victim = owner;		llOwnerSay("@sit:"+(string)llGetKey()+"=force");//tell the owner to sit on the prim;	}	timer()	{		//timed out -- not using rlv		llSetTimerEvent(0.0);		llListenRemove(handle);	}}

 

//use RLV to force sit anyone with an active RLV relay and then remove his or her shirt and pantsinteger MyChan;//channel the victim should useinteger handle;integer rlvrc = -1812221819; //channel all relays usekey victim;string command;//when communicating with relays, part of the command has to be an arbitrary string of your choice. You don't actually have to use it for anything //though it's very useful when you're trying to keep track of what's going on, or when the relay is confirming it's executed commands, but it has to be theredefault{    state_entry()    {        llSitTarget(<0.0,0.0,0.5>,ZERO_ROTATION);//object has to have a sit target for this to work        MyChan = (integer)llFrand(1000000.0)+1000;//must be positive    }    touch_start(integer total_number)    {        victim ="";        llListenRemove(handle);        victim = llDetectedKey(0);        handle  = llListen(MyChan,"",victim,"");        command = "checking";        llRegionSayTo(victim,rlvrc,command+","+(string)victim+",@versionnum="+(string)MyChan);        //and say what channel to use for the reply        llSetTimerEvent(2.0);//need to set a timer since, if the victim's not using rlv, //we won't hear back    }    changed(integer change)    {        if(change & CHANGED_LINK){            key k = llAvatarOnSitTarget();            if(k == victim){//if we've already established the victim has rlv, so as not to spam him or her                command = "clothes";                llRegionSayTo(victim,rlvrc,command+","+(string)victim+",@remoutfit:shirt=force|@remoutfit:pants=force");                //remove the victim's shirt and pants -- note how multiple commands are issued to a relay            }        }    }    listen(integer channel, string name, key id, string message)    {        //we've heard back, so the victim is using rlv-- doesn't matter what version number for this script        llSetTimerEvent(0.0);        llListenRemove(handle);        command = "sit";        llRegionSayTo(victim,rlvrc,command+","+(string)victim+",@sit:"+(string)llGetKey()+"=force");        //tell the victim to sit on the prim    }    timer()    {        //timed out -- not using rlv        llSetTimerEvent(0.0);        llListenRemove(handle);    }}

 

Link to comment
Share on other sites

Alright kool thanks for the examples that will help me understand how to form RLV script a lot. Also i will be going to get thous orbs that were mentiond.  also yes what im making is for ppl with RLV so np there. than kyou all if you can think of any little things that may help let me know thank you.

Link to comment
Share on other sites

RLV itself is reasonably straightforward, or I think it is.

It starts to get complicated quite quickly, though, because you usually need to do a lot of checking to make sure things have happened in the order you're expecting them to, and also to have some error-handling in place for when they don't happen as expected (the sim is laggy, so it's taking time to add or remove clothing or attachments, the avatar is under some restrictions from an unrelated item that interfer with what you're trying to do, and so on).

And, most important of all, you need to make sure at the end of the session you release the avatar from all the restraints you've imposed.

Link to comment
Share on other sites

Okay so im having issues with this script im writeing for RLV. This is just so i can understand it very simple. What always gets me is list and string2list and key2name2list back to string  all very much harder then it should be. But thats a diffrent story heres what i got.

were im stuck is sencing players around me so they can show on llDialog  so i can click there names and add to owners list. Ive tryed every combo i can think of just stumped by the thing. Hope someone can help. 

REMEMBER THIS ISNT FOR USE ITSW JUST SO I CAN UNDERSTAND THE RLV SCRIPTING AND FUNCTIONS.

Thank you.

 

 

list owners = [];list menu = ["owner","lock","unlock"];key DK;string KN;list LN = [];default{	state_entry()	{		DK = llDetectedKey(0);		KN = llKey2Name(DK);		LN = llCSV2List(KN);		llListen(1,"","","");		llListen(2,"","","");	}	touch_start(integer total_number)	{		llDialog(llDetectedKey(0),"Choose",menu,1);	}	listen(integer channel, string name, key id, string message)	{		if(message == "who")			llOwnerSay(llDumpList2String(owners,"'"));		if(message == "unlock")			llOwnerSay("@detach=y");		if(message =="lock")			llOwnerSay("@detach=n");		if(message =="owner")			llDialog(llGetOwner(),"choose persone to add to owner list",[LN],2);		if(channel ==2)			owners +=[(string)llKey2Name(id)];	}	sensor(integer total_number)	{	}}

 

Link to comment
Share on other sites

Shall we say that this goes wrong immediately:

  • DK = llDetectedKey(0): The llDetected*() functions don't work in state_entry (http://wiki.secondlife.com/wiki/LlDetectedKey)
  • KN = llKey2Name(DK): Since you don't have a key in DK you aren't going to get a name in KN.
  • LN = llCSV2List(KN): And even if you did it wouldn't be CSV text.

Start simple, start slow.  Add bits when the simplest things work.  One step at a time, especially when you're learning.  Now what are you trying to do first?  "[sensing] players around me" - so you need llSensor() (http://wiki.secondlife.com/wiki/LlSensor).  When's that meant to happen?  No idea, because you're making us guess again.  I'll assume on touch, just for the sake of an example:

 

default{	on_touch(integer HowMany){		llSensor("", "", AGENT, 96.0, PI);	}	no_sensor(){		llOwnerSay("No-one else is here.");	}	sensor(integer HowMany){		list Nearby = [];		while(HowMany--){			Nearby += [llDetectedName(HowMany)];		}		// ... And now you have your list	}}
Link to comment
Share on other sites

also whats the best way to listen to multipl channels ?

Kool your example answerd my listing issue i see that right off. Ya i found out that detect wont work there. was just fideling with some ideas, tring to show ppl around me in dialog on touch  when i click there name in dialog it adds to list. Thank you. I think i will redo and much simpler this time your right.  Also if anyone knows how the hole slave owner thing works in RLV let me know the @commands for adding someone to owner of persone wearing item.

Link to comment
Share on other sites

There's nothing special about adding owners.

Simply have a list, "owners", and add people to it, using the method above or something similar (I prefer adding llGetUsername(id) to this sort of list, since it makes it simpler to list owners later on, should you want to, and to remove them).

Anway, once you've done that, simply check, in the listen event

 

listen(integer channel, string name, key id, string msg)	{		if(~llListFindList(owners,[id])){		 //the speaker is on the owners' list, so process the command					}			}

 or, if you're doing it my way, 

listen(integer channel, string name, key id, string msg)	{		if(~llListFindList(owners,[llGetUsername(id)])){		 //the speaker is on the owners' list, so process the command					}			}

 

 

  • Like 1
Link to comment
Share on other sites

i must be having a channel mix up cause everything works so far exept removing ppl from list. i bet its a channel mix up just dont know were.....

 

 

 

list buttons = ["Owners","settings"];
list Owners = ["add","remove","list"];
list settings = ["chat","move","tp"];
list masters = [];
list Nerby = [];
integer mAPI_items_number;
integer mAPI_last_page_items;
integer mAPI_page = -1; // must be set to -1
integer mAPI_pages_number;
list chat = ["send chatY","send chatN","shouting Yes","shouting No","only whisper","no whispering","no public"];
//integer i;


list mAPI_SetButtons(list menu_items)
{
if(mAPI_page == -1)
mAPI_GetPagesNumber(menu_items, llGetListLength(menu_items));
if(mAPI_items_number < 12)
return mAPI_SetButtonsSinglePage(llListSort(menu_items, 1, TRUE));
else
return mAPI_SetButtonsMultPages(llListSort(menu_items, 1, TRUE));
}

//----------------------------
mAPI_GetPagesNumber(list src, integer src_len)
{
mAPI_items_number = src_len;
if(src_len > 11)
{
mAPI_pages_number = src_len / 9;
mAPI_last_page_items = src_len % 9;
if(mAPI_last_page_items != 0) mAPI_pages_number++;
else mAPI_last_page_items = 9;
}
else
{
mAPI_pages_number = 1;
mAPI_last_page_items = src_len;
}
mAPI_page = 1;
}

//----------------------------


list mAPI_SetButtonsMultPages(list src)
{
list wlist;
list page_src;
list dest;
list auto = ["<==, "Exit", "==&gt];
list matrix = [ 0,1,2,0,1,2,0,1,2];
integer first;
integer last;
integer i;
integer items = 9;

if(mAPI_page > mAPI_pages_number) mAPI_page = 1;
else if(mAPI_page == 0) mAPI_page = mAPI_pages_number;

first = (mAPI_page - 1) * 9; // 0, 9, 18, etc
last = mAPI_page * 9 - 1; // 8, 16, 24, etc
page_src=llList2List(src, first, last);

if(mAPI_page == mAPI_pages_number)
{
items = mAPI_last_page_items;
if(mAPI_last_page_items % 3 == 1) // 7, 4 ,1
matrix = llDeleteSubList(matrix,1,2);
else if(mAPI_last_page_items % 3 == 2) // 8, 5, 2
matrix = llDeleteSubList(matrix,2,2);
}
for(i=0; i< items; i++)
{
wlist = llList2List(page_src, i, i);
dest = llListInsertList(dest, wlist, llList2Integer(matrix, i));
}
dest = llListInsertList(dest, auto, 0);
return dest;
}

//----------------------------
// This function will arrange up to 11 menu buttons in alphabetical order from the top left to the bottom
// right for display by llDialog() function. The buttons arrangement in llDialog() is
// 9 10 11
// 6 7 8
// 3 4 5
// 0 1 [2]
// Position # 2 is taken by 'auto' button.
// The input list is alphabetically sorted so all we need to do is to rearrange the list from
// [a,b,c,d,e,f,g,h,i,j,k] to [i,j,k f,g,h,c,d,e,a,b,'auto'], considering of course that the input
// list may contain less than 11 elements.

list mAPI_SetButtonsSinglePage(list src)
{
list wlist;
list dest;
list auto = ["Exit"];
list matrix = [ 0,1,2,0,1,2,0,1,2,0,1];
integer i;

if(mAPI_last_page_items % 3 == 1) // 10, 7, 4 ,1
matrix = llDeleteSubList(matrix,2,2);
else if(mAPI_last_page_items % 3 == 0) // 9, 6, 3
matrix = llDeleteSubList(matrix,1,2);

for(i=0; i< mAPI_last_page_items; i++)
{
wlist = llList2List(src, i, i);
dest = llListInsertList(dest, wlist, llList2Integer(matrix, i));
}
dest = llListInsertList(dest, auto, 2);
return dest;
}

// API CODE END
//==============================
// USAGE SAMPLE START
// This sample will make a menu of contents of a prim the script is in.
// It will not include itself in the menu.
// The script illustrates menu making not menu processing so it does nothing
// on a button click other than an arrow. That's for you to code yourself.

float MENU_TIMEOUT = 30.0;
list inventory_items = [];
integer lhandle;

//------------------------------
// user function, not a part of the mAPI
MakeMenu(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(buttons); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}
MakeMenuOwners(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(Owners); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}
MakeMenuSettings(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(settings); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}
MakeMenuMasters(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(masters); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}
MakeMenuChat(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(chat); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}
MakeMenuNearby(key id)
{
list menu;
string mtext = " ";
integer mchan;

menu = mAPI_SetButtons(Nerby); // call mAPI to make alphabetical menu list
while(!mchan) mchan = -llFloor(llFrand(2000000)); // make some random channel, less lag with negative channels
mtext += (string)mAPI_page + " of " + (string)mAPI_pages_number;
llSetTimerEvent(MENU_TIMEOUT);
lhandle = llListen(mchan, "", id, ""); // listen on sending channel
llDialog(id, mtext, menu, mchan); // send menu
}

//------------------------------

default
{
state_entry()
{
//

}
touch(integer total_number)
{
llSensor("",NULL_KEY,AGENT,96,PI);

MakeMenu(llGetOwner());


}
attach(key attached)
{
llOwnerSay("@version=0");
}
sensor(integer total_number)
{


while(total_number--)
{
Nerby += [llDetectedName(total_number)];
}

}
listen(integer channel, string name, key id, string message)
{
integer n = llListFindList(masters,[message]);

if(message == "Owners")
MakeMenuOwners(id);
if(message == "add")
MakeMenuNearby(id);
if(message != "Exit")
masters += [message];
if(message == "list")
llOwnerSay(llDumpList2String(masters," | "));
if(message == "remove")
MakeMenuMasters(id);
if(~n)
masters = llDeleteSubList(masters,n,n);
if(message == "settings")
MakeMenuSettings(id);
if(message == "chat")
MakeMenuChat(id);
if(message =="send chatN")
llOwnerSay("@sendchat=N");
if(message =="send chatY")
llOwnerSay("@sendchat=Y");
if(message =="shouting yes")
llOwnerSay("@chatshout=Y");
if(message =="shouting N0")
llOwnerSay("@chatshout=N");
if(message =="no whisper")
llOwnerSay("@chatwhisper=n");
if(message ==" yes whisper")
llOwnerSay("@chatwhisper=y");


}
}

 

Link to comment
Share on other sites

When something's going wrong with a listen event, the first thing I do is put llOwnerSay("Channel is "+(string)channel+", and message is "+msg) right up at the start of the listen event, before anything else happens, so I know for sure what message I'm hearing (if, that is, I'm hearing it) and what channel I'm hearing it on.

 

Link to comment
Share on other sites

not a bad idea at all, but what about my dialog issue were all the buttons arnt showing. someone sugested A) its being over written with a auto "ecit" but that would be just one button.  Also trying to change it so i have only 2 MakeMenu in there but idk how to make it choose a list to show as buttons based on what was choosen in dialog B4. Say i choose chat.

Link to comment
Share on other sites

I think you're over-complicating stuff with these MakeMenu functions, which seem to me far too complex and also unnecessary.

First, the only time -- at the moment -- you're going to need to build a menu on the fly, or have a multiple page menu, is in the sensor event, so let's keep the MakeMenu stuff for that.   Actually, I wouldn't use MakeMenu at all -- I'd go with an example like DialogPlus, which is a lot simpler and more flexible.

But for the other menus, you know what your entries are, and you know you're not -- at the moment -- going to need more than a page for each menu, so why not stick with llDialog?

As to pulling up submenus, you have a list of main menu options, give the user a menu based on those, and then, if the message is from that list, you make another menu based on a sublist.

Something like this:

 

integer chan;integer handle;list main=["Food","Drink"];list foods=["Bread","Cake","Pie"];list drinks =["Tea","Coffee","Milk"];list submenu;string caption;list order_buttons(list buttons){	return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)		+ llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);}default{	state_entry()	{		chan = llFloor(llFrand(1000000.0)) *-1;	}	touch_start(integer total_number)	{		key k = llDetectedKey(0);		llListenRemove(handle);		llSetTimerEvent(30.0);		handle = llListen(chan,"",k,"");		caption = "Please choose something";		llDialog(k,caption,order_buttons(["Finished"]+main),chan);	}	timer()	{		llListenRemove(handle);		llSetTimerEvent(0.0);	}	listen(integer channel, string name, key id, string message)	{		if("Finished"==message){			llListenRemove(handle);			llSetTimerEvent(0.0);			return;		}		llSetTimerEvent(20.0);		if ("Main Menu"==message){			caption = "Please choose something";				llDialog(id,caption,order_buttons(["Finished"]+main),chan);		}		else if(~llListFindList(main,[message])){//a message from the main menu			if("Food"==message){				caption = "Please choose something to eat";				submenu=["Drink"]+foods;			}			else {				caption = "Please choose something to drink";				submenu=["Food"]+drinks;			}			llDialog(id,caption,order_buttons(["Finished","Main Menu"])+submenu,chan);		}		else{//message from one of the submenus			llRegionSayTo(id,0,"You chose "+message);			llDialog(id,caption,order_buttons(["Finished","Main Menu"])+submenu,chan);		}	}}

 If I may suggest this, I think you really need to get a good handle on llDialog before you embark on doing stuff of any complexity with RLV.  

Certainly I think you're going to need to figure out a way of having dynamic menu buttons, so that they switch between "Forbid Chat" and "Allow Chat", for example, rather than wasting space and confusing people with presenting both options when one is an invalid choice.   

Link to comment
Share on other sites

  • 2 weeks later...

hi someone wants me to be their slave but they have team viewer they insisted on me using their collar not my collar luckily could not figure out how to assign them as owner but could someone please tell me is there a danger they could hack my pc files with team viewer, i have never downloaded team viewer so i am thinking my pc might be safe and they can only control me in second life please advise somebody as i am now avoiding s/l just incase

Link to comment
Share on other sites

No one is likely to use team viewer to hack your computer.  If you give a thief the keys to your front door there is no need for them to break in.  To be absolutely clear:

  • Team viewer is nothing to do with Second Life.
  • This question is nothing to do with Second Life scripting.
  • If you allow people to use team viewer or anything else to control your computer then THEY CONTROL YOUR COMPUTER.
  • Letting people control you IN Second Life, with Second Life, does not let them control the rest of your computer.
Link to comment
Share on other sites

  • 2 months later...

I am an excellent programmer, which makes LSL scripting and RLV quite easy for me.  I enjoy messing around with RLV, however there is one noticeable command missing from it:  The ability to restrict someone's ability to offer a TP to another.  I'm not sure that you folks are the correct place to ask for this, but I'm not sure where the correct place is.  I can be reached at kyleflynnresident@gmail.com or online as kyleflynn.  Happy SLing.

Link to comment
Share on other sites

  • 7 months later...
  • 2 years later...

Here is my first attempt at RLV scripting, adapting some code I have found around the web and adding comments to help understand the flow.  I hope it is helpful to others. 

 

Darius Renneville

// this script tests RLV in two ways: stepping upon prim, or colliding with prim will teleport victim to set coordinates then lock down tp and far touch for 20 seconds. Touching the prim will test if any avatars within 10m of the prim are wearing a RLV relay.

// format for a RLV command: llSay( Channel for Relay, "any string to help you remember what command you are sending" , ( comma) "string key of victim" , ( comma) "string of RLV commands. The first one must start with @. All commands separated with | " );

// to use this script, I rezzed two 3 x 3 x 0.1 boxes, one black and one white. I placed the x,y,z coordinates of the black box in the vector named "place" and this script in the white box. By stepping onto the white box with an active relay, I am instantly tp'ed to the black box with tp and far touch abilities locked out for 20 seconds. By touching the white box, I see that my relay is active ( or not ) and learn the version number of my relay.

// I hope this script helsp you understand how RLV commands work.
// Darius Renneville

integer rlvrc =-1812221819; // the channel used to send commands to a RLV relay. This channel is part of the RLV protocol and cannot be changed
integer sendchan = -4860475969; // the channel for receiving messages from the RLV relay
string cmd_name = "nothing here"; //arbitrary name, useful at times so you can identify commands
string victim;
vector place = <118, 112, 501.5>; // the coordinates of where I want to force tp the victim upon stepping on the prim.
string gohere = "118/112/501.5"; // above coordinates in text format
vector NoGoHere;
list Coords;
string NoTele = "@sittp=n|@tploc=n|@tplure=n|@tplm=n|@fartouch=n"; // string of RLV commands: no sit tp, location tp, invited tp, tp from an LM, or far touch.
string YesTele = "@sittp=y|@tploc=y|@tplure=y|@tplm=y|@fartouch=y|!release"; // string of RLV commands releasing the above restrictions.

list people;


integer handle;
key person;

default
{
state_entry()
{
NoGoHere = llGetRegionCorner() + place; // take the vector coordinates of my target and adjust to sim coordinates that RLV can understand
Coords = llParseString2List((string)NoGoHere,["<", ">", ","],[]); // parse the vector into a string that RLV can understand
gohere = llList2String(Coords,0)+"/"+llList2String(Coords,1)+"/"+llList2String(Coords,2);// set up the string containing the target vector in RLV format
}

collision_start(integer total_number) // potential victim has stepped on the prim
{
victim = (string)llDetectedKey(0); // grab victim's UUID key and save as a string
llSay(rlvrc,"teleport" +","+victim+","+"@tpto:"+gohere+"=force"); // send RLV command to teleport victim to the target vector
llSay(0,"teleport" +","+victim+","+"@tpto:"+gohere+"=force" );// debug message saying that teleport message was sent
llSay(0, "Sending teleport block command"); // debug message saying that tp abilities about to be blocked
llSay(rlvrc,"teleportno"+","+victim+","+NoTele); // send RLV command to block teleport and far touch
llSleep(20); // rest 20 seconds with victim's abilities blocked
llSay(rlvrc,"release"+","+victim+","+YesTele); // send RLV command to release the tp and far touch restrictions
llSay(0,"released"); // debug message stating that RLV restrictions should be released
}

touch_start(integer num) // touching prim will test if toucher is wearing an active RLV relay and give the version number of relay.
{
llSensor("",NULL_KEY,AGENT,10, PI);
}


sensor(integer detected)
{
while(detected--) // let's test for relays on all people detected within the range of the sensor
{
llSay(0,llDetectedName(detected)+" was detected."); // debug message. This avatar was detected by the sensor
llListenRemove(handle); // stop listening on this channel to minimize lag
person = llDetectedKey(detected); // grab key of detected person
handle = llListen(sendchan, "", "", ""); // listen for message from RLV relay
llSay(rlvrc, "TEST"+","+(string)llDetectedKey(detected)+","+"@versionnum="+(string)sendchan); // send detected person's relay a message to get version number
llSetTimerEvent(5.0); // if no response within 5 seconds, go to timer event and state no relay found.
}


}

listen(integer channel, string name, key id, string msg)
{
if( channel == sendchan) // message received from relay
{
llSetTimerEvent(0); // relay active, so kill timer event
llListenRemove(handle); // stop listening for relay and minimize lag
llSay(0, llGetDisplayName(person)+" is using RLV relay version "+msg); // debug message that detected person is wearing a relay with version msg

}

}

timer() // timer not stopped by listen event, so no RLV relay detected
{
llSetTimerEvent(0.0); // stop timer event
llListenRemove(handle); // stop listening for message from non existant relay
llSay(0, llGetDisplayName(person)+" is NOT wearing an active RLV relay!"); // debug message stating that no relay was detected on the avatar



}


}

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3238 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...