Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Check for minecraft:stripped_oak_log in turtle inventory
- function checkInventoryForLogs()
- for slot = 1, 16 do
- local item = turtle.getItemDetail(slot)
- if item and item.name == "minecraft:stripped_oak_log" then
- return slot
- end
- end
- return nil
- end
- -- Place a stripped oak log in front of the turtle
- function placeLog()
- local slot = checkInventoryForLogs()
- if slot then
- turtle.select(slot)
- turtle.place()
- sleep(0.1)
- end
- end
- -- Check if the block in front of the turtle is create:andesite_casing and break it
- function checkAndBreakBlock()
- local success, block = turtle.inspect()
- if success and block.name == "create:andesite_casing" then
- turtle.dig()
- end
- end
- -- Main loop
- while true do
- placeLog()
- checkAndBreakBlock()
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement