on *:sockread:warning:{
while ($sock($sockname).rq) {
sockread 4096 &var
if ($sockbr > 2) {
bset -t &source $calc(1 + $hget(warning, source, &source)) $remove($bvar(&var, 1-).text, $cr, $lf)
hadd -mb warning source &source
}
}
}
alias warning {
if ($hget(warning, source, &var)) {
var %pos = 1, %n = 1, %time, %reason
while ($bfind(&var, %pos, ago</td><td)) {
var %pos = $v1 - 2, %length = 4
while ($bvar(&var, %pos) != 62) {
dec %pos
inc %length
}
%time = $bvar(&var, $calc(1 + %pos), %length).text
%pos = $bfind(&var, %pos, "top">) + 6
%reason = $bvar(&var, $+(%pos, -, $calc($bfind(&var, %pos, </td>) - 1))).text
echo -ag ( $+ %n $+ ) Warning issued %time for reason $qt(%reason)
inc %n
}
hfree warning
}
else echo -eagc i * /warning: no source to examine
}