Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local on = 0
- local count = 0
- local trees = 0
- local dropoff = 0
- local settings = 0
- local place = 0
- write("Power On (1) or Off (2)")
- on = io.read()
- while on ~= 1 or 0 do
- sleep(1)
- write("Please input 1 or 2")
- on = io.read()
- end
- sleep(1)
- print( "Run initial setup?" )
- print( " 1 (RUN SETUP) 0(START LOGGING) ")
- write("Please input 1 or 0")
- settings = read()
- while on ~= 0 or 1 do
- sleep(1)
- write("Please input 1 or 0")
- settings = read()
- end
- if settings == 1 then
- sleep(1)
- print( "Logging Program Initiated" )
- sleep(1)
- print( "Input Number of trees to tend" )
- print( "1-64" )
- write("trees: ")
- trees = read()
- while trees < 1 and trees > 65 do
- print( "Enter an ammount from 1-64" )
- write("trees: ")
- trees = 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)
- print( "Type in 1 when materials are in the turtle" )
- place = read()
- while place ~= 1 do
- sleep(1)
- print( "Type in 1 when finished" )
- place = 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 = read()
- while place ~= 1 do
- print( "Type in 1 when Complete" )
- place = read()
- end
- turtle.forward()
- turtle.down()
- end
- print( "Auto Drop Stacks of Lumber?" )
- print( "1 (YES) 0 (NO)" )
- dropoff = read()
- while dropoff ~= 1 or 0 do
- sleep(1)
- print( "1 (YES) 0 (NO)" )
- dropoff = read()
- end
- 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 == 1 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
- if on == 0 then
- print( "Shutting Down" )
- sleep (2)
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment