Guest User

door

a guest
Oct 2nd, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. local side = "left"
  2. local mon = peripheral.find("monitor")
  3.  
  4. while true do
  5.   mon.setBackgroundColor(colors.black)
  6.   mon.clear()
  7.   mon.setTextColor(colors.black)
  8.   mon.setTextScale(2)
  9.   mon.setBackgroundColor(colors.lime)
  10.   mon.setCursorPos(1,2)
  11.   mon.write("Open")
  12.   mon.setBackgroundColor(colors.red)
  13.   mon.setCursorPos(1,1)
  14.   mon.write("Close")
  15.  
  16. local event, monid, x, y = os.pullEvent("monitor_touch")
  17.       redstone.setOutput("top", false)
  18.      
  19.      print (y)
  20.      
  21.    if event == "monitor_touch" and y == 1 then
  22.      redstone.setOutput("top", false)
  23.      rednet.broadcast("Closing")
  24.    end
  25.    
  26.    if y == 2 then
  27.      redstone.setOutput("top", true)
  28.    end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment