Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = require("sides")
- local robot = require("robot")
- local comp = require("component")
- if not comp.isAvailable("geolyzer") then
- io.write("No geolyzer found.\n")
- os.exit()
- end
- if not comp.isAvailable("inventory_controller") then
- io.write("No inventory found.\n")
- os.exit()
- end
- local depth = 0
- local good = true
- local function isValuable(side)
- dat = comp.geolyzer.analyze(side)
- return info.name:match(".*ore.*")
- end
- while good do
- --Check for ore
- for _, side in ipairs(sides) do
- local val = isValuable(side)
- io.write(val)
- end
- --Attempt to go down
- comp.robot.swing(sides.down)
- good = comp.robot.move(sides.down)
- depth = depth + 1
- end
- while depth > 1 do
- comp.robot.move(sides.up)
- depth = depth - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement