alias col1 { return $+( $1-,4[4 ]) } alias col2 { return $+( $1-,4[4 ]) } on $*:TEXT:/^[!@.]clan */Si:#:{ if (!$2) { notice $nick 4*** [ $+ $col1(Clan)]: $col2(You must supply a name) halt } else { set %clan.name $replace($2- ,$chr(32),+) set %clan.style $iif($left($1,1) == @,msg $chan,.notice $nick) sockopen clan.socket runehead.com 80 } } on *:SOCKOPEN:clan.socket:{ sockwrite -n $sockname GET /clans/search.php?search= $+ %clan.name $+ &searchtype=exact sockwrite -n $sockname Host: $+(www.runehead.com,$crlf,$crlf) } on *:SOCKREAD:clan.socket:{ if ($sockerr) { %clan.style 4*** [ $+ $col1(Clan)]: $col2(Error while connecting) sockclose $sockname halt } else { var %tmp sockread %tmp if $regex(results,%tmp,/

No results were found for the exact search (.*)The exact<\/b> search (.*)<\/b> returned (\d+)/) { %clan.style 4*** [ $+ $col1(Clan)]: $col2($regml(results,2)) $col1(result(s) were found for) $col2(%clan.name) } if $regex(clan,%tmp,/(.*)/) { %clan.style 4*** [ $+ $col1(Clan)]: $col2(%clan.name) $col1(is in the clan:) $col2($regml(clan,2)) $col1( Clan highscores : $col2($+(http://runehead.com/clans/,$regml(clan,1))) $+ $col1()) } if iswm %tmp { sockclose $sockname } } } on *:SOCKCLOSE:clan.*:{ unset %clan.* halt }