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