Advertisement
jonok333

I/O redstone

Dec 24th, 2023
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local mon = peripheral.find("monitor")
  2. mon.setBackgroundColour(colours.black)
  3. mon.clear()
  4. while true do
  5. mon.setCursorPos(3, 3)
  6. mon.write("I/O")
  7. event, side, x, y = os.pullEvent ("monitor_touch")
  8. if x > 2 and x < 6 and y == 3 then
  9. mon.setBackgroundColor(colors.black)
  10. mon.clearLine()
  11. mon.setCursorPos(3, 3)
  12. mon.setBackgroundColor(colors.green)
  13. mon.write("I/O")
  14. mon.setBackgroundColor(colors.black)
  15. rs.setOutput("back", true)
  16.  
  17. end
  18. event, side, x1, y1 = os.pullEvent ("monitor_touch")
  19. if x1 > 2 and x1 < 6 and y1 == 3 then
  20. mon.setBackgroundColor(colors.black)
  21. mon.setCursorPos(3, 3)
  22. mon.write("I/O")
  23. mon.setBackgroundColor(colors.red)
  24. rs.setOutput("back", false)
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement