craniumkid22

Quick Cutter

Dec 9th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local count = 0
  2. while true do
  3.   turtle.select(1)
  4.   if turtle.getItemCount(1) > 0 then
  5.     turtle.place()
  6.   else
  7.     print("Out of Saplings")
  8.     break
  9.   end
  10.   turtle.select(2)
  11.   if turtle.getItemCount(2) > 0 then
  12.     turtle.place()
  13.   else
  14.     print("Out of Bonemeal")
  15.     break
  16.   end
  17.   turtle.select(1)
  18.   turtle.dig()
  19.   turtle.forward()
  20.   local height = 0
  21.   while turtle.detectUp() do
  22.     turtle.digUp()
  23.     turtle.up()
  24.     height = height + 1
  25.   end
  26.   repeat
  27.     turtle.down()
  28.     height = height - 1
  29.   until height == 0
  30.   turtle.back()
  31.   count = count + 1
  32.   print("Cut down "..count.." trees")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment