Advertisement
djPtica

cutTree

Feb 3rd, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --cutTree by djPtica v0.1.3
  2. --SETUP
  3. --put turtle in front of bottom left block of 2x2 tree
  4. --put chest behind turtle
  5.  
  6. function cutUp()
  7.    turtle.dig()
  8.    turtle.digUp()
  9.    turtle.up()
  10.    j = j + 1
  11. end
  12.  
  13. function cutDown()
  14.    turtle.digDown()
  15.    turtle.down()
  16.    turtle.dig()
  17. end
  18.  
  19. --GLAVNI PROGRAM
  20. j=0
  21. if turtle.dig() then
  22.    print("Drvo pronadjeno, zapocinjem sijecu.")
  23.    turtle.forward()
  24.    while turtle.detectUp() do
  25.       cutUp()
  26.    end
  27.    turtle.turnRight()
  28.    turtle.dig()
  29.    turtle.forward()
  30.    turtle.turnLeft()
  31.    turtle.dig()
  32.    for i=1, j do
  33.       cutDown()
  34.    end
  35.    turtle.turnLeft()
  36.    turtle.forward()
  37.    turtle.turnLeft()
  38.    turtle.forward()
  39.    for i=1, 16 do
  40.       turtle.select(i)
  41.       turtle.drop()
  42.    end
  43.    turtle.turnLeft()
  44.    turtle.turnLeft()
  45.    print("Sijeca gotova")  
  46. else
  47.    print("Drvo nije pronadjeno")
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement