RANK 출력 스크립

2004/09/14 03:05
GLFTPD 를 사용하며
EGGDROP 을 이용하여 어나운싱을 하는 서버에서 사용할수 있는 스크립트 이다

GL 서버에서의 자신의 월업로드랭킹 주업로드랭킹 일업로드랭킹을 보여준다
사용방법은 아래의 소스를 복사하여 tcl 로 저장후에
eggdrop 에서 로드하여 주면 된다.

/glftpd/bin/stats 파일이 실행 가능한 퍼미션이어야 한다.
가능하지 않다면 고치길 바란다.
bind pub - !rank pub:rank

proc pub:rank {nick output binary chan text} {
set binary {/glftpd/bin/stats}

set mooutput [exec $binary -umx 100]
set weoutput [exec $binary -uwx 100]
set daoutput [exec $binary -utx 100]

set ranktitle "$text RANK :"
set rankout ""
set activate 0
set moactivate 0
set weactivate 0
set daavtivate 0
set rank 0
foreach line [split $mooutput \n] {
regsub -all {\[|\]} $line "" line
if {[string match *\[01\]* $line]} {
set activate 1
}
if {$activate==1} {
incr rank
set user [lindex $line 1]
if {$user==$text} {
set speed [lindex $line end]
regsub -all $speed $line "" line
set size [lindex $line end]
append rankout " Month Up #$rank. \[ $size \]"
set moactivate 1
set activate 0
break
}
}
}

foreach line [split $weoutput \n] {
regsub -all {\[|\]} $line "" line
if {[string match *\[01\]* $line]} {
set activate 1
}
if {$activate==1} {
incr rank
set user [lindex $line 1]
if {$user==$text} {
set speed [lindex $line end]
regsub -all $speed $line "" line
set size [lindex $line end]
append rankout " Week Up #$rank. \[ $size \]"
set weactivate 1
set activate 0
break
}
}
}

foreach line [split $daoutput \n] {
regsub -all {\[|\]} $line "" line
if {[string match *\[01\]* $line]} {
set activate 1
}
if {$activate==1} {
incr rank
set user [lindex $line 1]
if {$user==$text} {
set speed [lindex $line end]
regsub -all $speed $line "" line
set size [lindex $line end]
append rankout " Day Up #$rank. \[ $size \]"
set daactivate 1
set activate 0
break
}
}
}
if {$rankout==""} {
putserv "PRIVMSG $chan :RANK : $text is not our user. :P"
return 0
}
putserv "PRIVMSG $chan :$ranktitle $rankout"
}

putlog "RANKCHECK v1.0 by Manu loaded"

이 스크립은 서버유저가 100 명 이하일 경우를 생각해서 만들었다
100 명을 넘는다면
set mooutput [exec $binary -umx 100]
set weoutput [exec $binary -uwx 100]
set daoutput [exec $binary -utx 100]

위 부분의 숫자 100 을 서버유저보다 많게 고쳐서 사용하면 된다.
2004/09/14 03:05 2004/09/14 03:05
Posted by 마누
트랙백 0 : 댓글 3 댓글을 작성하시려면 클릭하세요

트랙백 보낼 주소 : http://manuz.com/trackback/43


행복합니다^^
행복합니다. 김형원이 운영하는 블로그 입니다. 제가 쓴 글과 영상들이 있고 웹관련 정보들이 있습니다.

카테고리

전체 (159)
Life Story.. (46)
Love Story.. (2)
Meditation with Life (41)
Web Accesiblity (1)
Writing (2)
Meditation (15)
WEB (11)
IT (31)
Movie Clip (UCC) (8)

글 보관함

달력

«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
Total : 300111
Today : 36 Yesterday : 223