jacobcc05

Wireless turtle simple

Apr 27th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. -- help taken from cc team and members could not have done it without you
  2. -- to control turtle
  3.  
  4. print("Controling turtle... Controls steer arrows")
  5. print("| w,q,e,s,a,d destroy/up/down,place/up/down | up/down space,shift")
  6.  
  7. rednet.open("side")
  8.  
  9. while true do
  10. local event, con = os.pullEvent("key")
  11.  
  12. if con == 200 then
  13. rednet.send(1, Forward") -- Change the 1 to your turtle id...
  14. elseif con == 208 then
  15. rednet.send(1, Back")
  16. elseif con == 203 then
  17. rednet.send(1, turnLeft")
  18. elseif con == 205 then
  19. rednet.send(1, turnRight")
  20. elseif con == 57 then
  21. rednet.send(1, up")
  22. elseif con == 42 then
  23. rednet.send(1, down")
  24. elseif con == 16 then
  25. rednet.send(1, dig up")
  26. elseif con == 17 then
  27. rednet.send(1, Dig forward")
  28. elseif con == 18 then
  29. rednet.send(1, dig down")
  30. elseif con == 31 then
  31. rednetsend(1, place")
  32. elseif con == 30 then
  33. rednetsend(1, place up")
  34. elseif con == 32 then
  35. rednetsend(1, place down")
  36. end
  37. end
  38.  
  39. rednet.close()
Advertisement
Add Comment
Please, Sign In to add comment