dragonbabyfly

Dragonfarm Turtle dAPI

Dec 28th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function Forward(Dist)
  2. for i = 1, Dist do
  3. turtle.forward()
  4. end
  5. end
  6.  
  7. function Back(Dist)
  8. for i = 1, Dist do
  9. turtle.forward()
  10. end
  11. end
  12.  
  13. function Turn(Dir, Times)
  14. if Dir == "left" then
  15. for i = 1, Times do
  16. turtle.turnLeft()
  17. end
  18. elseif Dir == "right" then
  19. for i = 1, Times do
  20. turtle.turnRight()
  21. end
  22. end
  23. end
  24.  
  25. function Up(Dist)
  26. for i = 1, Dist do
  27. turtle.up()
  28. end
  29. end
  30.  
  31. function Down(Dist)
  32. for i = 1, Dist do
  33. turtle.down()
  34. end
  35. end
  36.  
  37. function PlaceDown(Slot)
  38. turtle.select(Slot)
  39. turtle.placeDown()
  40. end
  41.  
  42. function Take(Slot, Amount)
  43. turtle.select(Slot)
  44. turtle.suck(Amount)
  45. end
  46.  
  47. function GetStone()
  48. Turn("left",2)
  49. Take(1,1)
  50. Turn("right",2)
  51. end
  52.  
  53. function PlaceStone()
  54. Up(1)
  55. Forward(5)
  56. Turn("left",1)
  57. Forward(1)
  58. PlaceDown(1)
  59. Turn("left",2)
  60. Forward(1)
  61. Turn("right",1)
  62. Forward(5)
  63. Down(1)
  64. Turn("left",2)
  65. end
Add Comment
Please, Sign In to add comment