Advertisement
ecco7777

CC Turtle Armee

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