Guest User

x

a guest
Dec 13th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. function goUp()
  2.   if not turtle.up() then
  3.     turtle.digUp()
  4.     goUp()
  5.   end
  6. end
  7.  
  8. function reset()
  9.   turtle.select(16)
  10.   if not turtle.compareDown() then
  11.     print("Going Down")
  12.     turtle.down()
  13.     reset()
  14.   end
  15. end
  16.  
  17. function chop()
  18.   turtle.select(2)
  19.   reset()
  20.   turtle.select(15)
  21.   while turtle.compare() do
  22.     print("Digging")
  23.     turtle.select(2)
  24.     turtle.dig()
  25.     goUp()
  26.     turtle.select(2)
  27.   end
  28.   reset()
  29. end
  30.  
  31. function plant()
  32.   turtle.select(1)
  33.   if not turtle.detect() then
  34.     print("Planting")
  35.     turtle.place()
  36.   end
  37. end
  38.  
  39. function drop()
  40.   reset()
  41.   --goUp()
  42.   for i=2, 14 do
  43.     turtle.select(i)
  44.     if turtle.getFuelLevel() < 100 then
  45.       print("Fuel level: " .. turtle.getFuelLevel() .. " Burning Wood.")
  46.       turtle.refuel()
  47.     end
  48.     turtle.drop()
  49.   end
  50. end
  51.  
  52. while true do
  53.   reset()
  54.   plant()
  55.   chop()
  56.   drop()
  57.   sleep(1)
  58. end
Advertisement
Add Comment
Please, Sign In to add comment