anfbckdo

MonLineDrawer.lua

Dec 24th, 2023 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. local monitor = peripheral.wrap("left")
  2. if not monitor then
  3. printError("No monitor found. Please connect a monitor.")
  4. end
  5.  
  6. function monitorTouchDraw(xPos, yPos, xPos2, yPos2)
  7.  
  8. while true do
  9.  
  10. event, side, xPos, yPos = os.pullEvent("monitor_touch")
  11. event, side, xPos2, yPos2 = os.pullEvent("monitor_touch")
  12.  
  13. break
  14. end
  15.  
  16. term.redirect(monitor)
  17. paintutils.drawLine(xPos, yPos, xPos2, yPos2, 0x1)
  18.  
  19. end
  20. while true do
  21. monitorTouchDraw()
  22. term.native()
  23. end
  24.  
Advertisement
Add Comment
Please, Sign In to add comment