Code: Select all
bind dcc m endcc dcc_whois
bind bot - aubot bot_whois
proc dcc_whois {hand idx text} {
set idx [string tolower [lindex $text 0]]
putallbots "aubot $idx"
}
proc bot_whois {hand idx arg} {
global swi_idx
set idx [join [lrange [split $arg] 0 end]]
dccbroadcast "#$hand# endcc $idx"
if {$idx == ""} {
dccbroadcast "Usage: .swhois \[server\] <nickmask>"
} else {
set swi_idx $idx
swi_wibindall
putserv "WHOIS $idx"
}
}
#processus de whois
proc raw:swi_wi301 {from key arg} {
global swi_idx
set awaymessage [string trimleft [join [lrange [split $arg] 2 end]] :]
if {[valididx $swi_idx]} {
dccbroadcast "Away : $awaymessage"
}
}
proc raw:swi_wi311 {from key arg} {
global swi_idx
set nick [lindex [split $arg] 1]
set username [lindex [split $arg] 2]
set hostname [lindex [split $arg] 3]
set realname [string trimleft [join [lrange [split $arg] 5 end]] :]
if {[valididx $swi_idx]} {
dccbroadcast "--- Whois $nick"
dccbroadcast "Nick : $nick"
dccbroadcast "Realname : $realname"
dccbroadcast "Address : $username@$hostname"
}
}
proc raw:swi_wi312 {from key arg} {
global swi_idx
set server [lindex [split $arg] 2]
set serverinfo [string trimleft [join [lrange [split $arg] 3 end]] :]
if {[valididx $swi_idx]} {
dccbroadcast "Server : $server"
dccbroadcast "Serverinfo : $serverinfo"
}
}
proc raw:swi_wi313 {from key arg} {
global swi_idx
if {[valididx $swi_idx]} {
dccbroadcast "IRC Operator : yes"
}
}
proc raw:swi_wi317 {from key arg} {
global swi_idx
set idletime [lindex [split $arg] 2]
set signontime [lindex [split $arg] 3]
if {[catch {set idletime [duration $idletime]}]} {
set idletime "$idletime seconds"
}
if {[valididx $swi_idx]} {
dccbroadcast "Idle : $idletime"
if {[swi_isnum $signontime]} {
dccbroadcast "Signon time : [ctime $signontime]"
}
}
}
proc raw:swi_wi318 {from key arg} {
global swi_idx
if {[valididx $swi_idx]} {
dccbroadcast "--- End of Whois"
}
swi_wiunbindall
}
proc raw:swi_wi319 {from key arg} {
global swi_idx
set channels [string trimleft [join [lrange [split $arg] 2 end]] :]
if {[valididx $swi_idx]} {
dccbroadcast "Channels : $channels"
}
}
proc raw:swi_wi401 {from key arg} {
global swi_idx
set nick [lindex [split $arg] 1]
if {[valididx $swi_idx]} {
dccbroadcast "--- Whois $nick"
dccbroadcast "No such nick/channel"
}
}
proc raw:swi_wi402 {from key arg} {
global swi_idx
if {[valididx $swi_idx]} {
dccbroadcast "--- Whois"
dccbroadcast "No such server"
dccbroadcast "--- End of Whois"
}
swi_wiunbindall
}
#autres processus ...
proc swi_isnum {number} {
if {($number != "") && (![regexp \[^0-9\] $number])} {
return 1
} else {
return 0
}
}
proc swi_wibindall { } {
bind raw - 301 raw:swi_wi301
bind raw - 311 raw:swi_wi311
bind raw - 312 raw:swi_wi312
bind raw - 313 raw:swi_wi313
bind raw - 317 raw:swi_wi317
bind raw - 318 raw:swi_wi318
bind raw - 319 raw:swi_wi319
bind raw - 401 raw:swi_wi401
bind raw - 402 raw:swi_wi402
}
proc swi_wiunbindall { } {
unbind raw - 301 raw:swi_wi301
unbind raw - 311 raw:swi_wi311
unbind raw - 312 raw:swi_wi312
unbind raw - 313 raw:swi_wi313
unbind raw - 317 raw:swi_wi317
unbind raw - 318 raw:swi_wi318
unbind raw - 319 raw:swi_wi319
unbind raw - 401 raw:swi_wi401
unbind raw - 402 raw:swi_wi402
}
proc swi_wwbindall { } {
bind raw - 314 raw:swi_ww314
bind raw - 369 raw:swi_ww369
bind raw - 402 raw:swi_ww402
bind raw - 406 raw:swi_ww406
}
proc swi_wwunbindall { } {
unbind raw - 314 raw:swi_ww314
unbind raw - 369 raw:swi_ww369
unbind raw - 402 raw:swi_ww402
unbind raw - 406 raw:swi_ww406
}
***(IRCNet)#InfoBot#endcc test
but the whois don't appeared in the party-line ... thank you for your help