Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- http://pastebin.com/hyKTwW2Y
- -- http://pastebin.com/u/Bollie
- os.loadAPI("p") -- http://pastebin.com/SGcYmCqd
- os.loadAPI("t") -- http://pastebin.com/6vxbgdjX
- -- READ PARAMETERS
- local args = { ... }
- if #args > 0 then
- p.send("usage: no arguments")
- end
- p.send("Place sapplings in slot 15")
- p.send("Waiting for tree to grow")
- t.loadblocks()
- function fuelCheck()
- local fuelLevel = t.getFuelLevel()
- if fuelLevel < 100 then
- chopping = false
- end
- end
- -- IsLogBlock
- function isLogBlock(fnInspect)
- local logblocks = {
- "minecraft:spruce_log"
- , "minecraft:birch_log"
- , "minecraft:oak_log"
- , "terrestria:redwood_log"
- , "terrestria:hemlock_log"
- , "traverse:fir_log"
- }
- local success, data = fnInspect()
- local i
- if (success) then
- for _, v in ipairs(logblocks) do
- if data.name == v then
- return true
- end
- end
- end
- return false
- end
- function chopTree()
- if isLogBlock(t.inspect) then
- print("Tree detected... chopping.")
- t.digAndForward()
- while isLogBlock(t.inspectUp) == true do
- t.digAndUp()
- end
- while t.detectDown() == false do
- t.down()
- end
- t.back()
- t.select(15)
- t.place()
- t.select(1)
- end
- end
- local chopping = true
- while chopping do
- fuelCheck()
- chopTree()
- t.suck()
- t.suckUp()
- t.saveblocks()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement