Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local side
- if #tArgs >= 1 then
- -- use arg value
- side = tArgs[1]
- else
- print("usage: peripheralinfo <side>")
- return
- end
- if not peripheral.isPresent(side) then
- print("No peripheral found")
- return
- end
- local ptype = peripheral.getType(side)
- local methods = peripheral.getMethods(side)
- print("Type: ", ptype)
- print("Methods:")
- local nLinesPrinted = 2
- local w,h = term.getSize()
- for _, m in ipairs(methods) do
- if nLinesPrinted >= h - 2 then
- term.write("Press any key to continue")
- os.pullEvent("key")
- term.clearLine()
- term.setCursorPos(1, h)
- end
- nLinesPrinted = nLinesPrinted + print(" ",m)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement