Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuel()
- if turtle.getFuelLevel() < 50 then
- for slot = 1, 16 do
- turtle.select(slot)
- item = turtle.getItemDetail()
- if item == nill then
- else
- if item.name == "minecraft:coal" then
- turtle.refuel(1)
- end
- if slot == 16 then
- print("No fuel to add! ")
- end
- end
- end
- end
- end
- function dig()
- if turtle.getFuelLevel() > 1 then
- print("Enter amount of blocks" )
- amount = read()
- for i = 1, tonumber(amount) do
- check_block()
- turtle.dig()
- turtle.forward()
- end
- else
- refuel()
- end
- end
- function check_block()
- local success, data = turtle.inspect()
- if data == "minecraft:diamond" then
- turtle.select(15)
- elseif data == "miencraft:iron_ore" then
- turtle.select(14)
- elseif data == "minecraft:gold_ore" then
- turtle.select(13)
- elseif data == "minecraft:stone" then
- turtle.select(12)
- print("gay")
- end
- end
- dig()
- refuel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement