Peace and Protection forum

SYSINFO

kap - 27-5-2017 at 16:42

Gathers the same information as NoNameScript's > System info... tool:

Save the following code as file sysinfo.ppa in your addon folder:

Code:
; #= ppsysinfo -rs ; ######################################## ; Peace and Protection ; PnP SysInfo (standard addon) ; ######################################## #.ppa.info off [addon] name=SysInfo group=Extras popup=SysInfo author=acvxqs version=1.0 url= email= id=ppsysinfo ppver=4.22 config= help= unload= vars= vars2= windows= dialogs= timers= sockets= hashcid= hashpnp= [files] 1=sysinfo.ppa [other] 1= [notes] 1=This addon displays various system information. Use /ppsysinfo to run. [menu] 1= [query] 1= [channel] 1= #.ppa.info end on *:LOAD:{ ; PnP check if (!$_ispnp) { echo 4 -ati2 *** This addon requires Peace and Protection by pai to use. echo 4 -ati2 *** You can download Peace and Protection at http://www.kristshell.net/pnp/ .timer -mio 1 0 .unload -rs " $+ $script $+ " halt } ; Invalid load method check if (!$istok($_cfgx(addons,ids),$readini($script,n,addon,id),32)) { .timer -mio 1 0 .unload -rs " $+ $script $+ " dispa Unloading ' $+ $script $+ ' $chr(40) $+ addon is not properly loaded; use /addon to load it $+ $chr(41) halt } } alias ppsysinfo { var %t = 1 var %todo = Processor,BaseBoard,PhysicalMemory,LogicalDisk,DiskDrive,VideoController,SoundDevice,NetworkAdapter,Printer,Battery,OperatingSystem var %Processor = Caption,Manufacturer,CurrentClockSpeed,ExtClock,L2CacheSize,AddressWidth,SocketDesignation,ProcessorId,LoadPercentage var %BaseBoard = Manufacturer,Product,Version var %PhysicalMemory = Name,Capacity,BankLabel,FormFactor,MemoryType var %LogicalDisk = Name,Description,FileSystem,VolumeName,Size,VolumeSerialNumber,SystemName var %DiskDrive = Model,MediaType,Size,Partitions,InterfaceType,TotalSectors,BytesPerSector,TotalTracks,SectorsPerTrack,TotalCylinders,TracksPerCylinder,TotalHeads var %VideoController = Caption,VideoProcessor,AdapterRAM,VideoMemoryType,VideoArchitecture,AdapterDACType,CurrentHorizontalResolution,CurrentVerticalResolution,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,InstalledDisplayDrivers,DriverVersion,DriverDate var %SoundDevice = Caption,Manufacturer,DeviceID var %NetworkAdapter = Description,Manufacturer,MACAddress,ServiceName,TimeOfLastReset var %Printer = Caption,PortName,PrinterStatus,HorizontalResolution,VerticalResolution,PrintProcessor var %Battery = Caption,DeviceID,EstimatedRunTime,EstimatedChargeRemaining var %OperatingSystem = Caption,OSArchitecture,Version,ServicePackMajorVersion,BuildNumber,BuildType,NumberOfProcesses,FreePhysicalMemory,FreeVirtualMemory,TotalVirtualMemorySize,InstallDate,BootDevice,RegisteredUser var %win = @SysInfo _progress.1 Connecting to WMI (COM)... if ($window(%win)) window -c %win _window 2.2 -hnlkv -t40,120 %win -1 -1 -1 -1 %win iline %win 1 Systeminformation while ($gettok(%todo,%t,44)) { var %do = $ifmatch var %win32 = Win32_ $+ %do _progress.2 $int($calc(%t / $numtok(%todo,44) * 100)) Querying %win32 .comopen Locator WbemScripting.SWbemLocator noop $com(Locator,ConnectServer,3, dispatch* Services) .comclose Locator noop $com(Services, InstancesOf,3,string,%win32,dispatch* Instances) .comclose Services noop $com(Instances,Count,3) aline %win %do $+ $chr(9) $+ Information $+ $chr(9) $+ Value var %n = $com(Instances).result var %m = 1 while (%m <= %n) { var %item = $eval(% $+ %do,2) var %num = $numtok(%item,44) var %x = 1 aline %win %do %m while (%x <= %num) { var %information = $gettok(%item,%x,44) if ($istok(Capacity Size AdapterRAM,%information,32)) aline %win $chr(9) $+ %information $+ $chr(9) $+ $bytes($comval(Instances, %m, %information)).suf elseif ($istok(FreePhysicalMemory FreeVirtualMemory TotalVirtualMemorySize,%information,32)) aline %win $chr(9) $+ %information $+ $chr(9) $+ $bytes($calc($comval(Instances, %m, %information) * 1024)).suf else aline %win $chr(9) $+ %information $+ $chr(9) $+ $comval(Instances, %m, %information) inc %x } inc %m } .comclose Instances inc %t } window -a %win }


P.S.: No com error checking, no menu commands available. Run with command /ppsysinfo. See GitHub.com/acvxqs for old and new PnP addons ...
P.P.S.: Solbu, would it be a good idea to create a sub forum called addons? And to move the 'snippets' that are actually addons there?

kap

[Edited on 27-5-2017 at 15:44 by kap]

solbu - 28-5-2017 at 21:35

Quote: Originally posted by kap  
Solbu, would it be a good idea to create a sub forum called addons? And to move the 'snippets' that are actually addons there?
They belong on Github, not in the forum.
The reason is that one can ensure that the code is copied/downloaded correctly to the user.