Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("left")
- if not monitor then
- printError("No monitor found. Please connect a monitor.")
- end
- function monitorTouchDraw(xPos, yPos, xPos2, yPos2)
- while true do
- local event, side, xPos, yPos = os.pullEvent("monitor_touch")
- local event, side, xPos2, yPos2 = os.pullEvent("monitor_touch")
- break
- end
- term.redirect(monitor)
- paintutils.drawLine(xPos, yPos, xPos2, yPos2, 0x1)
- end
- while true do
- monitorTouchDraw()
- if os.pullEvent("char") then
- local event, character = os.pullEvent("char")
- print(character .. " was pressed. Clearing Screen.")
- term.setBackgroundColor(colours.black)
- term.clear(monitor)
- term.native()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment