Advertisement
jonok333

mon on/off switch

Dec 24th, 2023 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. local mon = peripheral.find("monitor")
  2. mon.clear()
  3. while true do
  4. mon.setCursorPos(1, 1)
  5. mon.write("test")
  6. event, side, x, y = os.pullEvent ("monitor_touch")
  7. if x == 1 and y == 1 then
  8. mon.setCursorPos(3, 3)
  9. mon.write("klik")
  10. end
  11. event, side, x1, y1 = os.pullEvent ("monitor_touch")
  12. if x1 == 1 and y1 == 1 then
  13. mon.clearLine()
  14. end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement