Advertisement
ecco7777

CC self programming turtle array

Jun 9th, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --turtle.turnRight()
  2. --turtle.turnRight()
  3. if peripheral.getType("front")~=nil then
  4. turtle.turnRight()
  5. turtle.turnRight()
  6. end
  7. turtle.select(1)
  8. turtle.place()
  9. turtle.drop()
  10. turtle.select(2)
  11. turtle.refuel(1)
  12. turtle.drop()
  13. turtle.select(3)
  14. turtle.suckUp()
  15. turtle.select(4)
  16. turtle.digUp()
  17. turtle.up()
  18. turtle.place()
  19. turtle.select(3)
  20. turtle.drop()
  21. turtle.down()
  22. t=peripheral.wrap("front")
  23. if t~=nil then
  24. t.turnOn()
  25. end
  26. rednet.open("right")
  27. while true do
  28. event, side, frequency, replyFrequency, message, distance =os.pullEvent("modem_message")
  29. if string.sub(message,1,#"turtle run ")=="turtle run " then
  30. command=string.sub(message,#"turtle run ")
  31. shell.run(command)
  32. end
  33. if string.sub(message,1,#"turtle do ")=="turtle do " then
  34. command=string.sub(message,#"turtle do "+1)
  35. fp=fs.open("command","w")
  36. fp.writeLine(command)
  37. fp.close()
  38. shell.run("command")
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement