Advertisement
Guest User

Untitled

a guest
Nov 9th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string header = "chu";
  2. integer cch = 248;
  3. integer onGlobal = 0;
  4.  
  5. ////////////////////
  6. // Command system //
  7. ////////////////////
  8.  
  9. key mSender;
  10. ProcessCommandQueue(list cmds) {
  11.     integer i = 0; integer ii = llGetListLength(cmds);
  12.     for (i = i; i < ii; i++) { // 1 to skip the command header
  13.         ProcessCommand(llParseString2List(llList2String(cmds, i), ["|"], []));
  14.     }
  15.     //
  16. }
  17.  
  18. ProcessCommand(list par) {
  19.     string cmd = llList2String(par, 0);
  20.    
  21.     if /**/ (onGlobal) {}
  22.     else if (cmd=="apply") llMessageLinked(LINK_SET, 5730, "apply|AIOv1|" + llList2String(par, 1), NULL_KEY);
  23.     else if (cmd=="install") {
  24.         llSetRemoteScriptAccessPin((integer)llList2String(par,1));
  25.         llRegionSayTo(mSender, -5730, "install.confirm");
  26.     }
  27. }
  28.  
  29. ////////////
  30. // States //
  31. ////////////
  32.  
  33. default
  34. {
  35.     state_entry()
  36.     {
  37.         llListen(282827, "", llGetOwner(), "");
  38.         llListen(-282827, "", NULL_KEY, "");
  39.         llListen(cch, "", llGetOwner(), "");
  40.         llListen(-cch, "", NULL_KEY, "");
  41.     }
  42.    
  43.     listen(integer channel, string name, key id, string msg)
  44.     {
  45.         if (llGetOwnerKey(id) != llGetOwner()) return;
  46.         string kt = "avatar"; onGlobal = 1;
  47.         if (llAbs(channel) != 282827) { kt = header; onGlobal = 0; }
  48.        
  49.         list cmds = llParseString2List(llStringTrim(msg, STRING_TRIM), ["||"], []);
  50.         { // encapsulate for scope; only need these variables for a short time, let GC toss them after
  51.             list hs = llParseString2List(llList2String(cmds, 0), ["|"], []);
  52.             if (llList2String(hs, 0) != kt) return;
  53.         }
  54.        
  55.         mSender = id;
  56.         ProcessCommandQueue(cmds);
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement