petomka

Untitled

Aug 7th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. term.clear()
  2. m = peripheral.wrap("top")
  3. m.setTextScale(2)
  4.  
  5. m.setCursorPos(1,1)
  6. m.set"back"groundColor(colors.green)
  7. m.write(" ON ")
  8.  
  9. m.setCursorPos(1,2)
  10. m.set"back"groundColor(colors.red)
  11. m.write(" OFF")
  12.  
  13. while true do
  14. event,side,x,y = os.pullEvent()
  15.  if event == "monitor_touch" then
  16.   if x == 1 and y == 1 then
  17.   redstone.setOutput("back",true)
  18.   end
  19.   if x == 2 and y == 1 then
  20.   redstone.setOutput("back",true)
  21.   end
  22.   if x == 3 and y == 1 then
  23.   redstone.setOutput("back",true)
  24.   end
  25.   if x == 4 and y == 1 then
  26.   redstone.setOutput("back",true)
  27.   end
  28.   if x == 1 and y == 2 then
  29.   redstone.setOutput("back",false)
  30.   end
  31.   if x == 2 and y == 2 then
  32.   redstone.setOutput("back",false)
  33.   end
  34.   if x == 3 and y == 2 then
  35.   redstone.setOutput("back",false)
  36.   end
  37.   if x == 4 and y == 2 then
  38.   redstone.setOutput("back",false)
  39.   end
  40.  end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment