When ever the mirc radio bot announces the song playing and the ammount of listeners a stray html and body tag show up as seen below.
The code for the radio bot is as follows
#announcer on
ctcp *:*:*:{
if ($1 == SRstats) {
set %sctat.chan $chan
sockclose scstat
sockopen scstat 149.202.90.221 8132
}
}
on *:SOCKOPEN:scstat:{
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname $crlf
}
on *:sockread:scstat:{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $remove(%scasttemp,<html><head><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html>)
if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) {
set %scstat.song.temp $gettok(%scasttemp,7-,44)
set %scstat.bitrate $gettok(%scasttemp,6,44)
set %scstat.listeners $gettok(%scasttemp,1,44)
set %scstat.maxlist $gettok(%scasttemp,4,44)
set %scstat.peak $gettok(%scasttemp,3,44)
if ($gettok(%scasttemp,2,44) == 1) set %scstat.livedj connected
else set %scstat.livedj not connected
; changing some of the html codes back to regular characters
set %scast.song $replace(%scast.song,&,$chr(38),',$chr(39))
}
goto nextread
}
on *:sockclose:scstat:{
if (( %scstat.song.temp == %scstat.song ) || ( %scstat.song.temp == Line Recording )) { goto scstat.end }
else {
set %scstat.song %scstat.song.temp
set %song.msg 6,0 $+ %dj_nick is playing 6 : 12 %scstat.song $+ . 0,1 Tune into Radio-Airwaves, type !radiohelp/4 %scstat.listeners $+ --listeners are tuned in.
; set %chans $chan(0)
; while %chans {
/scid -a msg #Radio-Airwaves-Lounge %song.msg
; dec %chans
; }
:scstat.end
}
}
on *:TEXT:!playing:#: msg $chan %song.msg
#announcer end
I thought the first fix should be changing the , between the body tags to html number code but that just displayed the number code and not the actually comma. I also maybe there were mismatched tags/stray tags so I check for that. I didn't find any. I've yet to see the cause of the stray tags appearing when the accouner is on. Any help would be greatly appericated.