Avsitter Furniture Remote Control Script
It could be useful to embed this script in the root of avsitter furniture as it allows one to change poses by name (the name on the menu button) on a private channel. The person sending the command or the owner of a device (animesh bot or attachment) must be on the list of allowed user uuids ALLOWED. For a bot to use this, the bot should sit the relevant avatars on the furniture, and then select pose. All you need to do is send the name of the pose to channel CHAN.
integer CHAN = -998998; // channel for setting poses
list ALLOWED = [ "64062a3b-d337-42a4-9847-87adf4d140be"]; // list of av keys allowed to change poses
default
{
state_entry()
{ llListen(CHAN,"",NULL_KEY,"");
}
listen(integer chan, string name, key id, string t)
{ if(llListFindList(ALLOWED,[(string)llGetOwnerKey(id)]) == -1) return;
// llSay(0,"pose-remote received:"+t);
llMessageLinked(1,90000,t,""); // t is pose name - text of channel message
}
link_message(integer l, integer n, string t, key id)
{ // llOwnerSay((string)l+"|"+(string)n+"|"+t+"|"+(string)id); // to sniff codes
}
}
A bit of code that could be added to the ai card in a bot to use this might look like
#TEST OF FURNITURE CONTROL
benchbj|ctrl channelsay -998998 BJ LVS1
benchbj|ctrl channelsay -998998 BJ LVS1
When the bot hears "benchbj" it triggers the animation with button name BJ LVS1
Comments
Post a Comment