Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wrap the monitor on top
- local monitor = peripheral.wrap("top")
- -- Set the monitor text scale and clear it
- monitor.setTextScale(1)
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write("Touch the monitor...")
- -- Event loop
- while true do
- local event, side, x, y = os.pullEvent("monitor_touch")
- print("Touched at X: " .. x .. ", Y: " .. y)
- end
Advertisement
Add Comment
Please, Sign In to add comment