; ############################################################ ; Stats Lookup ; ############################################################ alias c1 { return $+(12 $1-,) } alias c2 { return $+(4 $1-,) } on *:TEXT:!stats*:#: { if ($1- == *#*) || ($1- == *@*) { halt } if ($chan == #idle) { halt } tokenize 32 $strip($1-) if ($right($1,-1) == stats) var %style = astats inc %ID if ($len($2-) > 12) { /notice $nick $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) 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 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 *:TEXT:@stats*:#: { if ($1- == *#*) || ($1- == *@*) { halt } if ($chan == #idle) { halt } tokenize 32 $strip($1-) if ($right($1,-1) == stats) var %style = astats inc %ID if ($len($2-) > 12) { /notice $nick $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) 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 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 *:TEXT:!defname*:#: { if ($2- == $chr(36) $+ ip) || ($2- == $chr(36) $+ readini) || ($3- == $chr(36) $+ ip) || ($4- == $chr(36) $+ ip) || ($5- == $chr(36) $+ ip) || ($6- == $chr(36) $+ ip) { notice $nick Invalid Characters! | halt } if ($len($2-) > 12) { notice $nick Name too long | halt } writeini DefRSN.ini RSNs $mask($fulladdress,3) $2- notice $nick Your default RSN for the host $mask($fulladdress,3) has been set to $2- } on *:TEXT:!combat*:#: { if ($chan == #idle) { halt } tokenize 32 $strip($1-) var %style = combat inc %ID if ($len($2-) > 12) { /notice $nick $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) 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 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 *:TEXT:!cmb*:#: { if ($chan == #idle) { halt } tokenize 32 $strip($1-) var %style = combat inc %ID if ($len($2-) > 12) { /notice $nick $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) 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 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 *:TEXT:@cmb*:#: { if ($chan == #idle) { halt } tokenize 32 $strip($1-) var %style = combat inc %ID if ($len($2-) > 12) { /notice $nick $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) 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 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 $*:TEXT:/^[!@.](attack|att)/Si:#: { if ($1 == !attack) { set %type !attack } if ($1 == $chr(64) $+ attack) { set %type $chr(64) $+ attack } if ($1 == !att) { set %type !attack } if ($1 == $chr(64) $+ att) { set %type $chr(64) $+ attack } set %skill2 Attack set %name $2 $common } on $*:TEXT:/^[!@.](strength|str)/Si:#: { if ($1 == !strength) { set %type !strength } if ($1 == $chr(64) $+ strength) { set %type $chr(64) $+ strength } if ($1 == !str) { set %type !strength } if ($1 == $chr(64) $+ str) { set %type $chr(64) $+ strength } set %skill2 Strength set %name $2 $common } on $*:TEXT:/^[!@.](defence|def)/Si:#: { if ($1 == !defence) { set %type !defence } if ($1 == $chr(64) $+ defence) { set %type $chr(64) $+ defence } if ($1 == !def) { set %type !defence } if ($1 == $chr(64) $+ def) { set %type $chr(64) $+ defence } set %skill2 Defence set %name $2 $common } on $*:TEXT:/^[!@.](ranged|range)/Si:#: { if ($1 == !range) { set %type !range } if ($1 == $chr(64) $+ range) { set %type $chr(64) $+ ranged } if ($1 == !range) { set %type !range } if ($1 == $chr(64) $+ ranged) { set %type $chr(64) $+ ranged } set %skill2 Ranged set %name $2 $common } on $*:TEXT:/^[!@.](hp|hitpoints|hits)/Si:#: { if ($1 == !hitpoints) { set %type !hitpoints } if ($1 == $chr(64) $+ hitpoints) { set %type $chr(64) $+ hitpoints } if ($1 == !hp) { set %type !hitpoints } if ($1 == $chr(64) $+ hp) { set %type $chr(64) $+ hitpoints } if ($1 == !hits) { set %type !hitpoints } if ($1 == $chr(64) $+ hits) { set %type $chr(64) $+ hitpoints } set %skill2 Hitpoints set %name $2 $common } on $*:TEXT:/^[!@.](pray|prayer)/Si:#: { if ($1 == !prayer) { set %type !prayer } if ($1 == $chr(64) $+ prayer) { set %type $chr(64) $+ prayer } if ($1 == !pray) { set %type !prayer } if ($1 == $chr(64) $+ pray) { set %type $chr(64) $+ prayer } set %skill2 Prayer set %name $2 $common } on $*:TEXT:/^[!@.](mage|magic)/Si:#: { if ($1 == !magic) { set %type !magic } if ($1 == $chr(64) $+ magic) { set %type $chr(64) $+ magic } if ($1 == !mage) { set %type !magic } if ($1 == $chr(64) $+ mage) { set %type $chr(64) $+ magic } set %skill2 Magic set %name $2 $common } on $*:TEXT:/^[!@.](cook|cooking)/Si:#: { if ($1 == !cooking) { set %type !cooking } if ($1 == $chr(64) $+ cooking) { set %type $chr(64) $+ cooking } if ($1 == !cook) { set %type !cooking } if ($1 == $chr(64) $+ cook) { set %type $chr(64) $+ cooking } set %skill2 Cooking set %name $2 $common } on $*:TEXT:/^[!@.](wc|woodcutting)/Si:#: { if ($1 == !woodcutting) { set %type !woodcutting } if ($1 == $chr(64) $+ woodcutting) { set %type $chr(64) $+ woodcutting } if ($1 == !wc) { set %type !woodcutting } if ($1 == $chr(64) $+ wc) { set %type $chr(64) $+ woodcutting } set %skill2 Woodcutting set %name $2 $common } on $*:TEXT:/^[!@.](fletch|fletching)/Si:#: { if ($1 == !fletching) { set %type !fletching } if ($1 == $chr(64) $+ fletching) { set %type $chr(64) $+ fletching } if ($1 == !fletch) { set %type !fletching } if ($1 == $chr(64) $+ fletch) { set %type $chr(64) $+ fletching } set %skill2 Fletching set %name $2 $common } on $*:TEXT:/^[!@.](fish|fishing)/Si:#: { if ($1 == !fishing) { set %type !fishing } if ($1 == $chr(64) $+ fishing) { set %type $chr(64) $+ fishing } if ($1 == !fish) { set %type !fishing } if ($1 == $chr(64) $+ fish) { set %type $chr(64) $+ fishing } set %skill2 Fishing set %name $2 $common } on $*:TEXT:/^[!@.](fm|firemaking)/Si:#: { if ($1 == !firemaking) { set %type !firemaking } if ($1 == $chr(64) $+ firemaking) { set %type $chr(64) $+ firemaking } if ($1 == !fm) { set %type !firemaking } if ($1 == $chr(64) $+ fm) { set %type $chr(64) $+ firemaking } set %skill2 Firemaking set %name $2 $common } on $*:TEXT:/^[!@.](craft|crafting)/Si:#: { if ($1 == !crafting) { set %type !crafting } if ($1 == $chr(64) $+ crafting) { set %type $chr(64) $+ crafting } if ($1 == !craft) { set %type !crafting } if ($1 == $chr(64) $+ craft) { set %type $chr(64) $+ crafting } set %skill2 Crafting set %name $2 $common } on $*:TEXT:/^[!@.](smith|smithing)/Si:#: { if ($1 == !smithing) { set %type !smithing } if ($1 == $chr(64) $+ smithing) { set %type $chr(64) $+ smithing } if ($1 == !smith) { set %type !smithing } if ($1 == $chr(64) $+ smith) { set %type $chr(64) $+ smithing } set %skill2 Smithing set %name $2 $common } on $*:TEXT:/^[!@.](mine|mining)/Si:#: { if ($1 == !mining) { set %type !mining } if ($1 == $chr(64) $+ mining) { set %type $chr(64) $+ mining } if ($1 == !mine) { set %type !mining } if ($1 == $chr(64) $+ mine) { set %type $chr(64) $+ mining } set %skill2 Mining set %name $2 $common } on $*:TEXT:/^[!@.](herb|herblore)/Si:#: { if ($1 == !herblore) { set %type !herblore } if ($1 == $chr(64) $+ herblore) { set %type $chr(64) $+ herblore } if ($1 == !herb) { set %type !herblore } if ($1 == $chr(64) $+ herb) { set %type $chr(64) $+ herblore } set %skill2 Herblore set %name $2 $common } on $*:TEXT:/^[!@.](agility)/Si:#: { if ($1 == !agility) { set %type !agility } if ($1 == $chr(64) $+ agility) { set %type $chr(64) $+ agility } set %skill2 Agility set %name $2 $common } on $*:TEXT:/^[!@.](thieving)/Si:#: { if ($1 == !thieving) { set %type !thieving } if ($1 == $chr(64) $+ thieving) { set %type $chr(64) $+ thieving } set %skill2 Thieving set %name $2 $common } on $*:TEXT:/^[!@.](slayer|slay)/Si:#: { if ($1 == !slayer) { set %type !slayer } if ($1 == $chr(64) $+ slayer) { set %type $chr(64) $+ slayer } if ($1 == !slay) { set %type !slayer } if ($1 == $chr(64) $+ slay) { set %type $chr(64) $+ slayer } set %skill2 Slayer set %name $2 $common } on $*:TEXT:/^[!@.](farming|farm)/Si:#: { if ($1 == !farmin) { set %type !farmin } if ($1 == $chr(64) $+ farmin) { set %type $chr(64) $+ farmin } if ($1 == !farm) { set %type !farmin } if ($1 == $chr(64) $+ farm) { set %type $chr(64) $+ farmin } set %skill2 Farming set %name $2 $common } on $*:TEXT:/^[!@.](rc|runecraft|runecrafting)/Si:#: { if ($1 == !runecrafting) { set %type !runecrafting } if ($1 == $chr(64) $+ runecrafting) { set %type $chr(64) $+ runecrafting } if ($1 == !runecraft) { set %type runecrafting } if ($1 == $chr(64) $+ runecraft) { set %type $chr(64) $+ runecrafting } if ($1 == !rc) { set %type runecrafting } if ($1 == $chr(64) $+ rc) { set %type $chr(64) $+ runecrafting } set %skill2 Runecraft set %name $2 $common } on $*:TEXT:/^[!@.](construction|cs|cons)/Si:#: { if ($1 == !construction) { set %type !construction } if ($1 == $chr(64) $+ construction) { set %type $chr(64) $+ construction } if ($1 == !cons) { set %type construction } if ($1 == $chr(64) $+ cons) { set %type $chr(64) $+ construction } if ($1 == !cs) { set %type construction } if ($1 == $chr(64) $+ cs) { set %type $chr(64) $+ construction } set %skill2 Construction set %name $2 $common } on $*:TEXT:/^[!@.](hunter|hunt)/Si:#: { if ($1 == !hunter) { set %type !hunter } if ($1 == $chr(64) $+ hunter) { set %type $chr(64) $+ hunter } if ($1 == !hunt) { set %type !huntert } if ($1 == $chr(64) $+ hunt) { set %type $chr(64) $+ hunter } set %skill2 Hunter set %name $2 $common } alias common { var %style = istat, %skill = %skill2 inc %ID if ($len(%name) > 12) { $($+(%,stats.display., %ID),2) $c1(The name) $c2($2-) $c1(is too long) cleanup %ID halt } elseif (%name) set $+(%,stats.rsn., %ID) $replace(%name,$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 set $+(%,stats.style., %ID) %style set $+(%,stats.skill., %ID) %skill set $+(%,stats.display., %ID) $iif($left(%type,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, ).text) makehash $sockname elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) { $($+(%,stats.display., %ID),2) $c1(The name) $+ $c2($($+(%,stats.rsn.,%ID),2)) $+ $c1(Does not appear in the hiscores) 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),