Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get a reference to the Geo Scanner attachment
- local geoScanner = peripheral.find("geoScanner")
- if not geoScanner then
- error("Geo Scanner not found")
- end
- -- Run a single scan with a specified radius
- local radius = 5 -- You can change this radius as needed
- local data, reason = geoScanner.scan(radius)
- if not data then
- print("Scan failed: " .. reason)
- else
- print("Scan successful. Scanning for ores...")
- local oreCount = 0
- for i, block in ipairs(data) do
- if string.find(block.name, "_ore$") then -- Check if the block name ends with "_ore"
- oreCount = oreCount + 1
- print(oreCount .. ": " .. block.name .. " at (x=" .. block.x .. ", y=" .. block.y .. ", z=" .. block.z .. ")")
- end
- end
- if oreCount == 0 then
- print("No ores found in the scan radius.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement