Advertisement
Guest User

Untitled

a guest
May 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. mon = peripheral.wrap("front")
  2. mon.clear()
  3. mon.setTextScale(1.5)
  4.  
  5. mon.setCursorPos(2,1)
  6. mon.write("ON")
  7. mon.setCursorPos(2,3)
  8. mon.write("OFF")
  9.  
  10. while true do
  11. event,side,x,y = os.pullEvent("monitor_touch")
  12.  
  13. if x > 1 and x < 2 and y == 1 then
  14. rs.setOutput("left",true)
  15. mon.setCursorPos(2,1)
  16. mon.clearLine()
  17. mon.blit("ON","00000000","dddddddd")
  18. mon.setCursorPos(2,1)
  19.  
  20. elseif x > 1 and x < 3 and y == 3 then
  21. rs.setOutput("left",false)
  22. mon.setCursorPos(2,3)
  23. mon.clearLine()
  24. mon.blit("OFF","00000","ddddd")
  25. mon.setCursorPos(2,3)
  26.  
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement