Advertisement
Cadevine

alwaysListen.lua (turtle)

Jan 17th, 2025 (edited)
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. rednet.open("right")
  2. local id, command, commandType
  3. local parameters = {}
  4.  
  5. while rednet.isOpen("right") do
  6. for i=1,5 do
  7. id, command, parameters[i] = rednet.receive()
  8. print("my pp: ",parameters[i])
  9. end
  10. commandType = parameters[1]
  11. print("Terminal: ", id)
  12. print("Has sent command: ", command)
  13. print("Command type: ", commandType)
  14. if command == "movement" then
  15. shell.run("CadeOS/movement.lua", commandType)
  16. elseif command == "rotate" then
  17. shell.run("CadeOS/rotate.lua", commandType)
  18. elseif command == "cadeMine" then
  19. --[[for i=1,5 do
  20. id, command, parameters[i] = rednet.receive()
  21. print("my pp: ",parameters["i"])
  22. end]]--
  23. --shell.run("CadeOS/cadeMine.lua",parameters[1],parameters[2],parameters[3],parameters[4],parameters[5])
  24. elseif command == "cadeMine2" then
  25. shell.run("CadeOS/cadeMine2.lua")
  26. else
  27. print()
  28. print("Error: Something has gone wrong")
  29. print()
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement