Darkchoco
09/11/07, 11:48 PM
irc 채널에 자신의 시스템 정보를 보여주는 스크립트 입니다.
실력이 미천하여 코드가 지저분하고 모든정보를 한번에 불러오는 방법을 계속 연구중입니다.
스크립트는 수정가능하며 비트토크 유저에 한해 재배포 가능합니다.
+++
mirc 6.16 버전 이상에서 정상 작동하며,
안될시에는 Windows Management Instrumentation (WMI)업데이트 (http://www.microsoft.com/downloads/details.aspx?FamilyID=98a4c5ba-337b-4e92-8c18-a63847760ea5&DisplayLang=en)를 해주시면됩니다. (95/98/NT 사용자)
보여주는 내용은 아래를 참고하시면 됩니다.
시스템 정보
http://img264.imageshack.us/img264/2454/20091107233911.png
OS 정보
http://img442.imageshack.us/img442/1936/20091107233929.png
하드디스크 정보
http://img20.imageshack.us/img20/1266/20091107234037.png
- 제 경우 백업용 파티션이 하나 더 있어서 5개로 잡힙니다. :)
Ram 정보
http://img340.imageshack.us/img340/8103/20091107234050.png
코드는 아래를 펼처보시거나 다운받으시면 됩니다.
on 1:INPUT:#: {
if ( $1 == info ) {
msg $chan ▽ 7 System Infomaiton Load 1 ▽
msg $chan ├ 12 OS 1 $+($wmiget(Win32_OperatingSystem).Caption, ,[,$wmiget(Win32_OperatingSystem).OSArchitecture ,])
msg $chan ├ 12 Up time 1 $duration($uptime(system,3))
msg $chan ├ 12 CPU 1 $+($wmiget(Win32_Processor).Name,[,$wmiget(Win32_Processor).CurrentClockSpeed,MHz,],[,$wmiget(Win32_Processor).LoadPercentage,% Load,] )
msg $chan ├ 12 VGA 1 $+($wmiget(Win32_VideoController).VideoProcessor,[,$bytes($wmiget(Win32_VideoController).AdapterRam,3).suf,] )
msg $chan ├ 12 M/B1 $wmiget(Win32_BaseBoard).Manufacturer $wmiget(Win32_BaseBoard).Product
msg $chan △ 7 System Infomaiton End 1 △
halt
}
if ( $1 == hdd ) {
msg $chan ▽ 7 Hard Disk Infomaiton Load 1 ▽
msg $chan ├ Total 12 $disk(0) 1 Dirves
var %i = 1
while (%i <= $disk(0)) {
if ($disk(%i).type == fixed) {
var %hddmax = $bytes($disk(%i).size)
var %hddfree = $bytes($disk(%i).free)
var %var = $disk(%i).path $+(12 Total 1 $bytes($disk(%i).size).suf 12 Free 1 $bytes($disk(%i).free).suf )
var %var2 = $+(12 use 1 $round($calc( (%hddmax - %hddfree) / %hddmax * 100),2) %)
msg $chan ├ $+(%var, [,%var2,])
}
inc %i
}
msg $chan △ 7 Hard Disk Infomaiton End 1 △
halt
}
if ($1 == os) {
msg $chan ▽ 7 Operating System Infomaiton Load 1 ▽
var %time = $ctime($iif($wmiget(Win32_OperatingSystem).InstallDate,$+($mid($ifmatch,7,2),/,$mid($ifmatch,5,2),/,$mid($ifmatch,1,4)) $+($mid($ifmatch,9,2),:,$mid($ifmatch,11,2),:,$mid($ifmatch,13,2))))
msg $chan ├ 12 Install Date 1 $asctime(%time)
msg $chan ├ 12 Duration 1 $duration($calc($ctime - %time)) ago
msg $chan △ 7 Operating System Infomaiton End 1 △
halt
}
if ($1 == ram) {
var %rammax = $round($calc($wmiget(Win32_OperatingSystem).TotalVisibleMemorySize / 1024),1)
var %ramuse = $round($calc($wmiget(Win32_OperatingSystem).FreePhysicalMemory / 1024), 1)
var %ram = $round($calc((%rammax - %ramuse) / %rammax * 100),2)
msg $chan ▽ 7 Ram Infomaiton Load 1 ▽
msg $chan ├ $+( 12 Total 1 %rammax,MB, ,12 Use 1 %ramuse,MB)
msg $chan ├ $+(12 Using 1 %ram,%, ,$rambar(%ram))
msg $chan △ 7 Ram Infomaiton End 1 △
halt
}
}
;ram bar 설정부분
alias -l rambar {
if ($len($1) < 990) {
var %rb.size = 10
var %rb.used = $round($calc($1 / 100 * %rb.size),0)
var %rb.unused = $round($calc(%rb.size - %rb.used),0)
var %rb.usedstr = $str(4|,%rb.used)
var %rb.unusedstr = $str(1-,%rb.unused)
if ((%rb.usedstr) && (%rb.unusedstr)) return $+([,%rb.usedstr,%rb.unusedstr,])
}
}
;시스템 정보 불러오는 내용
alias wmiget {
var %com = cominfo, %com2 = cominfo2, %com3 = cominfo3
if ($com(%com)) { .comclose %com }
if ($com(%com2)) { .comclose %com2 }
if ($com(%com3)) { .comclose %com3 }
.comopen %com WbemScripting.SWbemLocator
var %x = $com(%com,ConnectServer,3,dispatch* %com2), %x = $com(%com2,ExecQuery,3,bstr*,select $prop from $1,dispatch* %com3), %x = $comval(%com3,$iif($2,$2,1),$prop)
if ($com(%com)) { .comclose %com }
if ($com(%com2)) { .comclose %com2 }
if ($com(%com3)) { .comclose %com3 }
return %x
}
2704
스크립트 추가 or 불러오는 방법
1. irc 에서 [alt]+[r] 을 누릅니다.
2. 그러면, remote 탭이 활성화 됩니다.
3-1. 위에 적어둔 스크립트를 복사해서 붙여넣기 하시거나
3-2. 파일을 받으시고 /appdata/roaming/mirc/scripts/ 폴더에 넣으신 다음
file > load 로 불러오시거나 [ctrl]+[L]을 눌러 불러오시면 됩니다.
3-3.아니면 파일을 받으시고 /appdata/roaming/mirc/scripts 폴더에 넣으신 다음
irc에서 /load -rs scripts/sysinfo.mrc 를 입력해주시면 됩니다.
--------------------------------------------------------
과도한 스크립트 사용은 irc를 지저분하게 만들 수 있습니다.
채널을 오픈하셔서 사용하시거나,
다른사용자의 정보를 확인시에는 쿼리를 이용해주세요
--------------------------------------------------------
실력이 미천하여 코드가 지저분하고 모든정보를 한번에 불러오는 방법을 계속 연구중입니다.
스크립트는 수정가능하며 비트토크 유저에 한해 재배포 가능합니다.
+++
mirc 6.16 버전 이상에서 정상 작동하며,
안될시에는 Windows Management Instrumentation (WMI)업데이트 (http://www.microsoft.com/downloads/details.aspx?FamilyID=98a4c5ba-337b-4e92-8c18-a63847760ea5&DisplayLang=en)를 해주시면됩니다. (95/98/NT 사용자)
보여주는 내용은 아래를 참고하시면 됩니다.
시스템 정보
http://img264.imageshack.us/img264/2454/20091107233911.png
OS 정보
http://img442.imageshack.us/img442/1936/20091107233929.png
하드디스크 정보
http://img20.imageshack.us/img20/1266/20091107234037.png
- 제 경우 백업용 파티션이 하나 더 있어서 5개로 잡힙니다. :)
Ram 정보
http://img340.imageshack.us/img340/8103/20091107234050.png
코드는 아래를 펼처보시거나 다운받으시면 됩니다.
on 1:INPUT:#: {
if ( $1 == info ) {
msg $chan ▽ 7 System Infomaiton Load 1 ▽
msg $chan ├ 12 OS 1 $+($wmiget(Win32_OperatingSystem).Caption, ,[,$wmiget(Win32_OperatingSystem).OSArchitecture ,])
msg $chan ├ 12 Up time 1 $duration($uptime(system,3))
msg $chan ├ 12 CPU 1 $+($wmiget(Win32_Processor).Name,[,$wmiget(Win32_Processor).CurrentClockSpeed,MHz,],[,$wmiget(Win32_Processor).LoadPercentage,% Load,] )
msg $chan ├ 12 VGA 1 $+($wmiget(Win32_VideoController).VideoProcessor,[,$bytes($wmiget(Win32_VideoController).AdapterRam,3).suf,] )
msg $chan ├ 12 M/B1 $wmiget(Win32_BaseBoard).Manufacturer $wmiget(Win32_BaseBoard).Product
msg $chan △ 7 System Infomaiton End 1 △
halt
}
if ( $1 == hdd ) {
msg $chan ▽ 7 Hard Disk Infomaiton Load 1 ▽
msg $chan ├ Total 12 $disk(0) 1 Dirves
var %i = 1
while (%i <= $disk(0)) {
if ($disk(%i).type == fixed) {
var %hddmax = $bytes($disk(%i).size)
var %hddfree = $bytes($disk(%i).free)
var %var = $disk(%i).path $+(12 Total 1 $bytes($disk(%i).size).suf 12 Free 1 $bytes($disk(%i).free).suf )
var %var2 = $+(12 use 1 $round($calc( (%hddmax - %hddfree) / %hddmax * 100),2) %)
msg $chan ├ $+(%var, [,%var2,])
}
inc %i
}
msg $chan △ 7 Hard Disk Infomaiton End 1 △
halt
}
if ($1 == os) {
msg $chan ▽ 7 Operating System Infomaiton Load 1 ▽
var %time = $ctime($iif($wmiget(Win32_OperatingSystem).InstallDate,$+($mid($ifmatch,7,2),/,$mid($ifmatch,5,2),/,$mid($ifmatch,1,4)) $+($mid($ifmatch,9,2),:,$mid($ifmatch,11,2),:,$mid($ifmatch,13,2))))
msg $chan ├ 12 Install Date 1 $asctime(%time)
msg $chan ├ 12 Duration 1 $duration($calc($ctime - %time)) ago
msg $chan △ 7 Operating System Infomaiton End 1 △
halt
}
if ($1 == ram) {
var %rammax = $round($calc($wmiget(Win32_OperatingSystem).TotalVisibleMemorySize / 1024),1)
var %ramuse = $round($calc($wmiget(Win32_OperatingSystem).FreePhysicalMemory / 1024), 1)
var %ram = $round($calc((%rammax - %ramuse) / %rammax * 100),2)
msg $chan ▽ 7 Ram Infomaiton Load 1 ▽
msg $chan ├ $+( 12 Total 1 %rammax,MB, ,12 Use 1 %ramuse,MB)
msg $chan ├ $+(12 Using 1 %ram,%, ,$rambar(%ram))
msg $chan △ 7 Ram Infomaiton End 1 △
halt
}
}
;ram bar 설정부분
alias -l rambar {
if ($len($1) < 990) {
var %rb.size = 10
var %rb.used = $round($calc($1 / 100 * %rb.size),0)
var %rb.unused = $round($calc(%rb.size - %rb.used),0)
var %rb.usedstr = $str(4|,%rb.used)
var %rb.unusedstr = $str(1-,%rb.unused)
if ((%rb.usedstr) && (%rb.unusedstr)) return $+([,%rb.usedstr,%rb.unusedstr,])
}
}
;시스템 정보 불러오는 내용
alias wmiget {
var %com = cominfo, %com2 = cominfo2, %com3 = cominfo3
if ($com(%com)) { .comclose %com }
if ($com(%com2)) { .comclose %com2 }
if ($com(%com3)) { .comclose %com3 }
.comopen %com WbemScripting.SWbemLocator
var %x = $com(%com,ConnectServer,3,dispatch* %com2), %x = $com(%com2,ExecQuery,3,bstr*,select $prop from $1,dispatch* %com3), %x = $comval(%com3,$iif($2,$2,1),$prop)
if ($com(%com)) { .comclose %com }
if ($com(%com2)) { .comclose %com2 }
if ($com(%com3)) { .comclose %com3 }
return %x
}
2704
스크립트 추가 or 불러오는 방법
1. irc 에서 [alt]+[r] 을 누릅니다.
2. 그러면, remote 탭이 활성화 됩니다.
3-1. 위에 적어둔 스크립트를 복사해서 붙여넣기 하시거나
3-2. 파일을 받으시고 /appdata/roaming/mirc/scripts/ 폴더에 넣으신 다음
file > load 로 불러오시거나 [ctrl]+[L]을 눌러 불러오시면 됩니다.
3-3.아니면 파일을 받으시고 /appdata/roaming/mirc/scripts 폴더에 넣으신 다음
irc에서 /load -rs scripts/sysinfo.mrc 를 입력해주시면 됩니다.
--------------------------------------------------------
과도한 스크립트 사용은 irc를 지저분하게 만들 수 있습니다.
채널을 오픈하셔서 사용하시거나,
다른사용자의 정보를 확인시에는 쿼리를 이용해주세요
--------------------------------------------------------