Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local on = 1
- local count = 0
- local trees = 0
- local dropoff = 0
- local place = 0
- io.write( "Run initial setup?: " )
- settings = io.read()
- if settings == "yes" then
- sleep(1)
- print( "Logging Program Setup Initiated" )
- sleep(1)
- print( "Input Number of trees to tend" )
- print( "1-64" )
- io.write("# trees: ")
- trees = io.read()
- while trees < 1 and trees > 65 do
- print( "Enter an ammount from 1-64" )
- io.write("trees: ")
- trees = io.read()
- end
- print( "place "..trees" Saplings into slot 1 of the turtle" )
- sleep(1)
- print( "place "..trees" Redstone Torchs into slot 2 of the turtle" )
- sleep(1)
- print( "place 2 Dirt Blocks into slot 3 of the turtle" )
- sleep(1)
- print( "place "..trees" Torchs into slot 4 of the turtle" )
- sleep(1)
- io.write("finished?: ")
- place = io.read()
- while place ~= "yes" do
- sleep(1)
- print( "Type in yes when finished" )
- io.write("Finished: ")
- place = io.read()
- end
- print( "Starting Initial Setup" )
- turtle.up()
- turtle.select(2)
- place = 1
- print( "Placing Redstone Torch "..place"of "..trees )
- turtle.placeDown()
- while place < trees do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- place = place + 1
- print( "Placing Redstone Torch "..place"of "..trees )
- turtle.placeDown()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(4)
- place = 1
- print ( "Placing Torch "..place"of "..trees )
- turtle.placeDown()
- while place < trees - 1 do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- place = place + 1
- print( "Placing Torch "..place"of "..trees )
- turtle.placeDown()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.select(3)
- print( "Placing Blocker 1 of 2" )
- turtle.place()
- turtle.forward()
- turtle.down()
- print( "Digging Detector Hole")
- turtle.digDown()
- turtle.up()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(1)
- place = 1
- print( "Placing Sapling "..place"of "..trees )
- turtle.placeDown()
- while place < trees - 1 do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- place = place + 1
- print( "Placing Sapling "..place"of "..trees )
- turtle.placeDown()
- end
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- print( "Placing Blocker 2 of 2" )
- turtle.select(3)
- turtle.place()
- print( "Initial Setup Complete" )
- sleep(1)
- print( "Please Place the Repeaters now" )
- sleep(1)
- print( "Redstone Torch -> Repeater -> Tree" )
- sleep(1)
- print( "When Complete type in 1" )
- place = 0
- place = io.read("*number")
- while place ~= 1 do
- print( "Type in 1 when Complete" )
- place = io.read("*number")
- end
- turtle.forward()
- turtle.down()
- end
- print( "Auto Drop Stacks of Lumber?" )
- io.write("yes or no?: ")
- dropoff = io.read()
- while on == 1 do
- while not turtle.detect() do
- turtle.forward()
- while redstone.getInput("left", true) do
- tree = tree + 1
- print( "Tree Detected Starting Logging Sequence" )
- print( "This is tree number: "..tree )
- turtle.turnLeft()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectUp() and not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- print( "Logging Sequence Complete" )
- print( "Replanting Sapling" )
- turtle.select(1)
- turtle.place(1)
- turtle.back()
- turtle.turnRight()
- end
- while redstone.getInput("right", true) do
- tree = tree + 1
- print( "Tree Detected Starting Logging Sequence" )
- print( "This is tree number: "..tree )
- turtle.turnRight()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectUp() and not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- print( "Logging Sequence Complete" )
- print( "Replanting Sapling" )
- turtle.select(1)
- turtle.place(1)
- turtle.back()
- turtle.turnLeft()
- end
- end
- while turtle.detect() and not turtle.detectDown() and dropoff == "yes" do
- if turtle.getItemSpace(2) == 0 then
- while turtle.detectUp() do
- turtle.digUp()
- end
- turtle.up()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turtle.select(2)
- turtle.drop()
- if turtle.getItemSpace(3) < 64 then
- turtle.select(3)
- turtle.drop()
- end
- turtle.back()
- turtle.back()
- turtle.down()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- while turtle.detect() do
- turtle.turnRight()
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment