#--------------------------------------------------------------------- # ison.tcl # TCL script for IRC bot eggdrop # # usage: /msg bot ison nick # # v0: 19-Sep-2002 #--------------------------------------------------------------------- package require eggdrop 1.6 package require Tcl 8.0 #--------------------------------------------------------------------- # message trigger for ison #--------------------------------------------------------------------- bind msg m|m ison ison:msgtrigger proc ison:msgtrigger { nick uhost hand targ } { # scan for a target nick, maximum 32 characters # if no nick is given, set it to the requesters nick if { [scan $targ "%32s" targ] != 1} { set targ $nick } # send an ISON request to the IRC server putlog "Sending ISON request for $targ to server" putserv "ISON $nick $targ" # log the ison request return 1 } #--------------------------------------------------------------------- # Putlog RAW reply 303 and 461 by the server #--------------------------------------------------------------------- bind RAW - 303 ison:raw bind RAW - 461 ison:raw proc ison:raw { server keyword arg } { # For debugging purposes. putlog "RAW $keyword: $server, $arg" # scan out the botnick, nick of requester and other response. if {[scan $arg "%s :%s %\[^\n\]" bot nick response] != 3 } { putlog "Empty or invalid ISON response" return } puthelp "PRIVMSG $nick :ISON $response" } putlog "Loaded (version 0): demo ISON script."