Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key user;
- integer PowerState;
- integer DoorState;
- integer ConsoleChan;
- init()
- {
- DoorState = FALSE;
- PowerState = FALSE;
- ConsoleChan = (integer) (llFrand(5000) +20);
- }
- default
- {
- state_entry()
- {
- }
- touch_start(integer num)
- {
- user = llDetectedKey(0);
- integer linknum = llDetectedLinkNumber(0);
- string linkname = llGetLinkName(linknum);
- if ( linkname == "Object" )
- {
- // Do Nothing
- }
- else if ( linkname == "DHD" )
- {
- // Do Nothing
- }
- else if ( linkname == "Power" )
- {
- if ( PowerState == FALSE )
- {
- llMessageLinked(LINK_SET, 9090, "PowerOn", "");
- llShout(ConsoleChan, "PowerOn");
- PowerState = TRUE;
- }
- else if ( PowerState == TRUE )
- {
- llMessageLinked(LINK_SET, 9090, "PowerOff", "");
- llShout(ConsoleChan, "PowerOff");
- PowerState = FALSE;
- }
- }
- else if ( linkname == "DoorControl" )
- {
- if ( DoorState == FALSE )
- {
- llMessageLinked(LINK_SET, 9090, "DoorOpen", "");
- llShout(ConsoleChan, "DoorOpen");
- DoorState = TRUE;
- }
- else if ( DoorState == TRUE )
- {
- llMessageLinked(LINK_SET, 9090, "DoorClose", "");
- llShout(ConsoleChan, "DoorClose");
- DoorState = FALSE;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment