 |
|
 |
|
TrAsNeT Junior 2


Data inscrierii: 12/Mai/2008 Mesaje: 44 Localitate: Sighet
|
|
 |
|
 |
|
Trimis: 14/05/2008 00:08 Titlul subiectului: whois.tcl |
|
|
# Config:
# What is the minimum access someone needs to perform a who with the bot?
# o = global op, m = global master, n = global owner
# |o = channel op, |m = channel master, |n = channel owner
set who(acc) "o"
# End of Config
bind pub $who(acc) "!who" who:nick
proc who:nick { nickname hostname handle channel arguments } {
global who
set target [lindex [split $arguments] 0]
if {$target == ""} {
putquick "PRIVMSG $channel :Please choose a target first."
return 0
}
putquick "WHOIS $target $target"
set ::whochannel $channel
set ::whotarget $target
bind RAW - 401 who:nosuch
bind RAW - 311 who:info
bind RAW - 319 who:channels
bind RAW - 301 who:away
bind RAW - 313 who:ircop
bind RAW - 330 who:auth
bind RAW - 317 who:idle
}
proc who:putmsg { channel arguments } {
putquick "PRIVMSG $channel :$arguments"
}
proc who:info { from keyword arguments } {
set channel $::whochannel
set nickname [lindex [split $arguments] 1]
set ident [lindex [split $arguments] 2]
set host [lindex [split $arguments] 3]
set realname [string range [join [lrange $arguments 5 end]] 1 end]
who:putmsg $channel "$nickname - $ident@$host * $realname"
unbind RAW - 311 who:info
}
proc who:ircop { from keyword arguments } {
set channel $::whochannel
set target $::whotarget
who:putmsg $channel "$target is an IRC Operator"
unbind RAW - 313 who:ircop
}
proc who:away { from keyword arguments } {
set channel $::whochannel
set target $::whotarget
set awaymessage [string range [join [lrange $arguments 2 end]] 1 end]
who:putmsg $channel "$target is away: $awaymessage"
unbind RAW - 301 who:away
}
proc who:channels { from keyword arguments } {
set channel $::whochannel
set channels [string range [join [lrange $arguments 2 end]] 1 end]
set target $::whotarget
who:putmsg $channel "$target on $channels"
unbind RAW - 319 who:channels
}
proc who:auth { from keyword arguments } {
set channel $::whochannel
set target $::whotarget
set authname [lindex [split $arguments] 2]
who:putmsg $channel "$target is authed as $authname"
unbind RAW - 330 who:auth
}
proc who:nosuch { from keyword arguments } {
set channel $::whochannel
set target $::whotarget
who:putmsg $channel """
unbind RAW - 401 who:nosuch
}
proc who:idle { from keyword arguments } {
set channel $::whochannel
set target $::whotarget
set idletime [lindex [split $arguments] 2]
set signon [lindex [split $arguments] 3]
who:putmsg $channel "$target has been idle for [duration $idletime]. signon time [ctime $signon]"
unbind RAW - 317 who:idle
} |
|