Files
airship-autopilot/files/autopilot/probe.lua
Stian 4cd2573f56 Airship autopilot: role-based wget installer for server
Mirrors the live CC autopilot (computer 0) and cockpit (computer 4) from the
Modda wii world. install.lua fetches each role's manifest over HTTP so the
system installs on any server regardless of computer id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 12:53:41 +02:00

31 lines
994 B
Lua

-- probe.lua -- list every peripheral this computer can see, with its methods.
-- Drop a computer next to a block (or wire it up) and run `probe`. UI text in English.
local function dump(name)
print(name .. " -> type: " .. tostring(peripheral.getType(name)))
local methods = peripheral.getMethods(name)
if methods and #methods > 0 then
table.sort(methods)
for _, m in ipairs(methods) do print(" ." .. m) end
else
print(" (no methods)")
end
end
print("=== DIRECT SIDES ===")
local any = false
for _, side in ipairs({ "top", "bottom", "left", "right", "front", "back" }) do
if peripheral.isPresent(side) then any = true; dump(side) else print(side .. " -> (nothing)") end
end
print("")
print("=== ALL NAMES (incl. wired modem network) ===")
local names = peripheral.getNames()
if #names == 0 then print("(none)") end
for _, n in ipairs(names) do dump(n) end
if not any and #names == 0 then
print("")
print(">>> Nothing exposes a peripheral here.")
end