setudef flag nopubicqlist
bind pub - !icqlist pub_icqlist
set icqlist(chan) #egghelp
set icqlist(delay) 20
set icqlist(color1) \00310
set icqlist(color2) \00305
set icqlist(list) {номер1:пароль1
номер2:пароль2
номер3:пароль3
номер4:пароль4
номер5:пароль5
номер6:пароль6}
proc pub_icqlist {nick uhost hand chan args} {
global icqlist
if {[channel get $chan nopubicqlist]} { return }
if {[info exists icqlist(lasttime,$chan)] && [expr $icqlist(lasttime,$chan) + $icqlist(delay)] > [clock seconds]} {
set chan $icqlist(chan)
putserv "PRIVMSG $chan :$icqlist(color1)До следующего ICQ осталось подождать $icqlist(color2)[expr $icqlist(delay) - [expr [clock seconds] - $icqlist(lasttime,$chan)]] $icqlist(color1)[lindex {. секунду секунды секунд} [icqlistnumgrp [expr $icqlist(delay) - [expr [clock seconds] - $icqlist(lasttime,$chan)]]]]."
return
}
}
proc pub_icqlist_auto {} {
global icqlist i
set chan $icqlist(chan)
set icqlistline [lindex [split $icqlist(list) \n] $i]
if {[llength [split $icqlistline ""]] <= 1} {
putserv "PRIVMSG $chan :$icqlist(color1)Список ICQ закончен. Начинаем с начала. До следующего номера $icqlist(color2)[expr $icqlist(delay) - [expr [clock seconds] - $icqlist(lasttime,$chan)]] $icqlist(color1)[lindex {. секунду секунды секунд} [icqlistnumgrp [expr $icqlist(delay) - [expr [clock seconds] - $icqlist(lasttime,$chan)]]]]."
set i 0
icqlistkilltm
utimer $icqlist(delay) [list pub_icqlist_auto]
}
set chan $icqlist(chan)
putserv "PRIVMSG $chan :$icqlist(color1)$icqlistline $icqlist(color2)$i/[llength [split $icqlist(list) \n]]"
set icqlist(lasttime,$chan) [clock seconds]
incr i
icqlistkilltm
utimer $icqlist(delay) [list pub_icqlist_auto]
}
proc icqlistnumgrp {number} {
switch -glob -- "$number" {
*11 {return 3}
*12 {return 3}
*13 {return 3}
*14 {return 3}
*1 {return 1}
*2 {return 2}
*3 {return 2}
*4 {return 2}
default {return 3}
}
}
proc icqlistkilltm {} {
foreach tms "[utimers]" {
if {([llength $tms] != 0)} {
if {[string match -nocase "*icqlist*" $tms]} {killutimer [lindex $tms 2]}
unset tms
}
}
}
set i 0
utimer $icqlist(delay) [list pub_icqlist_auto]
putlog "icqlist.tcl by tvrsh loaded"