Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local dig = turtle.dig
- local turnRight = turtle.turnRight
- local turnLeft = turtle.turnLeft
- local up = turtle.up
- local down = turtle.down
- local digUp = turtle.digUp
- local forward = turtle.forward
- local BLOCKS_TO_SEARCH_FOR = {
- "minecraft:iron_ore",
- "minecraft:gold_ore",
- "minecraft:diamond_ore",
- "mysticalagriculture:inferium_ore",
- "thermal:niter_ore",
- "minecraft:dirt"
- }
- local function IsBlockOnList()
- local detect, data = turtle.inspect()
- if detect then
- for _,blockName in pairs(BLOCKS_TO_SEARCH_FOR) do
- if blockName == data.name then
- print("Found", data.name)
- return data.name
- end
- end
- end
- end
- local function LookAround()
- for i = 1,4 do
- turnRight()
- if IsBlockOnList() then
- dig()
- return true
- end
- end
- end
- while true do
- local found = LookAround()
- print(found)
- if found then
- dig()
- end
- forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement