Guest User

BotaniaMiner

a guest
May 24th, 2014
1,382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Refueling
  2. function refuel()
  3.   turtle.select(2)
  4.   turtle.refuel(10)
  5. end
  6.  
  7. --Restocking of Wood/Stone
  8. function restock()
  9.   turtle.back()
  10.   turtle.select(1)
  11.   turtle.suckDown()
  12.   turtle.forward()
  13. end
  14.  
  15. --For the making of the circle
  16. function plant()
  17.   for i=1,2 do
  18.     turtle.forward()
  19.     turtle.placeDown()
  20.   end
  21. end
  22.  
  23. --mining the rock/wood
  24. function mine()
  25.   turtle.digDown()
  26.   for i=1,4 do
  27.     turtle.forward()
  28.     turtle.digDown()
  29.     turtle.forward()
  30.     turtle.digDown()
  31.     turtle.turnRight()
  32.   end
  33. end
  34. --The circle itself
  35. function circle()
  36.   if turtle.getItemCount(1) > 8 then
  37.     turtle.placeDown()
  38.     for i=1,4 do
  39.       plant()
  40.       turtle.turnRight()
  41.     end
  42.   else
  43.     restock()
  44.     circle()
  45.   end
  46. end
  47.  
  48. --Checking if the rock/wood has become living
  49. function check()
  50.   turtle.select(16)
  51.   if turtle.compareDown() then
  52.     os.sleep(15)
  53.     mine()
  54.   else
  55.     os.sleep(1)
  56.     check()
  57.   end
  58.   turtle.select(1)
  59. end
  60.  
  61. --The Actual program
  62. restock()
  63. circle()
  64. while true do
  65.   if turtle.getFuelLevel() > 100 then
  66.     check()
  67.     circle()
  68.   else
  69.     refuel()
  70.   end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment