Guest User

Untitled

a guest
Feb 26th, 2020
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --declare vars
  2. x=0
  3. z=0
  4. args = {...}
  5.  
  6. checkX = tonumber(args[1])
  7.  
  8. x =9* tonumber(checkX)
  9. z= 5
  10. h = 1+ tonumber(args[2])
  11. canCont = true
  12.  
  13. --this function checks the slot in use for item count
  14. function restock()
  15.  
  16. for sl=1,15 do
  17. turtle.select(1)
  18. --if the count is less than 5 then it asks each slot 2 to 15 to give it blocks up to 64
  19. if turtle.getItemCount() < 5 then
  20. turtle.select(sl)
  21. turtle.transferTo(1)
  22. else end
  23. end
  24.  
  25. --if it is still less than 5 it accesses its ender chest (slot 16) to refuel the entire turtle
  26. turtle.select(1)
  27. if turtle.getItemCount() < 5 then
  28.  
  29. --places ender chest and fills first slot
  30. turtle.select(16)
  31. turtle.place()
  32. turtle.select(1)
  33. turtle.suck(64-turtle.getItemCount())
  34. -- pulls out 14 stacks filling up the rest
  35. for i=1,14 do
  36. turtle.suck(64)
  37. end
  38. turtle.select(16)
  39. turtle.dig()
  40. turtle.select(1)
  41. end
  42.  
  43.  
  44. end
  45.  
  46. function platform()
  47. for i=1,x do
  48. restock()
  49.  
  50. for o=1,z do
  51.  
  52. turtle.placeDown()
  53. if o~=z then turtle.forward() end
  54. end
  55. if math.fmod(i,2) == 1 and i~=x then turtle.turnRight() turtle.forward() turtle.turnRight()
  56. elseif i~=x then turtle.turnLeft() turtle.forward() turtle.turnLeft()
  57. else
  58. end
  59. end
  60. end
  61.  
  62.  
  63. function goDown()
  64. if math.fmod(checkX,2) ~= 1 then
  65. turtle.forward()
  66.  
  67. else
  68. for i=1,5 do
  69. turtle.back()
  70. end
  71. end
  72.  
  73. end
  74.  
  75. for i=1,h do
  76.  
  77. if turtle.down() then
  78.  
  79. else
  80. canCont = false
  81. end
  82.  
  83. end
  84.  
  85. if math.fmod(checkX,2) ~= 1 then
  86. turtle.turnLeft()
  87. turtle.turnLeft()
  88. end
  89. turtle.forward()
  90.  
  91. end
  92.  
  93.  
  94. repeat
  95.  
  96. platform()
  97. goDown()
  98.  
  99.  
  100.  
  101. until canCont == false
RAW Paste Data