Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Landstryder's Lumber Jack
- Only works with redstone signal
- from bottom when at the harvest
- location, ment to come from a
- daylight detector to keep it from
- bonemealing at night.
- Drop off point is to the right of
- the harvest location. Wood goes in
- container strait at the end of path
- and the excess saplings to the left
- the bot at the end of path. Comparator
- can be use on drop off chest to send
- redstone to top of turtle at drop
- location to pause program cycle till
- more wood is required.
- ]]--
- local i=0
- function Dream()
- if rs.getAnalogInput("bottom")<1 then
- print("Sun has set.... time to sleep....")
- textutils.slowPrint("....and perhaps to D.R.E.A.M. ....")
- end
- while rs.getAnalogInput("bottom")<1 do
- sleep(30)
- end
- end
- function Breaks()
- if rs.getAnalogInput("top")>1 then
- print("Sensors detect adiaquite inventory....")
- textutils.slowPrint(".... time for a B.R.E.A.K. ....")
- end
- while rs.getAnalogInput("top")>1 do
- sleep(30)
- end
- end
- function Bone()
- turtle.select(3)
- if turtle.getItemCount()<1 then
- print("No bone detected...")
- textutils.slowPrint(".... atempting to get B.O.N.E up to acceptable level....")
- turtle.turnLeft()
- turtle.turnLeft()
- if not turtle.suck() then
- turtle.turnLeft()
- turtle.turnLeft()
- textutils.slowPrint(".... B.O.N.E has been depleted - shuting down ....")
- return
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- function GasUp()
- if turtle.getFuelLevel()<100 then
- turtle.select(1)
- if not turtle.refuel(1) then
- print("Out of fuel....")
- textutils.slowPrint("....shuting down....")
- return
- end
- end
- end
- function Lumber()
- turtle.select(4)
- if turtle.compare() then
- print("Tree detected")
- textutils.slowPrint(".... commencing cutdown ....")
- turtle.select(5)
- turtle.dig()
- turtle.forward()
- while turtle.compareUp() do
- turtle.digUp()
- turtle.up()
- i=i+1
- end
- while i>0 do
- turtle.down()
- i=i-1
- end
- turtle.back()
- turtle.select(2)
- turtle.place()
- print("New sapling planted...")
- textutils.slowPrint(".... boning started ....")
- else
- Dream()
- Bone()
- turtle.place()
- end
- end
- function DropOff()
- turtle.select(5)
- if turtle.getItemCount()>45 then
- turtle.turnRight()
- for x=1,6 do --you can change to the distance to your drop point
- turtle.forward()
- end
- turtle.drop()
- turtle.turnLeft()
- for x=6,16 do
- turtle.select(x)
- turtle.drop()
- end
- turtle.select(2)
- turtle.transferTo(6,1)
- turtle.turnLeft()
- Breaks()
- for x=1,6 do --if you change the number above make this one match
- turtle.forward()
- end
- turtle.turnRight()
- end
- end
- -- Main Program Loop
- while true do
- for x=1,5 do
- GasUp()
- Lumber()
- sleep(3)
- end
- GasUp()
- DropOff()
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement