Advertisement
GNOOR1S

Turtle Commander

Jun 11th, 2022
1,163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. -- For neuro connector in plethora, can be modified
  2.  
  3. local modemSide = "left"
  4. local protocol = "diggingTurtle"
  5.  
  6. local userInput = ""
  7.  
  8. function init()
  9.     term.setBackgroundColor(colors.white)
  10.     term.setTextColor(colors.black)
  11.     term.clear()
  12.     term.setCursorPos(1, 1)
  13.    
  14.     print("Initializing")
  15.     rednet.open(modemSide)
  16.    
  17.  
  18. end
  19.  
  20. function run()
  21.     init()
  22.     while true do
  23.         print("enter command [bore, quarry, exit]")
  24.         local command = read()
  25.         if command == "exit" then
  26.             os.reboot()
  27.         end
  28.         print("")
  29.         print("enter how far")
  30.         local arg = read()
  31.         local packet = {["command"] = command, ["arg"] = arg}
  32.         rednet.broadcast(packet, protocol)
  33.         sleep(.5)
  34.  
  35.         for i = 1, 10 do
  36.             print("")
  37.         end
  38.     end
  39. end
  40.  
  41. run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement