Advertisement
jonok333

I/O test 2

Dec 24th, 2023 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.setCursorPos(3, 5)
  15. mon.setBackgroundColor(colors.black)
  16. mon.write("klik")
  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.clearLine()
  22. mon.setCursorPos(3, 3)
  23. mon.write("I/O")
  24. mon.setBackgroundColor(colors.red)
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement