Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. ;System Info by Ford_Lawnmower irc.mindforge.org #USA-Chat
  2. menu channel,status {
  3. System Info
  4. .$iif(!$chan,$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.  
  20. alias qnfo {
  21. allinfo echo
  22. }
  23.  
  24. alias nfo {
  25. allinfo me
  26. }
  27.  
  28. alias allinfo {
  29. ;$1- 04S14ystem 04I14nfo: $cpuinfo $osinfo $videoinfo $moboinfo
  30. ;$1- 04S14ystem 04I14nfo: $netinfo $diskinfo
  31. $1- $osinfo $cpuinfo $diskinfo
  32. }
  33.  
  34. alias -l cpuinfo {
  35. .comopen Processor WbemScripting.SWbemLocator
  36. if (!$comerr) {
  37. if ($com(Processor, ConnectServer, 3, dispatch* Specs)) {
  38. if ($com(Specs, Get, 3, string, Win32_Processor.DeviceID='CPU0', dispatch* Results)) {
  39. var %manufacturer, %name, %caption, %clockspeed, %load, %architecture
  40. ;if ($com(Results, Manufacturer, 3)) { %manufacturer = $com(Results).result }
  41. if ($com(Results, Name, 3)) { %name = $com(Results).result }
  42. ;if ($com(Results, Caption, 3)) { %caption = $com(Results).result }
  43. ;if ($com(Results, CurrentClockSpeed, 3)) { %clockspeed = $com(Results).result }
  44. if ($com(Results, LoadPercentage, 3)) { %load = $com(Results).result }
  45. ;if ($com(Results, Architecture, 3)) { %architecture = $com(Results).result }
  46. .comclose Results
  47. }
  48. .comclose Specs
  49. }
  50. .comclose Processor
  51. $iif($isid,return,$iif(# ischan,say,echo -a)) 7Processor:13 %name $+(%load,% Load)
  52. }
  53. else { echo -st Com Error $nopath($script) | .comclose Processor | return }
  54. }
  55. alias -l osinfo {
  56. if (!$com(Wbem.2)) { WbemOpen }
  57. var %TotalMemory $round($calc($WbemGet(Win32_OperatingSystem,TotalVisibleMemorySize,1)/1024),2)
  58. var %FreeMemory $round($calc($WbemGet(Win32_OperatingSystem,FreePhysicalMemory,1)/1024),2)
  59. var %OSCaption $WbemGet(Win32_OperatingSystem,Caption,1)
  60. ;var %OSVersion $WbemGet(Win32_OperatingSystem,Version,1)
  61. var %OSArchitecture $WbemGet(Win32_OperatingSystem,OSArchitecture,1)
  62. if ($com(Wbem.2)) { .comclose Wbem.2 }
  63. $iif($isid,return,$iif(# ischan,say,echo -a)) $+(13,%OSCaption %OSArchitecture) 7has been running for13 $uptime(system,1) 7Memory Usage:13 $+(%FreeMemory,MB/,%TotalMemory,MB)
  64.  
  65. }
  66. alias -l moboinfo {
  67. if (!$com(Wbem.2)) { WbemOpen }
  68. var %Aname 04A14udio:04 $WbemGet(Win32_SoundDevice,Name,1)
  69. var %Description $WbemGet(Win32_BaseBoard,Description,1)
  70. var %Manufacturer $WbemGet(Win32_BaseBoard,Manufacturer,1)
  71. if ($com(Wbem.2)) { .comclose Wbem.2 }
  72. $iif($isid,return,$iif(# ischan,say,echo -a)) 04M14OBO:04 %Manufacturer %Description %Aname 
  73. }
  74. alias -l netinfo {
  75. if (!$com(Wbem.2)) { WbemOpen }
  76. var %BytesReceived $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesReceivedPerSec,1)
  77. %BytesReceived = 04R14eceived:04 $bytes($calc(%BytesReceived + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesReceivedPerSec,2))).suf
  78. var %BytesSent $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesSentPerSec,1)
  79. %BytesSent = 04S14ent:04 $bytes($calc(%BytesSent + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesSentPerSec,2))).suf
  80. var %BytesTotal $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesTotalPerSec,1)
  81. %BytesTotal = 04T14otal:04 $bytes($calc(%BytesTotal + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,BytesTotalPerSec,2))).suf
  82. var %Bandwidth $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,CurrentBandwidth,1)
  83. %Bandwidth = 04B14andwidth:04 $calc(%Bandwidth + $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,CurrentBandwidth,2)/100000)
  84. var %Name $WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,Name,1)
  85. %Name = $+(%Name,14/04,$WbemGet(Win32_PerfRawData_Tcpip_NetworkInterface,Name,2))
  86. if ($com(Wbem.2)) { .comclose Wbem.2 }
  87. $iif($isid,return,$iif(# ischan,say,echo -a)) 04N14etwork:04 %Name $+(%Bandwidth,KBps) %BytesReceived %BytesSent %BytesTotal 
  88. }
  89.  
  90. alias -l videoinfo {
  91. if (!$com(Wbem.2)) { WbemOpen }
  92. var %Compatibility $WbemGet(Win32_VideoController,AdapterCompatibility,1)
  93. var %VideoProcessor $WbemGet(Win32_VideoController,VideoProcessor,1)
  94. var %AdapterRam $WbemGet(Win32_VideoController,AdapterRam,1)
  95. var %Horizontal $WbemGet(Win32_VideoController,currenthorizontalresolution,1)
  96. var %Vertical $WbemGet(Win32_VideoController,currentverticalresolution,1)
  97. var %Bits $WbemGet(Win32_VideoController,currentbitsperpixel,1)
  98. var %Refresh $WbemGet(Win32_VideoController,currentrefreshrate,1)
  99. if ($com(Wbem.2)) { .comclose Wbem.2 }
  100. $iif($isid,return,$iif(# ischan,say,echo -a)) 04V14ideo:04 %Compatibility %VideoProcessor $+($bytes(%AdapterRam,3),MB) $+(%Horizontal,x,%Vertical) $+(%Bits,bit) $+(%Refresh,Hz)
  101. }
  102.  
  103. alias -l DiskInfo {
  104. var %d $disk(0),%total 0,%free 0,%result
  105. while (%d) {
  106. if ($disk(%d).size) {
  107. %total = $calc(%total + $disk(%d).size)
  108. %free = $calc(%free + $disk(%d).free)
  109. %result = %result $+(7,$chr(40),13,$disk(%d).path, ,$bytes($disk(%d).free,g3).suf,7/13,$bytes($disk(%d).size,g3).suf,7,$chr(41))
  110. }
  111. dec %d
  112. }
  113. $iif($isid,return,$iif(# ischan,say,echo -a)) 7HDD Free Space:13 %Result
  114. }
  115.  
  116. alias -l WbemOpen {
  117. .comopen Wbem.1 WbemScripting.SWbemLocator
  118. .comclose Wbem.1 $com(Wbem.1,ConnectServer,3,dispatch* Wbem.2)
  119. }
  120.  
  121. alias -l WbemGet {
  122. if ($com(Wbem.3)) { .comclose Wbem.3 }
  123. if ($com(Wbem.2,ExecQuery,3,bstr*,select $2 from $1,dispatch* Wbem.3)) { var %Result $comval(Wbem.3,$3,$2) }
  124. .comclose Wbem.3
  125. return %Result
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement