Guest User

startup

a guest
May 31st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. sg = peripheral.find("stargate")
  2. while true do
  3.   term.clear()
  4.   term.setCursorPos(1,1)
  5.   iris = sg.irisState()
  6.   print("Iris is currently " ..iris)
  7.   if iris == "Offline" then
  8.     print("Connect Iris.")
  9.   else
  10.     print("Press enter to change")
  11.     event, key = os.pullEvent("key")
  12.     if key == keys.enter then
  13.       if iris == "Closed" then
  14.         sg.openIris()
  15.       elseif iris == "Open" then
  16.         sg.closeIris()
  17.       end
  18.     end
  19.   end
  20. end
Add Comment
Please, Sign In to add comment