Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ore Locator Script using Advanced Peripherals Geo Scanner
- -- Define the side where the Geo Scanner is connected
- local geoScannerSide = "top" -- Change this to match your setup
- -- Load the Geo Scanner API
- os.loadAPI("geoScanner")
- -- Function to scan for ores
- local function scanForOres()
- local ores = {"minecraft:diamond_ore", "minecraft:emerald_ore"} -- List of ores to search for
- local results = {} -- Table to store scan results
- -- Perform scans for each ore
- for _, ore in ipairs(ores) do
- local scanResult = geoScanner.scan(ore)
- if scanResult then
- table.insert(results, {ore = ore, position = scanResult})
- end
- end
- return results
- end
- -- Function to display scan results
- local function displayResults(results)
- print("Scan Results:")
- for _, result in ipairs(results) do
- print("Ore: " .. result.ore)
- print("Position: " .. result.position.x .. ", " .. result.position.y .. ", " .. result.position.z)
- print("--------------------------------")
- end
- end
- -- Main function
- local function main()
- -- Check if Geo Scanner is present
- if not peripheral.isPresent(geoScannerSide) or peripheral.getType(geoScannerSide) ~= "geoScanner" then
- print("Geo Scanner not found on specified side.")
- return
- end
- -- Perform ore scan
- local scanResults = scanForOres()
- -- Display results
- displayResults(scanResults)
- end
- -- Run main function
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement