From: Ian Jackson Date: Mon, 23 Jul 2001 16:03:00 +0000 (+0000) Subject: When someone leaves a channel and they say why, remember it. Cope if uptime says... X-Git-Tag: branchpoint-2001-10-09-tell~3 X-Git-Url: https://git.distorted.org.uk/~mdw/ircbot/commitdiff_plain/ea8a1bfeb282aa18e6ac1d2eb0cc542d2929255b?hp=6526ba5254a15e4f97f75021e947316d19bb6190 When someone leaves a channel and they say why, remember it. Cope if uptime says user instead of users. --- diff --git a/bot.tcl b/bot.tcl index 1119fbf..e021af7 100755 --- a/bot.tcl +++ b/bot.tcl @@ -422,9 +422,14 @@ proc msg_JOIN {p c chan} { lappend nlist $nl nick_ishere $n } -proc msg_PART {p c chan} { +proc msg_PART {p c chan args} { prefix_nick - recordlastseen_n $n "leaving $chan" 1 + set msg "leaving $chan" + if {[llength $args]} { + set why [lindex $args 0] + if {"[irctolower $why]" != "[irctolower $n]"} { append msg " ($why)" } + } + recordlastseen_n $n $msg 1 process_kickpart $chan $n } proc msg_QUIT {p c why} { @@ -1279,7 +1284,7 @@ proc lnick_pingstring {why oc apstring} { catch { exec uptime } uptime set nnicks [llength [array names nick_onchans]] if {[regexp \ - {^ *([0-9:apm]+) +up.*, +(\d+) users, +load average: +([0-9., ]+) *$} \ + {^ *([0-9:apm]+) +up.*, +(\d+) users?, +load average: +([0-9., ]+) *$} \ $uptime dummy time users load]} { regsub -all , $load {} load set uptime "$time $nnicks/$users $load"