#--------------------------------------------------------------------- # why.tcl # Tcl script for IRC bot Eggdrop # # Upon a +o mode by chanserv (dal.net) this script sends out a # WHY to chanserv and put the result in the file WHY.txt # # v0: 07-JUN-2004 #--------------------------------------------------------------------- package require Tcl 8.0 bind mode - * mode:why bind notc - * notc:why proc mode:why { nick uhost hand chan mchange victim } { # check mode change if { $mchange != "+o" } { return 0 } # check nick and uhost opper is chanserv if { $nick != "ChanServ" } { return 0 } if { $uhost != "service@dal.net" } { return 0 } # send a "why" message to chanserv set chanserv chanserv@services.dal.net puthelp "PRIVMSG $chanserv :WHY $chan $victim" } proc notc:why { nick uhost hand text dest} { global botnick # destination must be the bot if { $dest != $botnick } { return 0 } # check nick and uhost is chanserv if { $nick != "ChanServ" } { return 0 } if { $uhost != "service@dal.net" } { return 0 } # a WHY result? set matchrule {* has * access to *} if { ![string match $matchrule $text] } { return 0 } # save the why result to fule set cformat {%d-%b-%Y-%H:%M} set stamp [clock format [clock seconds] -format $cformat] set fd [open WHY.txt a+] puts $fd "$stamp $text" close $fd } putlog "Loaded (version 0): why.tcl"