petomka

startup

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