Advertisement
MentalLegend

ATM10 Geoscanner ATM ores

Mar 10th, 2025 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. -- Ensure the geoscanner is connected
  2. local scanner = peripheral.find("geoScanner")
  3. if not scanner then
  4.     print("No geoscanner found! Attach one to this computer.")
  5.     return
  6. end
  7.  
  8. -- Set scan range
  9. local scanRange = 16  
  10.  
  11. -- Main loop to run every 2 seconds
  12. while true do
  13.     print("\nScanning...")
  14.     local scanResult = scanner.scan(scanRange)
  15.  
  16.     if not scanResult or #scanResult == 0 then
  17.         print("Scan failed")
  18.     else
  19.         local oreFound = false
  20.  
  21.         -- Loop through scanned blocks
  22.         for _, block in pairs(scanResult) do
  23.             local blockName = block.name:lower()  -- Convert to lowercase for easy matching
  24.             if blockName:find("unobtainium") or blockName:find("vibranium") or blockName:find("allthemodium") or blockName:find("ancient_debris") then
  25.                 oreFound = true
  26.                 print(string.format("%s found at X: %d, Y: %d, Z: %d", block.name, block.x, block.y, block.z))
  27.             end
  28.         end
  29.  
  30.         if not oreFound then
  31.             print("nothing")
  32.         end
  33.     end
  34.  
  35.     -- Wait for 2 seconds before scanning again
  36.     sleep(2)
  37. end
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement