Advertisement
Gayngel

mAlias

Aug 19th, 2021
1,999
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer chn = -133742069; //make sure it matches chn in the emiter
  2. string div = "|"; //divider. make sure it matches, too.
  3.  
  4. rotation rot;
  5. vector pos;
  6. list parse;
  7. string nAlias; //node alias (received through the inbound message)
  8. string mAlias; //my alias; set the object's description to the same as the emiter
  9. integer cAlias; //compare aliases
  10.  
  11. default{
  12.     state_entry(){
  13.         llListen(chn,"","","");
  14.         llSetTimerEvent(4.0);
  15.         mAlias = llGetObjectDesc();
  16.     }    
  17.     listen(integer ch,string n,key id,string ms){
  18.        
  19.          mAlias = llGetObjectDesc();
  20.          
  21.         parse = llParseString2List(ms,[div],[]);
  22.          nAlias = llList2String(parse,2);
  23.  
  24.         if (ch == chn && nAlias == mAlias){
  25.             cAlias = TRUE;
  26.            
  27.            
  28.             rot = (rotation)llList2String(parse,0);
  29.             pos = (vector)llList2String(parse,1);
  30.            
  31.            
  32.            
  33.          
  34.             llSetRegionPos(pos);
  35.             llSetLocalRot(rot);
  36.         }
  37.         else cAlias = FALSE;
  38.         llOwnerSay("Debug: "+"\nrotation: "+(string)rot+"\nposition: "+(string)pos+"\nnode alias: "+nAlias+"\nmy alias: "+mAlias+"\nalias check: "+(string)cAlias+"\nfull message: "+ms);
  39.     }
  40.     timer(){
  41.         mAlias = llGetObjectDesc();
  42.     }
  43.     changed(integer chng){
  44.         if(chng & CHANGED_OWNER){
  45.             llResetScript();}}
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement