proc lastspoke {nick uhost hand chan args} {
global bs botnick bs_botidle
set chan [string tolower $chan] ; if {[bs_flood $nick $uhost] || [lsearch -exact $bs(no_pub) $chan] >= 0 || ($bs(log_only) != "" && [lsearch -exact $bs(log_only) $chan] == -1)} {return 0}
if {[lsearch -exact $bs(quiet_chan) $chan] >= 0} {set target "notice $nick"} {set target "privmsg $chan"}
set data [lindex [bs_filt [join $args]] 0]
set ldata [string tolower $data]
if {[string match *\** $data]} {
set chanlist [string tolower [chanlist $chan]]
if {[lsearch -glob $chanlist $ldata] > -1} {set data [lindex [chanlist $chan] [lsearch -glob $chanlist $ldata]]}
}
if {[onchan $data $chan]} {
if {$ldata == [string tolower $botnick]} {puthelp "$target :$nick, must you waste my time?" ; return 1}
set time [getchanidle $data $chan] ; set bottime [expr ([unixtime] - $bs_botidle($chan))/60]
if {$time < $bottime} {
if {$time > 0} {set diftime [bs_when [expr [unixtime] - $time*60 -15]]} {set diftime "mai putin de un minut"}
puthelp "$target :3$data 7a dat ultimul semn de viata pe 12$chan 7acum 4 $diftime ."
} {
set diftime [bs_when $bs_botidle($chan)]
puthelp "$target :3$data 7nu a mai dat nici un semn de viata de cand am intrat eu pe 12$chan 7acum 4 $diftime ."
}
}
return 1
}