Guest User

rc

a guest
Mar 2nd, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. m = peripheral.find("modem")
  2. m.open(200)
  3. comn = {"forward","back","right","left","up","down"}
  4.  
  5.  
  6. while true do
  7. e = {os.pullEvent()}
  8. if e[1] == "modem_message" then
  9. --for i=1,#comn do
  10. --if e[5] == comn[i] then
  11. --print(e[5])
  12. if e[5] == "forward" then
  13. --print(e[5])
  14. turtle.forward()
  15. elseif e[5] == "back" then
  16. turtle.back()
  17. elseif e[5] == "left" then
  18. turtle.turnLeft()
  19. elseif e[5] == "right" then
  20. turtle.turnRight()
  21. elseif e[5] == "up" then
  22. turtle.up()
  23. elseif e[5] == "down" then
  24. turtle.down()
  25. elseif e[5] == "dig" then
  26. turtle.dig()
  27. elseif e[5] == "place" then
  28. turtle.place()
  29. elseif e[5] == "digDN" then
  30. turtle.digDown()
  31. elseif e[5] == "placeDN" then
  32. turtle.placeDown()
  33. elseif e[5] == "digUP" then
  34. turtle.digUp()
  35. elseif e[5] == "placeUP" then
  36. turtle.placeUp()
  37. end
  38. --end
  39. --end
  40. end
  41. sleep(0)
  42. end
Advertisement
Add Comment
Please, Sign In to add comment