Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script: IdentifyBuilders_Compact.lua
- -- Purpose: Lists ONLY the names and coordinates of builder huts in a compact format.
- local COLONY_INTEGRATOR_NAME = "colonyIntegrator" -- Adjust if your peripheral has a different name
- local colony = peripheral.find(COLONY_INTEGRATOR_NAME)
- if not colony then
- print("Error: '" .. COLONY_INTEGRATOR_NAME .. "' not found.")
- return
- end
- print("Colony Integrator found. Scanning...")
- print("--- Builder Huts (Name & Coords) ---")
- local buildings = colony.getBuildings()
- if not buildings or #buildings == 0 then
- print("No buildings found.")
- return
- end
- local builderHutsFound = 0
- for i, building in ipairs(buildings) do
- local isLikelyBuilderHut = false
- -- Identify builder huts by name or type containing "builder"
- if string.match(string.lower(building.name or ""), "builder") or string.match(string.lower(building.type or ""), "builder") then
- isLikelyBuilderHut = true
- end
- if isLikelyBuilderHut then
- builderHutsFound = builderHutsFound + 1
- local name = building.name or "UnknownName"
- local locText = "Coords: N/A"
- if building.location then
- locText = "X:" .. building.location.x .. " Y:" .. building.location.y .. " Z:" .. building.location.z
- end
- print(name .. " @ " .. locText)
- end
- end
- if builderHutsFound == 0 then
- print("No 'builder' huts identified.")
- end
- print("--- Scan Complete ---")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement