aesom_e

Computercraft turtle elevator (Computer side)

Oct 8th, 2022 (edited)
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. modem = peripheral.find("modem")
  2. monitor = peripheral.find("monitor")
  3. modem.open(700)
  4. numbots = 1
  5. function resetmonitor()
  6.     monitor.clear()
  7.     monitor.setCursorPos(1,1)
  8.     monitor.setTextScale(1)
  9.     monitor.write("Click")
  10.     monitor.setCursorPos(1,2)
  11.     monitor.write("me to")
  12.     monitor.setCursorPos(1,3)
  13.     monitor.write("descend")
  14. end
  15. resetmonitor()
  16. while true do
  17.     event, side, xPos, yPos = os.pullEvent("monitor_touch")
  18.     monitor.clear()
  19.     modem.transmit(700, 700, "descend")
  20.     monitor.setCursorPos(1,1)
  21.     monitor.write("Waiting...")
  22.     x = 0
  23.     while x < numbots do
  24.         event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  25.         x = x + 1
  26.     end
  27.     resetmonitor()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment