Slaide

Untitled

Mar 31st, 2023
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. monitor = peripheral.find("montior")
  2. width, height = monitor.getSize()
  3. title = "Ore Processing"
  4.  
  5. buttons = {}
  6.  
  7. function createButton(name, func, x, y, w, h)
  8. buttons[name] = { name, func, x, y, w, h }
  9. monitor.setBackgroundColor(colors.red)
  10. for i = y, y + h do
  11. monitor.setCursorPos(x, i)
  12. for j = 1, w do
  13. monitor.write(" ")
  14. end
  15. end
  16. --monitor.setCursorPos(5, 3)
  17. --monitor.write()
  18. end
  19.  
  20. function draw()
  21. montior.clear()
  22. monitor.setCursorPos(width / 2 - 7, 1)
  23. monitor.write(title)
  24.  
  25. createButton("Test Button", test1, 5, 3, 13, 3)
  26. end
  27.  
  28. while true do
  29. draw()
  30. os.sleep(0.5)
  31. end
  32.  
Advertisement
Add Comment
Please, Sign In to add comment