Advertisement
Xenogami

Treebot1.0

Feb 8th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. local function checkFuel()
  2.     while turtle.getFuelLevel() < 100 do
  3.         turtle.select(2)
  4.         turtle.refuel(1)
  5.     end
  6. end
  7.  
  8. local function chopUp()
  9.     while turtle.detectUp() do
  10.         turtle.digUp()
  11.         turtle.up()
  12.         turtle.dig()
  13.         x=x+1
  14.     end
  15. end
  16.  
  17. local function chopDown()
  18.     for a=2,x do
  19.         turtle.dig()
  20.         turtle.digDown()
  21.         turtle.down()
  22.     end
  23. end
  24.  
  25. local function stumpRemove()
  26.     turtle.select(1)
  27.     turtle.digDown()
  28.     turtle.placeDown()
  29.     turtle.dig()
  30.     turtle.forward()
  31.     turtle.digDown()
  32.     turtle.placeDown()
  33.     turtle.turnLeft()
  34.     turtle.forward()
  35.     turtle.digDown()
  36.     turtle.placeDown()
  37.     turtle.turnLeft()
  38.     turtle.forward()
  39.     turtle.digDown()
  40.     turtle.placeDown()
  41.     turtle.forward()
  42.     turtle.turnLeft()
  43.     turtle.turnLeft()
  44. end
  45.  
  46. local function placeItems()
  47.     for a=3,16 do
  48.         turtle.select(a)
  49.         turtle.dropDown()
  50.     end
  51.     turtle.select(1)
  52. end
  53.  
  54.  
  55. while true do
  56.     if turtle.detect() then
  57.         checkFuel()
  58.         turtle.dig()
  59.         turtle.forward()
  60.         turtle.dig()
  61.         x=1
  62.         chopUp()
  63.         turtle.turnRight()
  64.         turtle.dig()
  65.         turtle.forward()
  66.         turtle.turnLeft()
  67.         chopDown()
  68.         stumpRemove()
  69.         placeItems()
  70.     end
  71.     os.sleep(5)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement