Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on $*:TEXT:/^[!@]tribalwars/Si:#:{
- if (!$2) { notice $nick Usage: $1 <name> | halt }
- while ($sock(tribal. $+ %x)) {
- inc %x
- }
- sockopen $+(tribal.,%x) www.us.twstats.com 80
- sockmark $+(tribal.,%x) $+($iif($left($1,1) == !,notice $nick,msg $chan),~,$urlencode($2-))
- }
- on *:SOCKOPEN:tribal.*:{
- sockwrite -n $sockname GET $+(/index.php?page=search&type=player&name=index.php&page=search&name=,$gettok($sock($sockname).mark,2,126)) HTTP/1.1
- sockwrite -n $sockname Host: www.us.twstats.com
- sockwrite -n $sockname $crlf
- }
- on *:SOCKREAD:tribal.*:{
- var %return = $gettok($sock($sockname).mark,1,126)
- var %search = $gettok($sock($sockname).mark,2,126)
- if ($sockerr) { %return Socket error $+ $chr(44)) please try again | sockclose $sockname | halt }
- else {
- sockread &t
- var %pos $bfind(&t,1,<td><span class="world">)
- var %pos2 $bfind(&t,%pos,</table>)
- var %pos3 $bfind(&t,1,</html>)
- if ($bfind(&t,1,does not currently play on any worlds)) {
- %return %search does not currently play on any worlds
- sockclose $sockname
- halt
- }
- if (%pos2) {
- var %sockreader $remove($bvar(&t,$+(%pos,-,$calc(%pos2 + 1))).text,$cr,$lf,$crlf,$chr(9))
- var %world $remove($gettok(%sockreader,2,$asc(<)),span class="world">)
- var %rank $remove($gettok(%sockreader,5,$asc(<)),td>)
- var %plink $gettok(%sockreader,4,$asc("))
- var %player $gettok($gettok(%sockreader,8,$asc(<)),2,$asc(>))
- var %points $remove($gettok(%sockreader,11,$asc(<)),td>)
- var %villages $remove($gettok(%sockreader,13,$asc(<)),td>)
- var %tribe $gettok($gettok(%sockreader,16,$asc(<)),2,$asc(>))
- var %tlink $gettok(%sockreader,6,$asc("))
- %return Your search: %player Is on %world || Ranked %rank || With %points points || And %villages villages. || They are a part of the %tribe Tribe. ||
- sockclose $sockname
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement