Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print( "Select location of peripheral" )
- local unit = peripheral.wrap( read() )
- print( "Peripheral label" )
- local perrlabel = read()
- print( "Writing functions to " .. perrlabel .. " directory" )
- returnDir = shell.dir()
- fs.makeDir( perrlabel )
- shell.setDir( perrlabel )
- commands = unit.getAdvancedMethodsData()
- for key, command in pairs( commands ) do
- fw = fs.open( perrlabel .. "/" .. key, "w" )
- for argnum, argument in pairs( command ) do
- if ( "table" == type( argument ) ) then
- fw.writeLine( argnum )
- fw.writeLine( " " )
- for argnum, args in pairs( argument ) do
- if "table" == type( args ) then
- for a, b in pairs( args ) do
- fw.writeLine( a .. ": " .. tostring( b ) )
- end
- else
- fw.writeLine( argnum .. ": " .. args )
- end
- fw.writeLine( " " )
- end
- else
- fw.writeLine( argnum .. ": " .. tostring( argument ) )
- end
- fw.writeLine( " " )
- end
- fw.close()
- print( "Wrote help for " .. key )
- end
- shell.setDir( returnDir )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement