Advertisement
Guest User

Door.lua

a guest
Jan 24th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. modem = peripheral.wrap("bottom")
  2. modem.open(1)
  3.  
  4. while true do
  5.  event, p1, p2, p3, p4 = os.pullEvent()
  6.  if (p4 == "offDoor") then
  7.   os.shutdown()
  8.  end
  9.  
  10.  if (p4 == "open") then
  11.   rs.setOutput("top", true)
  12.   sleep(5)
  13.   rs.setOutput("top", false)
  14.  end
  15.  
  16.  
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement