#--------------------------------------------------------------------- # whoisbot.tcl # TCL script for IRC-bot eggdrop # By default, eggdrop does not recognise itself on # "/msg botnick whois botnick". # This script provides some bot info upon such request. # Bind of type MSG is non-stackable. Loading this script overwrites # previous bindings of "bind msg - whois" and restores default # behaviour. # v0: 07-Feb-2002 # todo: add flagcheck for binding? #--------------------------------------------------------------------- # new binding (destroys previous msg:whois binding) bind msg - whois whoisbot proc whoisbot { nick uhost hand text } { global botnick uptime # skip if unknown handle if {[string compare $hand "*"] == 0} { return 1 } # check if query doesn't exist if {![validuser $text]} { # ... and check query $text == $botnick # make case insensitive set ttl [string tolower $text] set btl [string tolower $botnick] # compare... if {[string compare $ttl $btl] == 0} { set bot "\[$text\]" puthelp "NOTICE $nick :$bot <- It's me!" puthelp "NOTICE $nick :$bot Monitoring [channels]" puthelp "NOTICE $nick :$bot Up since [ctime $uptime]" # don't process any further, get it logged return 1 } } # all other cases: default binding *msg:whois $nick $uhost $hand $text }