Advertisement
TheSpicePhantom

stargate_iris

Mar 29th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_1")
  2. local sg = peripheral.wrap("stargate_1")
  3.  
  4. function iris()
  5.     local state, engaged, direction = sg.stargateState()
  6.     if state == "Idle" then
  7.  
  8.     elseif state == "Dialling" and direction == "Outgoing" then
  9.         sg.closeIris()
  10.     elseif state == "Dialling" and direction == "Incoming" then
  11.         sg.closeIris()
  12.     elseif state == "Connected" then
  13.         sg.openIris()
  14.     elseif state == "Closing" then
  15.         sg.closeIris()
  16.     end
  17. end
  18.  
  19. while true do
  20.    
  21.     sleep(0.1)
  22.     iris()
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement