The display used echo -a , that is echo the active window...
Added a var %untarget that keeps the channel or query window where it was typed.
Used /sockmark to tell when the headers are gone (empty line)
on *:text:!sabdetails*:*: {
set %un $2
set %untarget $target
sockopen bot 192.168.1.2 6080
}
alias bot sockopen bot 192.168.1.2 6080
on *:sockopen:bot: {
sockwrite -n bot GET /s3h/getdetails.php?name= $+ %un HTTP/1.1
sockwrite -n bot Host: 192.168.1.2
sockwrite -n bot User-Agent: Omg dont block this T_T I love you!!!! :P
sockwrite -n bot $str($crlf,2)
}
on 1:sockread:bot: {
if ($sockerr > 0) return
sockread %bot
while (($sockbr) && (!$sockerr)) {
if ($sock($sockname).mark) echo %untarget $iif(%bot != $null,%bot,-)
elseif (%bot == $null) sockmark $sockname 1
sockread %bot
}
}