Advertisement
denesik

book

Sep 24th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. -- pastebin get YyyiwY1C b
  2.  
  3. monitor = peripheral.wrap("top")
  4. monitor.setTextScale(0.5)
  5.  
  6. function clear()
  7.     monitor.clear()
  8.     monitor.setCursorPos(1,1)
  9. end
  10.  
  11. function printMenu()
  12.     clear()
  13.     for i=1,16 do
  14.         monitor.setCursorPos(1,i)
  15.         monitor.write(i)
  16.     end
  17. end
  18.  
  19. while true do
  20.     printMenu()
  21.     event, side, x, y = os.pullEvent("monitor_touch")
  22.     while true do
  23.         event, side, xPos, yPos = os.pullEvent("monitor_touch")
  24.         print(event .. " => Side: " .. tostring(side) .. ", " ..
  25.         "X: " .. tostring(xPos) .. ", " ..
  26.         "Y: " .. tostring(yPos))
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement