petomka

Untitled

Aug 10th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. m = peripheral.wrap("top")
  2. m.clear()
  3.  
  4. m.setBackgroundColor(colors.green)
  5. m.clear()
  6. m.setCursorPos(2,3)
  7. m.write("OPEN")
  8.  
  9. function Toggle()
  10.  redstone.setOutput("bottom",true)
  11.  m.clear()
  12.  m.setBackgroundColor(colors.red)
  13.  m.clear()
  14.  m.setCursorPos(2,3)
  15.  m.write("OPENED")
  16.  sleep(2.5)
  17.  redstone.setOutput("bottom",false)
  18.  m.clear()
  19.  m.setBackgroundColor(colors.green)
  20.  m.clear()
  21.  m.setCursorPos(2,3)
  22.  m.write("OPEN")
  23. end
  24.  
  25. while true do
  26.  event,side,x,y = os.pullEvent()
  27.  if event == "monitor_touch" then
  28.   Toggle()
  29.  end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment