Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --tree farm propramm
- FuelSlot = 16
- SappSlot = 1
- TurnRightBlock = {"chisel:sandstone_scribbles" ,10 }
- TurnLeftBlock = {"chisel:sandstone" ,10 }
- KeepStraightBlock = {"chisel:sandstone" ,8 }
- RechargeBlock = {"chisel:sandstone" ,15 }
- function checkBlock()
- t,Data = turtle.inspectDown()
- if t == false then
- os.shutdown()
- else
- if Data["name"] == TurnLeftBlock[1] and Data["metadata"] == TurnLeftBlock[2] then
- turtle.turnRight()
- checkWood()
- turtle.turnLeft()
- checkWood()
- turtle.turnLeft()
- turtle.forward()
- elseif Data["name"] == TurnRightBlock[1] and Data["metadata"] == TurnRightBlock[2] then
- turtle.turnLeft()
- checkWood()
- turtle.turnRight()
- checkWood()
- turtle.turnRight()
- turtle.forward()
- elseif Data["name"] == KeepStraightBlock[1] and Data["metadata"] == KeepStraightBlock[2] then
- turtle.turnLeft()
- checkWood()
- turtle.turnRight()
- turtle.turnRight()
- checkWood()
- turtle.turnLeft()
- turtle.forward()
- elseif Data["name"] == RechargeBlock[1] and Data["metadata"] == RechargeBlock[2] then
- turtle.turnLeft()
- DumpStuff()
- turtle.turnRight()
- turtle.turnRight()
- FuelRequest()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- end
- function checkWood()
- p,cData = turtle.inspect()
- if p == false then
- turtle.select(SappSlot)
- turtle.place()
- elseif cData["name"] == "minecraft:log" then
- turtle.dig()
- turtle.forward()
- a,b = turtle.inspectUp()
- local y=0
- while b["name"] == "minecraft:log" do
- turtle.digUp()
- turtle.up()
- a,b = turtle.inspectUp()
- y= y+1
- end
- for n = 1,y do
- turtle.down()
- end
- turtle.forward()
- end
- end
- function DumpStuff()
- for i=1,16 do
- if i ~= SappSlot or i ~= FuelSlot then
- turtle.select(i)
- turtle.drop()
- end
- end
- end
- function FuelRequest()
- c = turtle.getItemCount(FuelSlot)
- turtle.select(FuelSlot)
- turtle.suck(64-c)
- end
- function Refuel()
- if turtle.getFuelLevel() < 10 then
- turtle.select(FuelSlot)
- turtle.refuel(1)
- end
- end
- while true do
- checkBlock()
- Refuel()
- end
Advertisement
Add Comment
Please, Sign In to add comment