it will only post the map type or Players not both. I tried this on mirc 6.16 and 6.35
on *:text:*cb1*:#: {
if $1 == !cb1 {
set %searchply $2
sockopen cb1 www.game-monitor.mobi 80
set %cbchan $chan
}
}
on *:sockopen:cb1: {
sockwrite -n $sockname GET /GameServer/39272051/ HTTP/1.1
sockwrite -n $sockname Host: www.game-monitor.mobi
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
}
on *:sockread:cb1: {
sockread %temp
if (Players: isin %temp) { set %Players $nohtml(%temp) }
if (Map: isin %temp) { set %map $nohtml(%temp) | msg %cbchan %Players %map | $clrst | sockclose cb1 }
}
alias nohtml { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | var %x = $replace(%x, ,$chr(32),°,$chr(176),°,$chr(176)) | return %x }
alias clrst {
unset %cbchan
unset %temp
unset %players
unset %map
unset %searchply
}
next time use the forum to get help.
no real point in the set %searchply $2 part cuz you only have it looking up CrazyBob's Cops And Robbers
on $*:text:/^!cb1$/iS:#: {
if ($sock(cb1)) sockclose cb1
sockopen cb1 www.game-monitor.mobi 80
sockmark cb1 #
}
on *:sockopen:cb1: {
sockwrite -nt $sockname GET /GameServer/39272051/ HTTP/1.1
sockwrite -nt $sockname Host: $+(www.game-monitor.mobi,$str($crlf,2))
}
on *:sockread:cb1: {
var %cb1 | sockread %cb1
if ($regex(%cb1,/<b>(Players:)<\/b><br\/>(.+)<br\/>/)) { sockmark cb1 $sock(cb1).mark $+($regml(1),$regml(2)) }
if ($regex(%cb1,/<b>(Map:)<\/b><br\/><a href=".+">(.+)<\/a><br\/>/)) { msg $sock(cb1).mark $+($regml(1),$regml(2)) | sockclose cb1 }
}
Your snippet will be deleted if you break any of the following rules: