Advertisement
jnsstnbrg

Untitled

Jan 31st, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. blocksPlaced = 0
  2.  
  3. --Refueling
  4. function refuel()
  5.   turtle.select(2)
  6.   turtle.refuel(10)
  7. end
  8.  
  9. --Restocking of Wood/Stone
  10. function restock()
  11.   turtle.back()
  12.   turtle.select(1)
  13.   turtle.suckDown(4)
  14.   turtle.select(2)
  15.   turtle.suckUp(4)
  16.   turtle.forward()
  17.   turtle.select(1)
  18. end
  19.  
  20. --For the making of the circle
  21. function plant()
  22.   for i=1,2 do
  23.     turtle.forward()
  24.     turtle.placeDown()
  25.     if blocksPlaced == 2 then
  26.       turtle.select(2)
  27.     end
  28.     blocksPlaced = blocksPlaced + 1
  29.   end
  30. end
  31.  
  32. --mining the rock/wood
  33. function mine()
  34.   turtle.select(3)
  35.   turtle.digDown()
  36.   for i=1,4 do
  37.     turtle.forward()
  38.     turtle.digDown()
  39.     turtle.forward()
  40.     turtle.digDown()
  41.     turtle.turnRight()
  42.   end
  43.   turtle.select(1)
  44. end
  45. --The circle itself
  46. function plantCircle()
  47.   turtle.placeDown()
  48.   blocksPlaced = 0
  49.   for i=1,4 do
  50.     plant()
  51.     turtle.turnRight()
  52.   end
  53.   blocksPlaced = 0
  54.   turtle.select(1)
  55.   os.sleep(70)
  56. end
  57.  
  58. --Checking if the rock/wood has become living
  59. function check()
  60.   turtle.select(16)
  61.   if turtle.compareDown() then
  62.     os.sleep(15)
  63.     mine()
  64.   else
  65.     os.sleep(1)
  66.     check()
  67.   end
  68.   turtle.select(1)
  69. end
  70.  
  71. function dropLoot()
  72.   if turtle.getItemCount(3) > 40 then
  73.     turtle.back()
  74.     turtle.turnLeft()
  75.     for i=3,15 do
  76.       turtle.select(i)
  77.       turtle.drop()
  78.     end
  79.     turtle.turnRight()
  80.     turtle.forward()
  81.   end
  82.   turtle.select(1)
  83. end
  84.  
  85. --The Actual program
  86. turtle.select(1)
  87. while true do
  88.   dropLoot()
  89.   restock()
  90.   plantCircle()
  91.   check()
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement