Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- https://pastebin.com/1Mvs8GEx
- require 'lib.ale.ale'
- Lumberjack = Miner:new()
- Lumberjack.__index = Lumberjack
- Lumberjack.plantables = BlockList:new()
- Lumberjack.plantables:addBlock('minecraft:oak_sapling')
- Lumberjack.whitelist:addTag('minecraft:logs')
- Lumberjack.blacklist:addTag('forge:sapling')
- function Lumberjack:plant()
- local slot = self.inventory:findInBlockList(self.plantables)
- if not slot then print("Didn't find a plantable.") return false end
- slot:select()
- return turtle.place()
- end
- L = Lumberjack:new()
- while (true) do
- if not turtle.detect() then
- print("Planting")
- if not L:plant() then
- print("Planting failed")
- break
- end
- end
- print("Checking block")
- if L:checkBlock() then
- print("Mining block")
- L:mineBlock()
- end
- os.sleep(10)
- print("Looping")
- end
Add Comment
Please, Sign In to add comment