From: Ian Jackson Date: Thu, 14 Dec 2000 16:35:14 +0000 (+0000) Subject: Dies if doesn't get a ping. Configs separated. X-Git-Tag: branchpoint-2001-10-09-tell~46 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/ircbot/commitdiff_plain/e58e51a8fbebf6014a4e9d349718f992e1c50591 Dies if doesn't get a ping. Configs separated. --- diff --git a/blight.tcl b/blight.tcl new file mode 100644 index 0000000..4825da3 --- /dev/null +++ b/blight.tcl @@ -0,0 +1,8 @@ +# Configuration for Blight + +set host chiark +set nick Blight +set ownfullname "here to Help" +set ownmailaddr blight@chiark.greenend.org.uk + +source bot.tcl diff --git a/bot.tcl b/bot.tcl index 55d93c7..5d19dd0 100755 --- a/bot.tcl +++ b/bot.tcl @@ -1,16 +1,22 @@ -#!/usr/bin/tclsh8.2 +# Core bot code -set host chiark -set port 6667 -if {![info exists nick]} { set nick Blight } -if {![info exists ownfullname]} { set ownfullname "here to Help" } -set ownmailaddr blight@chiark.greenend.org.uk +proc defset {varname val} { + upvar #0 $varname var + if {![info exists var]} { set var $val } +} + +# must set host +defset port 6667 + +defset nick testbot +defset ownfullname "testing bot" +defset ownmailaddr test-irc-bot@example.com -set musthaveping_ms 10000 -set out_maxburst 6 -set out_interval 2100 -set out_lag_lag 5000 -set out_lag_very 25000 +defset musthaveping_ms 10000 +defset out_maxburst 6 +defset out_interval 2100 +defset out_lag_lag 5000 +defset out_lag_very 25000 proc manyset {list args} { foreach val $list var $args { @@ -232,7 +238,10 @@ proc msg_PING {p c s1} { global musthaveping_after prefix_none sendout PONG $s1 - if {[info exists musthaveping_after]} { after cancel $musthaveping_after] } + if {[info exists musthaveping_after]} { + after cancel $musthaveping_after + unset musthaveping_after + } } proc check_nick {n} { @@ -1234,7 +1243,3 @@ ensure_globalsecret ensure_outqueue loadhelp ensure_connecting - -#if {![regexp {tclsh} $argv0]} { -# vwait terminate -#} diff --git a/test.tcl b/test.tcl index d54d29e..4db2648 100644 --- a/test.tcl +++ b/test.tcl @@ -1,2 +1,7 @@ +# Configuration for testbot + +set host chiark set nick testbot set ownfullname confused + +source bot.tcl