Posted 28 June 2012 - 03:40 PM
Peripheral methods program lets you easily getMethods right from the command line. It also will get the names of networked peripherals as well as their methods. You can copy and paste this code or download it using my in game Package Downloader.
methods:
methods:
Spoiler
tArgs = { ... }
side = tArgs[1]
prop = tArgs[2]
if tArgs[1]==nil then
print("Help for methods")
print("'methods <side>' get methods for peripheral")
print("'methods <side> names' get names of networked perpherals")
print("'methods <side> <peripheral name>' get methods for networked peripheral")
return
end
if side~="top" and side~="bottom" and side~="left" and side~="right" and side~="front" and side~="back" then
print("Invalid side. Valid sides are: top, bottom, right, left, front and back")
return
end
if peripheral.getType(side)==nil then
print("No peripheral on "..side.." side")
return
end
if prop==nil then
print("Methods for "..peripheral.getType(side))
for i, p in pairs(peripheral.getMethods(side)) do
print(p.."()")
end
return
end
if peripheral.getType(side)~="modem" then
print("Peripheral "..side.." is not a modem")
return
end
if prop=="names" then
print("Peripherals on "..side.." modem:")
local modem = peripheral.wrap(side)
for i,p in pairs(modem.getNamesRemote()) do
print(p)
end
return
end
local modem = peripheral.wrap(side)
for i, p in pairs(modem.getMethodsRemote(prop)) do
print(p.."()")
end