Guest User

turtle

a guest
Apr 11th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. --Csstform
  2.  
  3. rednet.open("left")
  4.  
  5. function getInput()
  6. local _,input = os.pullEvent("key")
  7. return input
  8. end
  9.  
  10. function sendCommand(id, command)
  11. rednet.send(id, command)
  12. end
  13.  
  14. function recieveCommand()
  15. local senderId, message, distance = rednet.receive()
  16. return message
  17. end
  18.  
  19. function translate(input)
  20. if input == "forward" then
  21. turtle.forward()
  22. elseif input == "left" then
  23. turtle.turnLeft()
  24. elseif input == "right" then
  25. turtle.turnRight()
  26. elseif input == "back" then
  27. turtle.back()
  28. end
  29. end
  30.  
  31. while true do
  32. local test = recieveCommand()
  33. translate(test)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment