Advertisement
Guest User

System Info Script

a guest
Mar 23rd, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 5.78 KB | None | 0 0
  1. ;System Info
  2. menu channel,status,query {
  3.   System Info
  4.   .$iif(!$active,$style(2)) Public
  5.   ..All: allinfo say
  6.   ..OS-Memory: say $osinfo  
  7.   ..MotherBoard-CPU: say $cpuinfo $moboinfo
  8.   ..Network: say $netinfo
  9.   ..Video: say $videoinfo
  10.   ..Disk Drives: say $diskinfo
  11.   .Private
  12.   ..All: allinfo echo
  13.   ..OS-Memory: echo -a $osinfo
  14.   ..MotherBoard-CPU: echo -a $cpuinfo $moboinfo
  15.   ..Network: echo -a $netinfo
  16.   ..Video: echo -a $videoinfo
  17.   ..Disk Drives: echo -a $diskinfo
  18. }
  19. alias -l allinfo {
  20.   $1- 04S14ystem 04I14nfo: $cpuinfo  $osinfo $videoinfo $moboinfo
  21.   $1- 04S14ystem 04I14nfo: $netinfo $diskinfo
  22. }
  23. alias -l cpuinfo {
  24.   .comopen Processor WbemScripting.SWbemLocator
  25.   if (!$comerr) {
  26.     if ($com(Processor, ConnectServer, 3, dispatch* Specs)) {
  27.       if ($com(Specs, Get, 3, string, Win32_Processor.DeviceID='CPU0', dispatch* Results)) {
  28.         var %manufacturer, %name, %caption, %clockspeed, %load, %architecture
  29.         if ($com(Results, Manufacturer, 3)) { %manufacturer = $com(Results).result }
  30.         if ($com(Results, Name, 3)) { %name = $com(Results).result }
  31.         if ($com(Results, Caption, 3)) { %caption = $com(Results).result }
  32.         if ($com(Results, CurrentClockSpeed, 3)) { %clockspeed = $com(Results).result }
  33.         if ($com(Results, LoadPercentage, 3)) { %load = $com(Results).result }
  34.         if ($com(Results, Architecture, 3)) { %architecture = $com(Results).result }
  35.         .comclose Results
  36.       }
  37.       .comclose Specs
  38.     }
  39.     .comclose Processor
  40.     $iif($isid,return,$iif(# ischan,say,echo -a)) 04C14PU:04 %manufacturer %name  %caption $+(%load,%) Load
  41.   }
  42.   else { echo -st Com Error $nopath($script) | .comclose Processor | return }
  43. }
  44. alias -l osinfo {
  45.   if (!$com(Wbem.2)) { WbemOpen }
  46.   var %TotalMemory 04T14otal 04M14emory:04 $round($calc($WbemGet(Win32_OperatingSystem,TotalVisibleMemorySize,1)/1024),2)
  47.   var %FreeMemory 04A14vailable 04M14emory:04 $round($calc($WbemGet(Win32_OperatingSystem,FreePhysicalMemory,1)/1024),2)
  48.   var %OSCaption 04O14S:04 $WbemGet(Win32_OperatingSystem,Caption,1)
  49.   var %OSVersion $WbemGet(Win32_OperatingSystem,Version,1)
  50.   var %OSArchitecture $WbemGet(Win32_OperatingSystem,OSArchitecture,1)
  51.   if ($com(Wbem.2)) { .comclose Wbem.2 }
  52.   $iif($isid,return,$iif(# ischan,say,echo -a)) %OSCaption %OSVersion %OSArchitecture 04U14ptime:04 $uptime(system,1) $+(%TotalMemory,MB) $+(%FreeMemory,MB)
  53. }
  54. alias -l moboinfo {
  55.   if (!$com(Wbem.2)) { WbemOpen }
  56.   var %Aname 04A14udio:04 $WbemGet(Win32_SoundDevice,Name,1)  
  57.   var %Description $WbemGet(Win32_BaseBoard,Description,1)
  58.   var %Manufacturer $WbemGet(Win32_BaseBoard,Manufacturer,1)
  59.   if ($com(Wbem.2)) { .comclose Wbem.2 }
  60.   $iif($isid,return,$iif(# ischan,say,echo -a)) 04M14OBO:04 %Manufacturer %Description %Aname 
  61. }
  62. alias -l netinfo {
  63.   if (!$com(Wbem.2)) { WbemOpen }
  64.   var %BytesReceived $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesReceivedPerSec,1)
  65.   %BytesReceived = 04R14eceived:04 $bytes($calc(%BytesReceived + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesReceivedPerSec,2))).suf
  66.   var %BytesSent $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesSentPerSec,1)
  67.   %BytesSent = 04S14ent:04 $bytes($calc(%BytesSent + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesSentPerSec,2))).suf
  68.   var %BytesTotal $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesTotalPerSec,1)
  69.   %BytesTotal = 04T14otal:04 $bytes($calc(%BytesTotal + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesTotalPerSec,2))).suf
  70.   var %Bandwidth $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,CurrentBandwidth,1)
  71.   %Bandwidth = 04B14andwidth:04 $calc(%Bandwidth + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,CurrentBandwidth,2)/100000)
  72.   var %Name $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,Name,1)
  73.   %Name = $+(%Name,14/04,$WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,Name,2))
  74.   if ($com(Wbem.2)) { .comclose Wbem.2 }
  75.   $iif($isid,return,$iif(# ischan,say,echo -a)) 04N14etwork:04 %Name $+(%Bandwidth,KBps) %BytesReceived %BytesSent %BytesTotal 
  76. }
  77. alias -l videoinfo {
  78.   if (!$com(Wbem.2)) { WbemOpen }
  79.   var %Compatibility $WbemGet(Win32_VideoController,AdapterCompatibility,1)
  80.   var %VideoProcessor $WbemGet(Win32_VideoController,VideoProcessor,1)
  81.   var %AdapterRam $WbemGet(Win32_VideoController,AdapterRam,1)
  82.   var %Horizontal $WbemGet(Win32_VideoController,currenthorizontalresolution,1)
  83.   var %Vertical $WbemGet(Win32_VideoController,currentverticalresolution,1)
  84.   var %Bits $WbemGet(Win32_VideoController,currentbitsperpixel,1)
  85.   var %Refresh $WbemGet(Win32_VideoController,currentrefreshrate,1)
  86.   if ($com(Wbem.2)) { .comclose Wbem.2 }  
  87.   $iif($isid,return,$iif(# ischan,say,echo -a)) 04V14ideo:04 %Compatibility %VideoProcessor $+($bytes(%AdapterRam,3),MB) $+(%Horizontal,x,%Vertical) $+(%Bits,bit) $+(%Refresh,Hz)
  88. }
  89. alias -l DiskInfo {
  90.   var %d $disk(0),%total 0,%free 0,%result
  91.   while (%d) {
  92.     if ($disk(%d).size) {
  93.       %total = $calc(%total + $disk(%d).size)
  94.       %free = $calc(%free + $disk(%d).free)
  95.       %result = %result 04I14D:04 $disk(%d).label $disk(%d).path 04T14ype:04 $disk(%d).type 04S14ize:04 $bytes($disk(%d).size,g3).suf 04F14ree:04 $bytes($disk(%d).free,g3).suf 
  96.     }
  97.     dec %d
  98.   }
  99.   $iif($isid,return,$iif(# ischan,say,echo -a)) %Result 04T14otal 04D14isk 04S14pace:04 $bytes(%Total,g3).suf 04T14otal 04S14pace 04F14ree:04 $bytes(%free,g3).suf 
  100. }  
  101. alias -l WbemOpen {
  102.   .comopen Wbem.1 WbemScripting.SWbemLocator
  103.   .comclose Wbem.1 $com(Wbem.1,ConnectServer,3,dispatch* Wbem.2)
  104. }
  105. alias -l WbemGet {
  106.   if ($com(Wbem.3)) { .comclose Wbem.3 }
  107.   if ($com(Wbem.2,ExecQuery,3,bstr*,select $2 from $1,dispatch* Wbem.3)) { var %Result $comval(Wbem.3,$3,$2) }
  108.   .comclose Wbem.3
  109.   return %Result
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement