/sockopen hpcomp runescape.com 80
on *:sockopen:hpcomp:{
sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ %user HTTP/1.0
sockwrite -n $sockname Host: runescape.com $+ $crlf $+ $crlf
}
on *:sockread:hpcomp:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
echo 5 -s > %temptext
if <span class="small text">Hitpoint stats: Starting Level: * , Current Level: * , Difference: *{
echo -a -
echo -a $htmlfree(%temptext)
}
}
}
alias -l htmlfree {
; It's local because it won't be used by the command line, only this file.
; Local aliases avoid conflicting names.
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}
alias hpcomp {
if ($2-) {
set %user $2
; Variables to be used in the future URL are being set here!
sockopen hpcomp runescape.com 80
}
else {
echo -a You didn't specify a user and the info.
}
}