Advertisement
Guest User

Aileron Garage Manager API Example Script

a guest
Aug 19th, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /* This is the API Channel that needs to be set in the Garage Control Panel */
  3. integer api_channel = 5000;
  4.  
  5. /* This DoorID will need to be added into the Garage Control Panel by select "Add ID" */
  6. string door_id = "ExampleDoor";
  7.  
  8. default {
  9.     on_rez(integer s)
  10.     {
  11.         llResetScript();
  12.     }
  13.    
  14.     state_entry()
  15.     {
  16.         llListen(api_channel,"","","");
  17.     }
  18.    
  19.     listen(integer channel, string name, key id, string message)
  20.     {
  21.         if(llGetOwnerKey(id) == llGetOwner())
  22.         {
  23.             list parse = llParseStringKeepNulls(message,["@"],[]);
  24.             string command = llList2String(parse,0);
  25.             string parse_door_id = llList2String(parse,1);
  26.             if(parse_door_id == door_id)
  27.             {
  28.                 if(command == "OPEN")
  29.                 {
  30.                     llOwnerSay("Door Open");
  31.                     llSetStatus(STATUS_PHANTOM,TRUE);
  32.                     llSetAlpha(0.1,ALL_SIDES);
  33.                 }
  34.                 else if(command == "CLOSE")
  35.                 {
  36.                     llOwnerSay("Door Open");
  37.                     llSetStatus(STATUS_PHANTOM,FALSE);
  38.                     llSetAlpha(1,ALL_SIDES);
  39.                 }
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement