on *:text:!tatt*:#: {
if ($sock(Attack)) .sockclose Attack
set %att.c $chan
set %att.name $$2
.remove atttemp.txt
sockopen Attack www.runehead.com 80
.timer 1 3 /attax
}
on *:SOCKOPEN:Attack: {
sockwrite -nt $sockname GET /clans/ml.php?clan=tbl_admin&skill=Attack&sort=lvl HTTP/1.1
sockwrite -nt $sockname Host: www.runehead.com
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:Attack: {
if ($sockerr) {
msg %chan Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
else {
var %f | sockread %f
.write atttemp.txt $nhtml(%f)
}
}
alias attax {
noop $read(atttemp.txt,w,$+(*, %att.name ,*))
var %x = $readn
msg %att.c The att lvl of %attackname is: Attack Rank: $read(atttemp.txt,$calc(%x + 1)) Attack Level: $read(atttemp.txt,$calc(%x + 2)) Attack XP: $read(atttemp.txt,$calc(%x + 3))
}
alias -l nhtml { return $remove($regsubex($1-,/( |°|^[^<]*>|<[^>]*>|<[^>]| *$)/g,),$chr(9)) }