Advertisement
herobrinethree

remoteB

Jul 30th, 2022 (edited)
70
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("back")
  2. print("Enter Turtle ID: ")
  3. ID = read() + 0
  4. while true do
  5. local event, key, isHeld = os.pullEvent("key")
  6. action = keys.getName(key)
  7. if action == "w" then
  8. rednet.send(ID, "forward")
  9. elseif action == "s" then
  10. rednet.send(ID, "back")
  11. elseif action == "a" then
  12. rednet.send(ID, "left")
  13. elseif action == "d" then
  14. rednet.send(ID, "right")
  15. elseif action == "space" then
  16. rednet.send(ID, "up")
  17. elseif action == "leftShift" then
  18. rednet.send(ID, "down")
  19. elseif action == "e" then
  20. rednet.send(ID, "mine")
  21. elseif action == "w" and isHeld == true then
  22. rednet.send(ID, "keepForward")
  23. elseif action == "space" and isHeld == true then
  24. rednet.send(ID, "keepUp")
  25. elseif action == "leftShift" and isHeld == true then
  26. rednet.send(ID, "keepDown")
  27. elseif action == "r" then
  28. rednet.send(ID, "mineUp")
  29. elseif action == "f" then
  30. rednet.send(ID, "mineDown")
  31. elseif action == "q" then
  32. rednet.send(ID, "attack")
  33. end
  34. end
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement