GNOOR1S

Turtle Command Selector - Not finished

Jun 11th, 2022 (edited)
1,428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local protocol = "diggingTurtle"
  2. local modemSide = "right"
  3.  
  4.  
  5. function initialize()
  6.     print("initializing network")
  7.     print("commands that are received will be attempted to run")
  8.     rednet.open(modemSide)
  9. end
  10.  
  11. function run()
  12.     initialize()
  13.     id, msg = rednet.receive(protocol)
  14.     print(msg)
  15.  
  16.     local command = msg["command"]
  17.     local arg = msg["arg"]
  18.  
  19.     if command ~= "" then
  20.         shell.run(command, arg)
  21.     end
  22.  
  23. end
  24.  
  25. run()
  26.  
Add Comment
Please, Sign In to add comment