Advertisement
mrkarp

getReeds

Oct 3rd, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 0 0
  1. --Harvest Reeds 35 x  3
  2. --MrKarp
  3.  
  4. function GetReedsA()
  5.         for a=1, 36 do
  6.         turtle.forward()
  7.         turtle.dig()
  8.         turtle.suck()
  9.         end
  10. end
  11.  
  12. function GetReedsB()
  13.         for a=1, 36 do
  14.         turtle.forward()
  15.         turtle.dig()
  16.         turtle.suck()
  17.         end
  18. end
  19.    
  20. function TurnLeft()
  21.     turtle.turnLeft()
  22.     turtle.forward()
  23.     turtle.dig()
  24.     turtle.forward()
  25.     turtle.turnLeft()
  26. end
  27.  
  28. function TurnRight()
  29.     turtle.turnRight()
  30.     turtle.forward()
  31.     turtle.dig()
  32.     turtle.forward()
  33.     turtle.turnRight()
  34. end
  35.  
  36. function TurnAround()
  37.     turtle.turnLeft()
  38.     turtle.turnLeft()
  39. end
  40.  
  41. function GoDown()
  42.     turtle.down()
  43. end
  44.  
  45. function GoUp()
  46.     turtle.up()
  47. end
  48.  
  49. function GetFuel()
  50.     local valid = turtle.refuel(0)
  51.     print(valid)
  52.         if valid then do
  53.             local success = turtle.refuel(4)
  54.     print(success)
  55.     end
  56. end
  57. end
  58.  
  59. local firstItem,lastItem = 2,16
  60. --This will drop everything into a chest
  61. function putAwayInventory()
  62.     for i=firstItem,lastItem do
  63.       turtle.select(i)
  64.       turtle.dropDown()
  65.     end
  66. end
  67. --And this will pick it up in the same order!
  68. function pickUpInventory()
  69.     for i=firstItem,lastItem do
  70.       turtle.select(i)
  71.       turtle.suckDown()
  72.     end
  73. end
  74.  
  75. --Run
  76. function Harvest()
  77.  
  78.     GetReedsA()
  79.     sleep(1)
  80.     TurnLeft()
  81.     sleep(1)
  82.     GetReedsB()
  83.     sleep(1)
  84.     TurnAround()
  85.     sleep(1)
  86.     GoDown()
  87.     sleep(1)
  88.     GetReedsA()
  89.     sleep(1)
  90.     TurnRight()
  91.     sleep(1)
  92.     GetReedsB()
  93.     sleep(1)
  94.     turtle.turnRight()
  95.     putAwayInventory()
  96.     sleep(1)
  97.     turtle.turnRight()
  98.    
  99. end
  100.  
  101. Harvest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement