CobraOs

robitos return mode

Nov 5th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. term.write(os.getComputerID())
  4. rednet.open("right")
  5. while true do
  6. local sender, message, protocol = rednet.receive()
  7. if protocol == tostring(os.getComputerID()) then
  8. if message == "forward" then
  9. if turtle.forward() then
  10.   rednet.send(sender, "true")
  11. else
  12.   rednet.send(sender, "false")
  13. end
  14. end
  15. if message == "close" then
  16.  rednet.close("right")
  17.  break
  18. end
  19. if message == "left" then
  20. turtle.turnLeft()
  21. end
  22. if message == "right" then
  23. turtle.turnRight()
  24. end
  25. if message == "back" then
  26. turtle.back()
  27. end
  28. if message == "up" then
  29. turtle.up()
  30. end
  31. if message == "down" then
  32. turtle.down()
  33. end
  34. if message == "dig" then
  35. turtle.dig()
  36. end
  37. if message == "mine" then
  38. turtle.dig()
  39. end
  40. if message == "place" then
  41. turtle.place()
  42. end
  43. if message == "placeu" then
  44. turtle.placeUp()
  45. end
  46. if message == "placed" then
  47. turtle.placeDown()
  48. end
  49. if message == "mineu" then
  50. turtle.digUp()
  51. end
  52. if message == "mined" then
  53. turtle.digDown()
  54.  end
  55. end
  56. end
Advertisement
Add Comment
Please, Sign In to add comment