Advertisement
Slaide

Untitled

Mar 31st, 2023
808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("top")
  3. m.clear()
  4.  
  5. function fillTable()
  6.     button.setTable("Test 1", test1, 10, 20, 3, 5)
  7.     button.setTable("Test 2", test2, 22, 32, 3, 5)
  8. end
  9.  
  10. function getClick()
  11.     event, side, x, y = os.pullEvent("monitor_touch")
  12.     button.checkxy(x, y)
  13. end
  14.  
  15. function test1()
  16.     m.setCursorPos(1, 1)
  17.     m.write("test1")
  18. end
  19.  
  20. function test2()
  21.     m.setCursorPos(1, 1)
  22.     m.write("test1")
  23. end
  24.  
  25. while true do
  26.     getClick()
  27. end
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement