rendered paste body#stats on
alias c1 { return $+(12,$1-) }
alias c2 { return $+(14,$1-) }
on *:TEXT:!setworld *:#: { { HALT } }
on *:text:*:#: {
tokenize 32 $strip($1-)
if ($left($1,1) !isin @!.) halt
if ($right($1,-1) == stats) var %style = astats
elseif ($ [ $+ [ $0 ] ] isnum) {
if ($3 == $null) { goto skipplz }
if ($setskill($remove($1,@,!,.)) == overall) { $iif($left($1,1) == @,msg $chan $c1($+(Sorry,$chr(44))) $c2($setskill($remove($1,@,!,.))) $c1(can't be used in this feature.),notice $nick $c1($+(Sorry,$chr(44))) $c2($setskill($remove($1,@,!,.))) $c1(can't be used in this feature.)) | halt }
if ($ [ $+ [ $0 ] ] isnum 0) { $iif($left($1,1) == @,msg $chan $c2(0) $c1(is not a real level.),notice $nick $c2(0) $c1(is not a real level.)) | halt }
if ($ [ $+ [ $0 ] ] isnum 1-150) {
var %style = tstat, %skill = $setskill($remove($1,@,!,.)) | set %stats.togo $ [ $+ [ $0 ] ] | goto skipmeplz
}
else { $iif($left($1,1) == @,msg $chan $c1(that is too high you can do up to) $c2(150) $+ $c1(.),notice $nick $c1(that is too high you can do up to) $c2(150) $+ $c1(.)) | halt }
}
:skipplz
elseif ($setskill($remove($1,@,!,.))) var %style = istat, %skill = $setskill($remove($1,@,!,.))
elseif ($regex($1,/co?mb(at)?/Si)) var %style = combat
:skipmeplz
elseif ($right($1,-1) == defname) && ($2) {
if ($2 == -h) {
writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($3-,$chr(32),-)
/notice $nick 13You're default RSN for the host1 $mask($fulladdress,3) 13has been set to1 $3-
}
else {
writeini DefRSN.ini RSNs $nick $replace($2-,$chr(32),-)
.notice $nick 13,1You're default RuneScape User for the nick1 $nick 13has been set to1 $2-
}
halt
}
else halt
inc %ID
if ($len($2-) > 12) {
if (%stats.togo) { var %tot = $calc($0 - 1), var %tot1 = $len($2-%tot) | $iif($len(%tot1) > 12,unset %stats.togo,goto displace) }
$($+(%,stats.display.,%ID),2) $c1(The nick) $c2($2-) $c1(is too long)
cleanup %ID
halt
}
:displace
if ($2) {
if (%stats.togo) {
var %s = $calc($0 - 1)
var %o = 1
while (%o < %s) {
inc %o 1
var %line = %line $ [ $+ [ %o ] ]
}
set $+(%,stats.rsn.,%ID) $replace(%line,$chr(32),-)
goto seekdap
}
else { set $+(%,stats.rsn.,%ID) $replace($2-,$chr(32),-) }
}
elseif ($readini(DefRSN.ini,RSNs,$mask($fulladdress,3))) set $+(%,stats.rsn.,%ID) $ifmatch
elseif ($readini(DefRSN.ini,RSNs,$nick)) set $+(%,stats.rsn.,%ID) $ifmatch
else set $+(%,stats.rsn.,%ID) $nick
:seekdap
set $+(%,stats.style.,%ID) %style
set $+(%,stats.skill.,%ID) %skill
set $+(%,stats.display.,%ID) $iif($left($1,1) == @,msg $chan,notice $nick)
sockopen $+(stats.,%ID) hiscore.runescape.com 80
}
on *:sockopen:stats.*: {
var %id = $gettok($sockname,2,46)
sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ $($+(%,stats.rsn.,%ID),2) HTTP/1.1
sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
}
on *:sockread:stats.*: {
sockread &Incoming
bwrite $sockname -1 -1 &Incoming
if ($bfind(&Incoming, 1, </html>).text) makehash $sockname
elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) {
$($+(%,stats.display.,%ID),2) 7The RuneScape User $c1($($+(%,stats.rsn.,%ID),2)) 13Does not feature in the hiscores
if (%stats.togo != $null) { unset %stats.togo }
cleanup $gettok($sockname,2,46)
}
}
alias -l makehash {
var %file = $1
bread %file 1 $file(%file).size &stats
var %currentstat, %x = 1
while (%x) {
var %x = $bfind(&stats,$calc(%x + 1),<a href="overall.ws?table=)
var %currentstat = $striptags($bvar(&stats,%x,200).text)
tokenize 10 %currentstat
hadd -m %file $1 $2 $3 $4 $xp2next($3,$4)
}
process %file
}
alias process {
var %table = $1, %id = $gettok($1,2,46), %x = 0, $&
%display = $($+(%,stats.display.,%ID),2), $&
%rsn = $($+(%,stats.rsn.,%ID),2), $&
%skill = $($+(%,stats.skill.,%ID),2), $&
%style = $($+(%,stats.style.,%ID),2)
if (%style == astats) {
while (%x <= 23) {
tokenize 32 $hget(%table,$setskill(%x))
if ($2) var %statline = %statline $c1($setskill(%x)) $c2($2)
inc %x
}
%display $c1(Stats for) $c2(%rsn) $+ $c1(:)
%display %statline
}
if (%style == tstat) {
if (!$hget(%table,%skill)) %display 12,14The RSN $c2(%rsn) $c1(skill not found for you )
else {
tokenize 32 $hget(%table,%skill)
%display $c1(1[) $c1(%rsn) $c1(1]) $c2(Target level for:) $c1(1[) $c1(%skill) $c1(1]) $c2(current level:) $c1(1[) $c1($2) $c1(1]) $c2(Current exp:) $c1(1[) $c1($3) $c1(1]) $c2(Exp to level $eval(%stats.togo) $+ :) $c1(1[) $c1($bytes($xp2t($eval(%stats.togo),$3),b)) $c1(1])
if (%skill == herblore) { %display $c1(pots to make till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(antiposion:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 37.5)))) $c1(prayer potion:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 87.5)))) $c1(Super att pot:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) $c1(Super str pot:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 125)))) $c1(Super stat restore pot:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 143)))) $c1(Super def pot:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 150)))) }
if (%skill == mining) { %display $c1(Ores to mine till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Iron:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 35)))) $c1(Coal:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 50)))) $c1(Gold:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 65)))) $c1(Mith:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 80)))) $c1(Addy:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 95)))) $c1(Runite:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 125)))) }
if (%skill == smithing) { %display $c1(Ores to smith till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Iron:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 25)))) $c1(Steel:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 37.5)))) $c1(Mith:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 50)))) $c1(Addy:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 62.5)))) $c1(Runite:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 75)))) }
if (%skill == smithing) { %display $c1(Ores to smith +smelt till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Iron:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 37.7)))) $c1(Steel:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 55)))) $c1(Mith:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 80)))) $c1(Addy:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) $c1(Runite:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 125)))) }
if (%skill == prayer) { %display $c1(1[) $c1(Bones to bury till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(1])
%display $c1(1[) $c1(Normal bones:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 4.5)))) $c1(1]) $c1(1|) $c1(1[) $c1(Gilded alter:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 15.75)))) $c1(1])
%display $c1(1[) $c1(Monkey bones:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 5)))) $c1(1]) $c1(1|) $c1(1[) $c1(Guilded alter:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 17.5)))) $c1(1])
%display $c1(1[) $c1(Big Bones:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 15)))) $c1(1]) $c1(1|) $c1(1[) $c1(Guilded alter:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 52.5)))) $c1(1])
%display $c1(1[) $c1(Baby Dragon Bones:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 30)))) $c1(1]) $c1(1|) $c1(1[) $c1(Guilded alter:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 105)))) $c1(1])
%display $c1(1[) $c1(Dragon Bones:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 72)))) $c1(1]) $c1(1|) $c1(1[) $c1(Guilded alter:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 252)))) $c1(1]) }
if (%skill == Woodcutting) { %display $c1(Logs to cut till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Normal:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 25)))) $c1(Oak:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 37.5)))) $c1(Willow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 67.5)))) $c1(Maple:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) $c1(Yew:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 175)))) $c1(Magic:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 250)))) }
if (%skill == Firemaking) { %display $c1(Logs to burn till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Normal:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 40)))) $c1(Oak:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 60)))) $c1(Willow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 90)))) $c1(Maple:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 135)))) $c1(Yew:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 202.5)))) $c1(Magic:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 303.75)))) }
if (%skill == Fishing) { %display $c1(Fish to catch till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Tuna:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 80)))) $c1(Lobster:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 90)))) $c1(Swordfish:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) $c1(Monkfish:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 120)))) $c1(Shark:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 110)))) }
if (%skill == cooking) { %display $c1(Fish to cook till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Tuna:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) $c1(Lobster:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 120)))) $c1(Swordfish:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 140)))) $c1(Monkfish:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 150)))) $c1(Shark:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 210)))) }
if (%skill == fletching) { %display $c1(Logs to Fletch till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Strung short willow bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 66.5)))) $c1(Strung long willow bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 83)))) $c1(Strung short yew bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 135)))) $c1(Strung long yew bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 150)))) $c1(Strung short magic bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 166.5)))) $c1(Strung long magic bow:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 183)))) }
if (%skill == Agility) { %display $c1(Brimhaven tickets till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(1:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 240)))) $c1(100:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 28000)))) $c1(1000:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 320000)))) $c1(barbarian course:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 153.2)))) $c1(ape atoll course:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 580)))) $c1(wilderniss course:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 571.5)))) }
if (%skill == thieving) { %display $c1(npc's to pickpocket till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(man:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 8)))) $c1(farmer:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 14.5)))) $c1(warrior:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 26)))) $c1(master farmer:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 43)))) $c1(guards:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 46.8)))) $c1(bandit:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 79.5)))) $c1(hero:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 273.3)))) }
if (%skill == crafting) { %display $c1(stuff to craft till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(1 green dhide:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 62)))) $c1(1 blue dhide:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 70)))) $c1(1 red dhide:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 78)))) $c1(1 black dhide:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 86)))) $c1(cut & craft diamond ammy:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 207.5)))) $c1(cut & craft dragonstone amulet:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 227.5)))) }
if (%skill == runecraft) { %display $c1(Runes to craft till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Cosmics:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 8)))) $c1(Chaos:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 8.5)))) $c1(Nature:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 9)))) $c1(Law:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 9.5)))) $c1(Death:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 10)))) }
if (%skill == Magic) { %display $c1(Spells to use till level) $c2($eval(%stats.togo)) $+ $c1(:) $c1(Superheat item:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 53)))) $c1(Camelot teleport:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 55.5)))) $c1(Ardounge teleport:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 61)))) $c1(High alch:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 65)))) $c1(teleblock:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 95)))) $c1(:) $c1(Teleother Camelot:) $iif($left($xp2t($eval(%stats.togo),$3),1) == -,0,$c2($int($calc($xp2t($eval(%stats.togo),$3) / 100)))) }
if (%stats.togo != $null) { unset %stats.togo }
}
if (%stats.togo != $null) { unset %stats.togo }
}
elseif (%style == istat) {
if (!$hget(%table,%skill)) %display $c2(The RSN) $c1(%rsn) $c2(Is too Nooby that it does not feature in the hiscores for) $c1(%skill)
else {
tokenize 32 $hget(%table,%skill)
%display $c1(1[) $c2(%rsn) $c1(1]) $c1(1|) $c1(1[) $c2(%skill) $c1(1]) $c1(1|) $c1(1[) $c1(stats) $c1(:) $c1(1])
%display $c1(1[) $c1(Rank:) $c2($1) $c1(1]) $c1(1|) $c1(1[) $c1(Level:) $c2($bytes($2,b)) $c1(1]) $c1(1|) $c1(1[) $c1(Exp:) $c2($3) $c1(1]) $&
$iif(%skill != Overall, $c1(Exp to lvl) $c2($calc($2 + 1)) $+ $c1(:) $c2($bytes($4,b)))
}
}
elseif (%style == combat) {
var %a.mult = .32707, %s.mult = .324, %d.mult = .25, %h.mult = .25, %p.mult = .124, %r.mult = .487, %m.mult = .487
var %a = $iif($gettok($hget(%table,attack),2,32),$v1,-), $&
%s = $iif($gettok($hget(%table,strength),2,32),$v1,-), $&
%d = $iif($gettok($hget(%table,defence),2,32),$v1,-), $&
%h = $iif($gettok($hget(%table,hitpoints),2,32),$v1,-), $&
%r = $iif($gettok($hget(%table,ranged),2,32),$v1,-), $&
%m = $iif($gettok($hget(%table,magic),2,32),$v1,-), $&
%p = $iif($gettok($hget(%table,prayer),2,32),$v1,-)
var %meleecombat = $calc(%a * %a.mult + %s * %s.mult + %d * %d.mult + %h * %h.mult + %p * %p.mult), $&
%RangedCombat = $calc(%r * %r.mult + %p * %p.mult + %d * %d.mult + %h * %h.mult), $&
%MagicCombat = $calc(%m * %m.mult + %p * %p.mult + %d * %d.mult + %h * %h.mult)
if (%MagicCombat > %RangedCombat) && (%MagicCombat > %MeleeCombat) var %cmbstyle = Magic, %Combat = %MagicCombat
elseif (%RangedCombat > %MeleeCombat) var %cmbstyle = Ranged, %Combat = %RangedCombat
else var %cmbstyle = melee, %combat = %MeleeCombat
var %cmb.temp = $abs($calc($int($calc(%combat +1)) - %combat)), $&
%a.2lvl = $ceil($calc(%cmb.temp / %a.mult)), %s.2lvl = $ceil($calc(%cmb.temp / %s.mult)), $&
%d.2lvl = $ceil($calc(%cmb.temp / %d.mult)), %m.2lvl = $ceil($calc(%cmb.temp / %m.mult)), $&
%r.2lvl = $ceil($calc(%cmb.temp / %r.mult)), %p.2lvl = $ceil($calc(%cmb.temp / %p.mult))
if (%cmbstyle == magic) var %dynamic.2lvl = $c2(Magic:) $c1(%m.2lvl)
elseif (%cmbstyle == Ranged) var %dynamic.2lvl = $c2(Ranged:) $c1(%r.2lvl)
else var %dynamic.2lvl = $c1(Att:) $c1(%a.2lvl) $c2(Str:) $c1(%s.2lvl)
var %combat = $round(%combat,2), %next = $ceil(%combat)
%display $c1(1[) $c1(%rsn) $c1(1]) $c2(is) $c1(1[) $c1(%combat) $c1(1]) $c2(combat style) $c1(1[) $c1(%cmbstyle) $c1(1])
%display $c1(1[) $c2(Attack:) $c1(%a) $c1(1]) $c1(1[) $c2(Defence:) $c1(%d) $c1(1]) $c1(1[) $c2(Strength:) $c1(%s) $c1(1]) $c1(1[) $c2(Hits:) $c1(%h) $c1(1]) $&
$c1(1[) $c2(Mage:) $c1(%m) $c1(1]) $c1(1[) $c2(Range:) $c1(%r) $c1(1]) $c1(1[) $c2(Pray:) $c1(%p) $c1(1])
%display $c2(For) $c1(1[) $c1(%next) $+ $c1(1 ] ) $c2(:) $c1(1[) %dynamic.2lvl $c1(1]) $&
$c1(1[) $c2(Def/Hp:) $c1(%d.2lvl) $c1(1]) $c1(1[) $c2(Prayer:) $c1(%p.2lvl) $c1(1])
}
cleanup %id
}
alias -l cleanup {
unset $+(%,stats.*.,$1)
sockclose $+(Stats.,$1)
.remove $+(Stats.,$1)
}
alias -l xp {
var %x = 1, %level = $calc($1 - 1), %xp = 0
while (%x <= %level) {
var %TempXp = $calc((%x + 300 * 2^(%x / 7)) /4)
inc %xp %TempXp
inc %x
}
return $int(%xp)
}
alias -l xp2Next {
var %xp = $remove($2,$chr(44)), %nextxp = $xp($calc($1 + 1))
return $calc(%nextxp - %xp)
}
alias -l xp2t {
var %xp = $remove($2,$chr(44)), %nextxp = $xp($1)
return $calc(%nextxp - %xp)
}
alias -l striptags { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
alias -l setskill {
if ($1 == 0) || ($regex($1,/^(st|(skill)?total|overall)$/Si)) return Overall
elseif ($1 == 1) || ($regex($1,/^a(t|tt|tk|ttack)$/Si)) return Attack
elseif ($1 == 2) || ($regex($1,/^def(en[cs]e)?$$/Si)) return Defence
elseif ($1 == 3) || ($regex($1,/^str(ength)?$/Si)) return Strength
elseif ($1 == 4) || ($regex($1,/^hp|hit(s|points?)?$/Si)) return Hitpoints
elseif ($1 == 5) || ($regex($1,/^range(r|d|ing)?$/Si)) return Ranged
elseif ($1 == 6) || ($regex($1,/^Pray(er)?$$/Si)) return Prayer
elseif ($1 == 7) || ($regex($1,/^mag(e|ic)$$/Si)) return Magic
elseif ($1 == 8) || ($regex($1,/^cook(ing)?$/Si)) return Cooking
elseif ($1 == 9) || ($regex($1,/^wc|wood(cut(ting)?)?$/Si)) return Woodcutting
elseif ($1 == 10) || ($regex($1,/^fletch(ing)?$/Si)) return Fletching
elseif ($1 == 11) || ($regex($1,/^fish(ing)?$/Si)) return Fishing
elseif ($1 == 12) || ($regex($1,/^(fire|fm)(make?(ing)?|ing)?$/Si)) return Firemaking
elseif ($1 == 13) || ($regex($1,/^craft(ing)?$/Si)) return Crafting
elseif ($1 == 14) || ($regex($1,/^(smith|smelt)(ing)?$/Si)) return Smithing
elseif ($1 == 15) || ($regex($1,/^min(e|ing)?$/Si)) return Mining
elseif ($1 == 16) || ($regex($1,/^herb(law|lore)?$/Si)) return Herblore
elseif ($1 == 17) || ($regex($1,/^agil(ity)?$/Si)) return Agility
elseif ($1 == 18) || ($regex($1,/^(th(ei|ie)[fv](e|ing)?)$/Si)) return Thieving
elseif ($1 == 19) || ($regex($1,/^slay(er|ing)?$/Si)) return Slayer
elseif ($1 == 20) || ($regex($1,/^farm(er|ing)?$/Si)) return Farming
elseif ($1 == 21) || ($regex($1,/^(rc|runecraft)(er|ing)?$/Si)) return Runecraft
elseif ($1 == 22) || ($regex($1,/^poh|con(struct[ion]|ing)?$/Si)) return Construction
elseif ($1 == 23) || ($regex($1,/^hunt(er|ing)?$/Si)) return Hunter
}
alias statsclear { unset %printline1 | unset %stats.* }
alias stat_check {
if (%printline1 != $null) {
if (%stats.Overall.level == $null) { set %stats.Overall.level N/A }
if (%stats.color.strip == on) { %stats.send %stats.text %stat.name - Skill Total: %stats.Overall.level %cmb.printline | %stats.send $strip(%printline1,cb) | statsclear | halt }
if (%stats.color.strip == $null) { %stats.send %stat.color1 $+ %stats.text $+ %stat.color2 %stat.name %stat.color1 $+ - Skill Total: $+ %stat.color2 %stats.Overall.level | %stats.send %printline1 | statsclear | halt }
}
else { %stats.send %stat.color1 $+ This person doesnt appear on the hiscores for any skill currently listed on the hiscores. | statsclear | halt }
}
on $*:text:/^[!@.](stats) .{1,13}$/Si:#:{
if ($sock(stats).status != $null) { notice $nick The stats script is currently in use. Try again.... now! | halt }
if ($left($1,1) == @) && ($left($remove($chan(#).mode,+),1) == c) || ($left($remove($chan(#).mode,+),2) == c) { set %stats.color.strip on }
set %stats.nick $nick | set %stats.send $iif($left($1,1) == @,msg $chan,notice $nick) | set %stats.name $replace($2-,$chr(32),+) | set %stat.color1 $chr(3) $+ 14 | set %stat.color2 $chr(3) $+ 4
sockopen stats vulcan.ueuo.com 80
}
on *:sockopen:stats:{
sockwrite -nt $sockname GET /geniestats.php?rsname= $+ %stats.name HTTP/1.0
sockwrite -nt $sockname Host: vulcan.ueuo.com $+ $crlf $+ $crlf
}
on *:sockread:stats:{
if ($sockerr > 0) { .notice %stat.called.nick Error: Try again later. | halt }
var %read | sockread %read
if (<b>Personal isin %read) { set %stat.name $remove(%read,Personal $+ $chr(32),Scores $+ $chr(32),For $+ $chr(32),<b>,</b>) | set %stats.text $remove(%read,<b>,</b>) | set %stats.text $left(%stats.text,- $+ $len(%stat.name)) }
tokenize 124 $remove(%read,Genie:)
if ($0 == 4) { set %printline1 %printline1 $eval($+(%stat.color1,$1,:,%stat.color2),2) $3 | set %stats. $+ $1 $+ .level $3 }
}
on *:sockclose:stats:{ stat_check }
#stats off