glacier_rat

Glacier_Rat

Jul 20th, 2010
645
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias -l locktime return 10
  2. alias -l spmparam return 10:5
  3. alias -l release return 0.3.8.1
  4. alias -l Botchan return $remove($readini(Hermes.ini,settings,Botchan),$chr(126))
  5. alias -l exploitcheckup return $regex($1-,/[%$]/)
  6. alias -l rini return $readini(Default.ini,n,$1,$2)
  7. alias -l logo return $+($c2($1,**),$c1($1,[),$c2($1,$2),$c1($1,]))
  8. alias -l nohtml return $regsubex($1-,/(<[^>]+>)/g,)
  9. alias -l hlink return $regsubex($1-,/((?:http\Q://\E|www\.)\S+)/gi,$+($chr(31),$chr(3),07,\1,$chr(15)))
  10. alias -l fname return $replace($regsubex($1-,/^(.)/S,$upper(\t)),$chr(32),$iif($prop,+,$chr(95)))
  11. alias -l c1 return $+($chr(3),$iif($readini(Hermes.ini,Colour1,$address($1,3)),$v1,14),$2-)
  12. alias -l c2 return $+($chr(3),$iif($readini(Hermes.ini,Colour2,$address($1,3)),$v1,$readini(Hermes.ini,n,settings,Colour)),$2-)
  13. alias Hermes {
  14.   var %n cpanel
  15.   Dialog $iif($dialog(%n),-ve,-md %n) %n
  16. }
  17. alias -l chstop {
  18.   var %y $iif($remove($readini(Hermes.ini,settings,noreply),$chr(126)),$v1,#bots #xbnc)
  19.   return $iif($istok(%y,$1,32),$true)
  20. }
  21. alias -l botexempt {
  22.   var %bots Banhammer Captain_falcon Clanwars Client Coder Machine $&
  23.     Milk Minibar mIRC Noobs Pancake Spam Q W X Y Snoozles Runescape Unknown $&
  24.     Onzichtbaar* Babylon* Vectra* *Runescript *Grandexchange,%n $numtok(%bots,32)
  25.   while (%n) {
  26.     var %a $calc($wildtok($1,$gettok(%bots,%n,32),0,32) + %a)
  27.     dec %n
  28.   }
  29.   return %a
  30. }
  31. alias output {
  32.   tokenize 32 $1-
  33.   ;(trigger $1) (chan $2) (nick $3) (modes $4) (string $5)  
  34.   $iif($2 == NA,.msg $3,$iif($wildtok($1,@*,1,32) && !$readini(Hermes.ini,public,$2),.msg $2,.notice $3)) $iif(c isincs $4,$strip($5-),$5-)
  35. }
  36. on *:text:*:*: {
  37.   var %mcheck $wildtok($1,@*,1,32),%ch $chan,$&
  38.     %1 $1,%2 $iif(%mcheck && $chan,$chan,$iif(!%mcheck && $chan,NO,$iif(!$chan,NA,$v1))),$&
  39.     %3 $nick,%4 $iif(%mcheck && !$chan,NA,$iif(!%mcheck,NA,$regsubex($chan(#).mode,/[0-9]/g,)))
  40.   ;output parameters
  41.   var %o %1 %2 %3 %4
  42.   if ($query($nick)) {
  43.     ; close -m
  44.   }
  45.   if (!$chstop($chan)) && ($regex($1-,/^[!@~.`].+/i)) || ($regex($1-,/http://www.youtube.com/Si)) {
  46.  
  47.     var %stripcom $regsubex($1,/^[!@~.`]/Sgi,),%command $onoff($iif($skill(%stripcom),skills,$iif($regex($1-,/http://www.youtube.com/Si),yt,%stripcom)))
  48.     hinc $+(-mu,$token($spmparam,1,58)) aflood $wildsite 1
  49.  
  50.     if ($hget(aflood,$wildsite) < $token($spmparam,2,58)) && (!$hget(lockout,$wildsite)) {
  51.       if ($readini(Hermes.ini,%command,$chan)) {
  52.         if ($hget(oneresponse,$nick) != %command) {
  53.           .notice $nick $logo(%3,On/off) Command currently disabled in $c2(%3,$chan) $c1(%3,type !set %command on)
  54.           hadd -m oneresponse $nick %command
  55.         }
  56.         halt
  57.       }
  58.       if ($exploitcheckup($2-)) && ($botexempt($nick) == 0) {
  59.         var %cn $nick
  60.         .ignore -u60 $wildsite
  61.         .msg $Botchan $logo(%cn,Exploit) Detected potential exploit by: $c2(%cn,%cn) $+($c1(%cn,[),$c2(%cn,$address(%cn,2)),$c1(%cn,])) $c1(%cn,on) $c2(%cn,$chan) $c1(%cn,Ignored for) $c2(%cn,60) $c1(%cn,seconds) $c2(%cn,$1-)
  62.         halt
  63.       }
  64.       if ($regex($1,/^[!@~.]l(oot)?s(hare)?$/Si)) {
  65.         var %l $+(ls.,$right($ticks,5))
  66.         hadd -m %l output %o
  67.         hadd %l colour %3
  68.         sockopen %l runescape.com 80
  69.       }
  70.       elseif ($regex($1,/^[!@~.](rs|runescape)news$/Si)) {
  71.         var %rn $+(rsnews.,$right($ticks,5))
  72.         hadd -m %rn output %o
  73.         hadd %rn colour %3
  74.         sockopen %rn beardbot.netii.net 80
  75.       }
  76.       elseif ($regex($1,/^[!@~.]name(check)?/Si)) {
  77.         if ($len($2-) >= 12) || (!$2) {
  78.           .notice $nick $logo(%3,Name) You must specify a Runescape username, this must be below 12 characters
  79.           halt
  80.         }
  81.         var %n $+(ncheck.,$right($ticks,5))
  82.         hadd -m %n output %o
  83.         hadd %n colour %3
  84.         hadd %n name $fname($2-)
  85.         sockopen %n rscript.org 80
  86.       }
  87.       elseif ($regex($1,/^[!@~.]stats/Si)) {
  88.         var %st $+(st.,$right($ticks,5)),%address $address($nick,3),%elg $remove($regsubex($2-,/[a-zA-Z0-9_]/gi,),$chr(32)),$&
  89.           %num $wildtok($2-,$+(*,%elg,*),1,32),%nick $iif($rini(Defname,%address),$v1,$nick)
  90.         hadd -m %st output %o
  91.         hadd %st colour %3
  92.         hadd %st rsn $iif(!$2,%nick,$iif(!%elg,$fname($2-),$iif($rini(Defname,%address) && !%elg,$v1,$iif($3,$token($2-,1,$asc(%elg)),%nick))))
  93.         hadd %st prsn $iif($rini(Privacy,%address) && !$2,Hidden,$hget(%st,rsn))
  94.         hadd %st errorout .notice $nick
  95.         hadd %st elg $iif(%num && %elg,$+(%elg,.,$remove(%num,=,>,<)))
  96.         sockopen %st hiscore.runescape.com 80
  97.       }
  98.       elseif ($skill($mid($1-,2))) && ($regex($1,/^[!@~.]/Si)) && (!$regex($1,/^[!@~.](def?name|define|fml)/Si)) {
  99.         var %st $+(st.,$right($ticks,5)),%address $address($nick,3)
  100.         hadd -m %st output %o
  101.         hadd %st colour %3
  102.         hadd %st rsn $fname($iif(!$wildtok($2-,#*,1,32),$iif(!$2,$iif($rini(Defname,%address),$v1,$nick),$2-), $&
  103.           $iif(!$3,$iif($rini(Defname,%address),$v1,$nick),$iif(#* iswm $3,$2,$3-))))
  104.         hadd %st prsn $iif($rini(Privacy,%address) && !$2,Hidden,$hget(%st,rsn))
  105.         hadd %st goal $iif(!$wildtok($2-,#*,1,32),no,$iif($remove($wildtok($2-,#*,1,32),$chr(35)) && $v1 isnum 4-99,$v1,99))
  106.         hadd %st skill $skill($mid($1-,2))  
  107.         hadd %st errorout .notice $nick
  108.         sockopen %st hiscore.runescape.com 80
  109.       }
  110.       elseif ($regex($1,/^[!@~.]cmb-est$/Si)) {
  111.         if (!$2 || !$8 || $regex($2-,/[a-zA-Z_]/i)) {
  112.           .notice $nick $logo(%3,Cmb-est) Please specify the combat stats in this order: A S D H R P M (SU)
  113.         }
  114.         else {
  115.           var %cmbstats $2-9
  116.           $output(%o $logo(%3,Cmb-est) Level: $c2(%3,$cmb(%cmbstats)) $c1(%3,F2P:) $c2(%3,$token($cmb($token(%cmbstats,1-7,32)),1,32)) $c1(%3,ASDCRPM(SU)) $c2(%3,$remove(%cmbstats,$chr(45)))))
  117.           if ($($+($,nextlevel,$chr(40),%cmbstats,$chr(41),.,$nick),2)) {
  118.             var %v1 $v1
  119.             $output(%o $logo(%3,Cmb-est) Next level in: %v1))
  120.           }
  121.         }
  122.       }
  123.       elseif ($regex($1,/^[!@~.]co?mba?t?%?/Si)) {
  124.         var %st $+(st.,$right($ticks,5)),%address $address($nick,3)
  125.         hadd -m %st output %o
  126.         hadd %st colour %3
  127.         hadd %st rsn $iif(!$2,$iif($rini(Defname,%address),$v1,$nick),$fname($2-))
  128.         hadd %st prsn $iif($rini(Privacy,%address) && !$2,Hidden,$hget(%st,rsn))
  129.         hadd %st errorout .notice $nick
  130.         hadd %st cmb $iif(*% iswm $1,cmbperc,yes)
  131.         sockopen %st hiscore.runescape.com 80
  132.       }
  133.       elseif ($regex($1,/^[!@~.](high|low)/Si)) {
  134.         var %h $mid($1,2),%st $+(st.,$right($ticks,5)),%address $address($nick,3)
  135.         hadd -m %st rsn $iif(!$2,$iif($rini(Defname,%address),$v1,$nick),$fname($2-))
  136.         hadd %st prsn $iif($rini(Privacy,%address) && !$2,Hidden,$hget(%st,rsn))
  137.         hadd %st output %o
  138.         hadd %st colour %3
  139.         hadd %st hl $iif(%h == highlow,$v2,$iif(%h == high,$v2,low))  
  140.         hadd %st errorout .notice $nick
  141.         sockopen %st hiscore.runescape.com 80
  142.       }
  143.       elseif ($regex($1,/^[!@~.](le?ve?l|exp)( |$)/Si)) {
  144.         if (!$2) {
  145.           $output(%o $logo(%3,xp) $c1(%3,Syntax: !exp lvl))
  146.         }
  147.         else {
  148.           var %n $rp($2)
  149.           $output(%o $logo(%3,Exp) $c1(%3,Exp: %n =) $c2(%3,$lvl(%n)) $iif(%n < 126,$c1(%3,|) $c1(%3,Lvl: %n =) $c2(%3,$bytes($exp(%n),db)))))  
  150.         }
  151.       }
  152.       elseif ($regex($1,/^[!@~.]rsn/Si)) {
  153.         var %address $address($iif($2,$2,$nick),3)
  154.         if ($rini(Privacy,%address)) {
  155.           $output(%o $logo(%3,Rsn) The Runescape name associated with the address $c2(%3,$rini(Defname,%address)) $c1(%3,is) $c2(%3,Hidden))
  156.         }
  157.         else {
  158.           if ($rini(Defname,%address)) {
  159.             $output(%o $logo(%3,Rsn) The Runescape name associated with the address $c2(%3,%address) $c1(%3,is) $c2(%3,$rini(Defname,%address)))
  160.           }
  161.           elseif (!%address) || ($2 !ison #) {
  162.             $output(%o $logo(%3,Rsn) The person must be in the channel for you too lookup their Runescape name!)
  163.           }
  164.           else {
  165.             $output(%o $logo(%3,Rsn) No Default Rsn set for $c2(%3,%address))
  166.           }
  167.         }
  168.       }
  169.       elseif ($regex($1,/^[!@~.](set|def(ault|ine)?)name/Si)) {
  170.         if ($len($2-) <= 12) && ($2) {
  171.           var %n $fname($remove($2-,$,#,%,^,&,*,.))
  172.           writeini default.ini Defname $address($nick,3) %n
  173.           .notice $nick $logo(%3,Defname) $c2(%3,Default username is now $c1(%3,$+(%n,.)) $c2(%3,Username associated with address:) $c1(%3,$address($nick,3)))
  174.         }
  175.         else {
  176.           .notice $nick $logo(%3,Error) $c2(%3,Syntax: !defname <rsusername>)
  177.           halt
  178.         }
  179.       }
  180.       elseif ($regex($1,/^[!@~.]privacy/Si)) {
  181.         if ($2 == on) && (!$rini(Privacy,$address($nick,3))) {
  182.           writeini default.ini Privacy $address($nick,3) on
  183.           .notice $nick $logo(%3,Privacy) Privacy now on for $c2(%3,$address($nick,3))
  184.         }
  185.         elseif (!$2) || ($2 == off) && ($rini(Privacy,$address($nick,3))) {
  186.           remini default.ini Privacy $address($nick,3)
  187.           .notice $nick $logo(%3,Privacy) Privacy now off for $c2(%3,$address($nick,3))
  188.         }
  189.         else {
  190.           .notice $nick $logo(%3,Privacy) Privacy settings currently already $c2(%3,$rini(Privacy,$address($nick,3)))
  191.         }
  192.       }
  193.       elseif ($regex($1,/^[!@~.]rank/Si)) {
  194.         if (!$skill($3)) || ($rp($2) <= 0) {
  195.           .notice $nick $logo(%3,Rank) $c1(%3,you must specify a skill and a number greater than 0 |) $c2(%3,Syntax: !rank position skill) $c1(%3,e.g. !rank 1 attack)
  196.           halt
  197.         }
  198.         var %r $+(rank.,$right($ticks,5))
  199.         hadd -m %r table $iif($skill($3) == overall,0,$s2($v1))
  200.         hadd %r position $rp($2)
  201.         hadd %r output %o
  202.         hadd %r colour %3
  203.         sockopen %r beardbot.netii.net 80
  204.       }
  205.       elseif ($regex($1,/^[!@~.]compare/Si)) {
  206.         if (!$skill($2)) || (!$3) || (!$4 && !$readini(Default.ini,n,Defname,$address($nick,3))) {
  207.           .notice $nick $logo(%3,Compare) $c1(%3,Syntax:) $c2(%3,!compare <skill> <user1> <user2>) $c1(%3,with defname set:) $c2(%3,!compare <skill> <user2>)
  208.           halt
  209.         }
  210.         var %c $+(compare.,$right($ticks,5))
  211.         hadd -m %c skill $skill($2)
  212.         hadd %c user1 $fname($iif(!$4,$rini(Defname,$address($nick,3)),$3))  
  213.         hadd %c user2 $fname($iif(!$4,$3,$4))
  214.         hadd %c output %o
  215.         hadd %c colour %3
  216.         sockopen %c beardbot.netii.net 80
  217.       }
  218.       elseif ($regex($1,/^[!@~.]Charm(s)?/Si)) {
  219.         var %seperate $c1(%3,|)
  220.         if ($2) {
  221.           if (!$5) || ($2 >= 99) {
  222.             .notice $nick $logo(%3,Charms) You must specify a starting level
  223.             halt
  224.           }
  225.           if ($3 > 0) || ($4 > 0) {
  226.             $output(%o $logo(%3,Charms) $iif($3 > 0,$charmdisplay(%3,$2,$3,Gold).Charms) $iif($4 > 0,%seperate $charmdisplay(%3,$2,$v1,Green).Charms))
  227.           }
  228.           if ($5 > 0) || ($6 > 0) {
  229.             $output(%o $logo(%3,Charms) $iif($5 > 0,$charmdisplay(%3,$2,$v1,Crimson).Charms) $iif($6 > 0,%seperate $charmdisplay(%3,$2,$v1,Blue).Charms))
  230.           }
  231.         }
  232.         else {
  233.           $output(%o $logo(%3,Charms) $c1(%3,Syntax) $c1(%3,!charms Level) 7Number-Of-Gold 3Number-Of-Green 4Number-Of-Crimson 12Number-Of-Blue)
  234.         }
  235.       }
  236.       elseif ($regex($1,/^[!@~.](con)?grat[sz]\b/Si)) {
  237.         if ($skill($2) && $skill($3)) || ($2 isnum && $3 isnum) {
  238.           .notice $nick $logo(%3,Gratz) $c2(%3,Correct syntax is:) $c1(%3,[!@~.]gratz <level> <skill>)
  239.           halt
  240.         }
  241.         var %m $+(G.,$right($ticks,6)),%lvl $regsubex($2-,/[A-Za-z]/g,),%t @ $chan $nick $regsubex($chan(#).mode,/[0-9]/g,),$&
  242.           %skill $remove($regsubex($2-,/[0-9]/g,),$chr(32)),%upto $iif($skill(%skill) == Dungeoneering,119,98),$&
  243.           %capelvl $iif($skill($iif($2 isnum,$3,$2)) == Dungeoneering,120,99)
  244.         hadd -m %m lvl $iif($2 isnum,$v1,$3)
  245.         hadd %m skill $iif($skill($2),$v1,$skill($3))
  246.         if ($skill(%skill)) && (%lvl <= %upto) {
  247.           $output(%t $logo(%3,4G14r10a7t14z7) $c2(%3,*\@/*\@/*\@/*) $c1(%3,Congratulations for achieving $&
  248.             $iif($istok(attack agility overall,$regml(1),32),an,a)) $c2(%3,$skill($hget(%m,skill))) $c1(%3,level of) $&
  249.             $c2(%3,$hget(%m,lvl)) $c1(%3,$+($nick,!)) $c2(%3,*\@/*\@/*\@/*))
  250.           hfree %m
  251.         }  
  252.         elseif (%lvl isnum 34-2496) && ($regex(%skill,/(overall|total)$/)) {
  253.           $output(%t $logo(%3,4G14r10a7t14z7) $c2(%3,*\@/*\@/*\@/*) $c1(%3,Congratulations for achieving $&
  254.             $iif($istok(attack agility overall,$regml(1),32),an,a)) $c2(%3,$regml(1)) $c1(%3,level of) $c2(%3,$hget(%m,lvl)) $&
  255.             $c1(%3,$+($nick,!)) $c2(%3,*\@/*\@/*\@/*))
  256.           hfree %m
  257.         }
  258.         elseif (%lvl isnum 4-138) && ($regex(%skill,/(combat|cmb)$/)) {
  259.           $output(%t $logo(%3,4G14r10a7t14z7) $c2(%3,*\@/*\@/*\@/*) $c1(%3,Congratulations for achieving a) $&
  260.             $c2(%3,Combat) $c1(%3,level of) $c2(%3,$hget(%m,lvl)) $c1(%3,$+($nick,!)) $c2(%3,*\@/*\@/*\@/*))
  261.           hfree %m
  262.         }
  263.         elseif (%lvl isnum %capelvl) && ($skill(%skill)) {
  264.           $output(%t $logo(%3,4G14r10a7t14z7) $c2(%3,*\@/*\@/*\@/*) $c1(%3,Congratulations for achieving $&
  265.             $iif($istok(attack agility overall,$hget(%m,skill),32),an,a)) $c2(%3,$skill($hget(%m,skill))) $c1(%3,level of) $&
  266.             $c2(%3,$hget(%m,lvl)) $c1(%3,$+($nick,!)) $c2(%3,Enjoy that sexy cape and emote!))
  267.           hfree %m
  268.         }
  269.         else {
  270.           .notice $nick $logo(%3,Gratz) $c2(%3,Correct syntax is:) $c1(%3,[!@~.]gratz <level> <skill>)
  271.         }
  272.       }
  273.       elseif ($regex($1,/^[!@~.]F(airy(Ring)?|R)( |$)/Si)) {
  274.         if (!$2) {
  275.           .notice $nick $logo(%3,Fairy) Please state a location or ring name
  276.           halt
  277.         }
  278.         var %Ring $rings($2-)
  279.         if ($regex($2,/(^(S|C)ent(re|er)|West|East|slay(er)?|Farm(ing|er)?)$/Si)) {
  280.           var %Codes $gettok(%Ring,0,64)
  281.           while (%Codes) {
  282.             tokenize 64 $gettok(%Ring,%Codes,45)
  283.             var %display $c1(%3,$1) $c2(%3,$2) @ %display
  284.             dec %Codes
  285.           }
  286.           tokenize 64 %Display
  287.           $output(%o $logo(%3,Fairy) $$1-8)
  288.           $output(%o $$9-)
  289.         }
  290.         else {
  291.           if (%Ring == Error) {
  292.             if ($len($2-) == 3) && (!$regex($2-,/^[a-d][i-l][p-s]$/i)) {
  293.               $output(%o $logo(%3,Fairy) $c2(%3,Invalid code. Valid Codes are) $c1(%3,ABCD) $c2(%3,followed by) $c1(%3,IJKL) $c2(%3,followed by) $c1(%3,PQRS))
  294.             }
  295.             else {
  296.               $output(%o $logo(%3,Fairy) $c2(%3,I was unable to find a code for the location) $c1(%3,$qt($2-)) $c2(%3,in my database.))
  297.             }
  298.           }
  299.           else {
  300.           $output(%o $logo(%3,Fairy) $c1(%3,$gettok(%Ring,1,64)) $c2(%3,$gettok(%Ring,2,64))) }
  301.         }
  302.       }
  303.       elseif ($regex($1,/^[!@~.](gu|geupdate)$/Si)) {
  304.         var %gu $+(geup.,$right($ticks,5))
  305.         hadd -m %gu output %o
  306.         hadd %gu colour %3
  307.         sockopen %gu rscript.org 80
  308.       }
  309.       elseif ($regex($1,/^[!@~.]ge/Si)) && (!$regex($1,/geup/)) {
  310.         if (!$2) {
  311.           .notice $nick $logo(%3,GE) $c1(%3,Please specify an item to lookup)
  312.           halt
  313.         }
  314.         var %g $+(ge.,$right($ticks,5))
  315.         hadd -m %g item $iif($remove($2,k,m) isnum,$fname($3-).plus,$fname($2-).plus)
  316.         hadd %g quan $iif($3 && $rp($2) isnum,$rp($2))
  317.         hadd %g output %o
  318.         hadd %g colour %3
  319.         sockopen %g beardbot.netii.net 80
  320.       }
  321.       elseif ($regex($1,/^[!@~.]cs/Si)) {
  322.         if (!$2 || !$3 || $regex($2,/[a-zA-Z]/i)) {
  323.           .notice $nick $logo(%3,CS) Syntax: $c2(%3,[!@~.]cs number item) $c1(%3,e.g. !cs 5 bgs)
  324.           halt
  325.         }
  326.         var %cs $+(cs.,$right($ticks,5))
  327.         hadd -m %cs split $2
  328.         hadd -m %cs search $3
  329.         hadd %cs output %o
  330.         hadd %cs colour %3
  331.         sockopen %cs beardbot.netii.net 80
  332.       }
  333.       elseif ($regex($1,/^[!@~.]world/Si)) {
  334.         if ($2 isnum 1-171) {
  335.           var %w $+(world.,$ticks)
  336.           hadd -m %w world $2
  337.           hadd %w output %o
  338.           hadd %w colour %3
  339.           sockopen %w beardbot.netii.net 80
  340.         }
  341.         else {
  342.           .notice $nick $logo(%cn,Error) You must provide a valid world to lookup
  343.         }
  344.       }
  345.       elseif ($regex($1,/^[!@~.]clan/Si)) {
  346.         var %cl $+(clan.,$right($ticks,5))
  347.         hadd -m %cl user $fname($iif(!$2,$iif($rini(Defname,$address($nick,3)),$v1,$nick),$2-))
  348.         hadd %cl output %o
  349.         hadd %cl colour %3
  350.         sockopen %cl runehead.com 80
  351.       }
  352.       elseif ($regex($1,/^[!@~.]ml$/Si)) {
  353.         if (!$2) {
  354.           .notice $nick $logo(%3,Memberlist) $c1(%3,Please specify a clan to lookup)
  355.           halt
  356.         }
  357.         var %ml $+(ml.,$right($ticks,5))
  358.         hadd -m %ml clan $replace($2-,$chr(32),$chr(95)))
  359.         hadd %ml output %o
  360.         hadd %ml colour %3
  361.         sockopen %ml runehead.com 80
  362.       }
  363.       elseif ($regex($1,/^[!@~.]alog/Si)) {
  364.         var %al $+(alog.,$right($ticks,5))
  365.         hadd -m %al rsn $iif(!$2,$iif($rini(Defname,$address($nick,3)),$v1,$nick),$fname($2-))
  366.         hadd %al output %o
  367.         hadd %al colour %3
  368.         sockopen %al beardbot.netii.net 80
  369.       }
  370.       elseif ($regex($1,/^[!@~.](npc|monster)/Si)) {
  371.         if (!$2) {
  372.           .notice $nick $logo(%3,Npc) $c1(%3,Correct syntax is:) $c2(%3,!npc <monster name>)
  373.           halt
  374.         }
  375.         var %m $+(npcid.,$right($ticks,5))
  376.         hadd -m %m output %o
  377.         hadd %m colour %3
  378.         hadd %m search $replace($2-,$chr(32),+)
  379.         sockopen %m www.tip.it 80
  380.       }
  381.       elseif ($regex($1,/^[!@~.]quest/Si)) {
  382.         if (!$2) {
  383.           .notice $nick $logo(%3,Quest) $c1(%3,Correct syntax is) $c2(%3,!quest <quest>)
  384.           halt
  385.         }
  386.         var %q $+(quest.,$right($ticks,5))
  387.         hadd -m %q output %o
  388.         hadd %q colour %3
  389.         hadd %q search $replace($2-,$chr(32),+)
  390.         sockopen %q beardbot.netii.net 80  
  391.       }
  392.       elseif ($regex($1,/^[!@~.](item|istats)/Si)) {
  393.         if (!$2) {
  394.           .notice $nick $logo(%3,Item) $c1(%3,Correct syntax is:) $c2(%3,!item <item>)
  395.           halt
  396.         }
  397.         var %i $+(item.,$right($ticks,5))
  398.         hadd -m %i output %o
  399.         hadd %i colour %3
  400.         hadd %i item $replace($2-,$chr(32),+)
  401.         sockopen %i beardbot.netii.net 80  
  402.       }
  403.       elseif ($regex($1,/^[!@~.]alch/Si)) {
  404.         if (!$2) {
  405.           .notice $nick $logo(%3,Alch) $c1(%3,Correct syntax is:) $c2(%3,!alch <item>)
  406.           halt
  407.         }
  408.         var %a $+(alch.,$right($ticks,5))
  409.         hadd -m %a output %o
  410.         hadd %a colour %3
  411.         hadd %a item $replace($2-,$chr(32),+)
  412.         sockopen %a beardbot.netii.net 80  
  413.       }
  414.       elseif ($regex($1,/^[!@~.]track/Si)) {
  415.         if (!$skill($2-)) {
  416.           var %trn $+(tracker.,$right($ticks,5)),%d $iif($rini(Defname,$address($nick,3)),$v1,$nick)
  417.           hadd -m %trn nick $fname($iif(!$2,%d,$iif(!$3 && $wildtok($2-,@*,1,32),%d,$token($2-,1,64))))
  418.           hadd %trn pnick $iif($rini(Privacy,$address($nick,3)) && !$2,Hidden,$hget(%trn,nick))
  419.           hadd %trn time $duration($iif(!$2 || !$wildtok($2-,@*,1,32),1w,$remove($wildtok($2-,@*,1,32),@)))
  420.           hadd %trn t $duration($hget(%trn,time))
  421.           hadd %trn output %o
  422.           hadd %trn colour %3
  423.           sockopen %trn rscript.org 80
  424.         }
  425.         elseif ($skill($2-)) {
  426.           var %sn $+(track.,$right($ticks,5)),%dfn $rini(Defname,$address($nick,3)),%n $nick,%a $iif($wildtok($2-,@*,1,32),$remove($v1,@),1wk)
  427.           if (*secs* iswm $duration(%a)) || ($left(%a,1) !isnum) {
  428.             .notice $nick $logo(%3,Track) $c2(%3,syntax: [!@.~]track <skill> <rsn> <period>) $c1(%3,e.g. !track magic Riffpilgrim @4w)
  429.             halt
  430.           }
  431.           hadd -m %sn nick $fname($iif(!$3 && %dfn,%dfn,$iif(!$3 && !%dfn,%n,$iif(!$4,$iif(@ isin $3,$iif(%dfn,$v1,%n),$3),$3))))
  432.           hadd %sn pnick $iif($rini(Privacy,$address($nick,3)) && !$2,Hidden,$hget(%sn,nick))    
  433.           hadd -m %sn time $duration($iif(!%a,1d,%a))
  434.           hadd -m %sn t $iif(!%a,1wk,%a)
  435.           hadd %sn skill $skill($2)
  436.           hadd %sn output %o
  437.           hadd %sn colour %3
  438.           sockopen %sn rscript.org 80
  439.         }
  440.       }
  441.       elseif ($regex($1,/^[!@~.]rswiki/Si)) {
  442.         if (!$2) {
  443.           .notice $nick $logo(%3,Rswiki) $hlink(http://runescape.wikia.com)
  444.           halt
  445.         }
  446.         var %r $+(rswiki.,$right($ticks,5))
  447.         hadd -m %r output %o
  448.         hadd %r colour %3
  449.         hadd %r query $2-
  450.         sockopen %r beardbot.netii.net 80
  451.       }
  452.       elseif ($regex($1,/^[!@~.]fml$/Si)) {
  453.         var %f $+(fml.,$right($ticks,5))
  454.         hadd -m %f output %o
  455.         hadd %f colour %3
  456.         sockopen %f beardbot.netii.net 80
  457.       }
  458.       elseif ($regex($1,/^[!@~.]tfln$/Si)) {
  459.         var %tf $+(tfln.,$right($ticks,5))
  460.         hadd -m %tf output %o
  461.         hadd %tf colour %3
  462.         sockopen %tf beardbot.netii.net 80
  463.       }
  464.       elseif ($regex($1,/^[!@~.]bash/Si)) {
  465.         var %b $+(bash.,$right($ticks,5))
  466.         hadd -m %b output %o
  467.         hadd %b colour %3
  468.         $iif($2,hadd %b id $remove($2,$chr(35)))
  469.         sockopen %b beardbot.netii.net 80
  470.       }
  471.       elseif ($regex($1,/^[!@~.](urban|ud)/Si)) {
  472.         if (!$2) {
  473.           .notice $nick $logo(%3,Urban) $c1(%3,Please specify a term to lookup)
  474.           halt
  475.         }
  476.         var %u $+(urban.,$right($ticks,5))
  477.         hadd -m %u output %o
  478.         hadd %u colour %3
  479.         hadd %u word $replace($regsubex($2-,/^(.)/S,$upper(\t)),$chr(32),+)
  480.         sockopen %u beardbot.netii.net 80
  481.       }
  482.       elseif ($regex($1,/^[!@~.](halo|h3)/Si)) {
  483.         if (!$2) && (!$readini(hermes.ini,ConsoleDefname,$address($nick,3))) {
  484.           .notice $nick $logo(%3,Halo3) $c1(%3,Please specify a gamertag to lookup)
  485.           halt
  486.         }
  487.         var %h $+(halo.,$right($ticks,5)),%cdn $readini(hermes.ini,ConsoleDefname,$address($nick,3))
  488.         hadd -m %h output %o
  489.         hadd %h colour %3
  490.         hadd %h user $iif(!$2 && %cdn,%cdn,$replace($regsubex($2-,/^(.)/S,$upper(\t)),$chr(32),+)))
  491.         sockopen %h beardbot.netii.net 80
  492.       }
  493.       elseif ($regex($1,/^[!@~.](xbl|gc)/Si)) {
  494.         if (*-d* iswm $2) {
  495.           if (!$3) {
  496.             remini Hermes.ini ConsoleDefname $address($nick,3)
  497.             $output($logo(%3,ConsoleDefname) $c1(%3,Default console name unset))
  498.             halt
  499.           }
  500.           var %d on
  501.           writeini Hermes.ini ConsoleDefname $address($nick,3) $&
  502.             $remove($fname($3-).plus,$,#,%,^,&,*)
  503.           $output($logo(%3,ConsoleDefname) $c2(%3,$qt($3-)) $c1(%3,set as default console name))
  504.         }
  505.         if (!$2) && (!$readini(hermes.ini,ConsoleDefname,$address($nick,3))) {
  506.           .notice $nick $logo(%3,Xbl) $c1(%3,Please specify a gamertag to lookup)
  507.           halt
  508.         }
  509.         var %x $+(xbl.,$right($ticks,5)),%cdn $readini(hermes.ini,ConsoleDefname,$address($nick,3))
  510.         hadd -m %x output %o
  511.         hadd %x colour %3
  512.         hadd %x user $iif(!$2 && %cdn,%cdn,$fname($iif(%d,$3-,$2-)).plus)
  513.         sockopen %x beardbot.netii.net 80
  514.       }
  515.       elseif ($regex($1,/^[!@~.](gf|googlefight)/Si)) {
  516.         if (!$2) || (!$3) {
  517.           .notice $nick $logo(%3,Googlefight) $c1(%3,You have to state two words to lookup)
  518.           halt
  519.         }
  520.         var %gf $+(gf.,$right($ticks,5))
  521.         hadd -m %gf output %o
  522.         hadd %gf colour %3
  523.         hadd %gf word1 $2
  524.         hadd %gf word2 $3
  525.         sockopen %gf beardbot.netii.net 80
  526.       }
  527.       elseif ($regex($1,/http://www.youtube.com/Si)) {
  528.         var %yt $+(ytinfo.,$right($ticks,5))
  529.         hadd -m %yt output @ $chan $nick $regsubex($chan(#).mode,/[0-9]/g,\1)
  530.         hadd %yt colour %3
  531.         hadd %yt id $gettok($1,2,61)
  532.         sockopen %yt beardbot.netii.net 80
  533.       }
  534.       elseif ($regex($1,/^[!@~.](yt|youtube)/Si)) {
  535.         if (!$2) {
  536.           $output(%o $logo(%3,Youtube) Please state something to search for)
  537.         }
  538.         var %yt $+(yt.,$right($ticks,5))
  539.         hadd -m %yt output %o
  540.         hadd %yt colour %3
  541.         hadd %yt search $fname($2-)
  542.         sockopen %yt beardbot.netii.net 80
  543.       }
  544.       elseif ($regex($1,/^[!@~.]google/Si)) {
  545.         if (!$2) {
  546.           $output(%o $logo(%3,Google) Please state something to search for)
  547.           halt
  548.         }  
  549.         var %g $+(google.,$right($ticks,5))
  550.         hadd -m %g output %o
  551.         hadd %g colour %3
  552.         hadd %g search $fname($2-).plus
  553.         sockopen %g beardbot.netii.net 80
  554.       }
  555.       elseif ($regex($1,/^[!@~.]version$/Si)) {
  556.         var %v $+(version.,$right($ticks,5))
  557.         hadd -m %v output %o
  558.         hadd %v colour %3
  559.         sockopen %v beardbot.netii.net 80  
  560.       }
  561.       elseif ($regex($1,/^[!@~.]define/Si)) {
  562.         if ($2) {
  563.           var %d $+(define.,$right($ticks,5))
  564.           hadd -m %d output %o
  565.           hadd %d colour %3
  566.           hadd %d search $fname($2-).plus
  567.           sockopen %d www.thefreedictionary.com 80
  568.         }
  569.         else {
  570.           .notice $nick $logo(define) Please provide something to lookup!
  571.         }
  572.       }
  573.       elseif ($regex($1,/^[!@~.]ascii/Si)) {
  574.         var %chr $+($,+,$chr(40),$mid($regsubex($2-,/(.)/g,$!chr( $+ $asc(\t) $+ ) $+ $chr(44)),1,-1),$chr(41))
  575.         $output(%o $logo(%3,Ascii) $c1(%3,$2-) $c2(%3,converts to) $c1(%3,%chr))
  576.       }
  577.       elseif ($regex($1-,/^[!@~.]calc(ulator)?|`[()0-9]|`(sin|cos|tan|sqrt|log|lvl|pi)/Si)) {
  578.         var %e $iif(` == $left($1,1),$mid($1-,2),$2-)
  579.         if (!%e) {
  580.           $output(%o $logo(%3,Calc) $c1(%3,Please state an equation to calculate))
  581.         }
  582.         else {
  583.           var %rep $replace(%e,x,*,pi,$pi,lvl,exp)
  584.           var %pt1 $regsubex(%rep,/(sin|cos|tan|sqrt|log|exp)[\[\(](\d+)[\)\]](.*)/Sgi,$($+($,\1,$chr(40),$iif(exp isin \1 && \2 > 126,$v2,\2),$chr(41)),2))  
  585.           var %pt2 $regsubex($regml(3),/(?<![\(\)\])([^-+/*](.*))/g,$+($chr(40),\1,$chr(41)))
  586.           var %x $rp(%pt1 $+ %pt2)
  587.           $output(%o $logo(%3,Calc) $+($c2(%3,%e),=,$c1(%3,$bytes(%x,bd)),$chr(32)) $c2(%3,$sn(%x)))
  588.         }
  589.       }
  590.       elseif ($regex($1,/^[~]go/Si)) && ($chan == $botchan) {
  591.         if ($2 == join) {
  592.           .join $3
  593.           $iif(!$chstop($3),.msg $3 $iif($readini(Hermes.ini,settings,invmsg),$c2(%3,$remove($v1,$chr(96),$chr(126))),$c1(%3,Easy to use Runescape bot "Hermes") $c2(%3,Hello world!)))
  594.           .msg $botchan $logo(%3,Join) Sent by $nick $address($nick,2) to channel $3
  595.         }
  596.         elseif ($2 == part) {
  597.           .part $3
  598.           .msg $botchan $logo(%3,part) $me has left $3 $c2(%3,forced by $nick)
  599.         }
  600.       }
  601.       elseif ($regex($1,/^[~](blacklist|bl)/Si)) && ($chan == $botchan) {
  602.         if ($2 == add) {
  603.           writeini Hermes.ini Blacklist $3 $3
  604.           .notice $nick $logo(%3,Hermes) Blacklisted $c2(%3,$3) $c1(%3,Reason:) $c2(%3,$iif($4,$4,no reason))
  605.         }
  606.         elseif ($2 == del) {
  607.           remini Hermes.ini Blacklist $3 $3
  608.           .notice $nick $logo(%3,Hermes) Removed $c2(%3,$3) $c1(%3,from blacklist)
  609.         }
  610.       }
  611.       elseif ($regex($1,/^[!@~.](part|gtfo)/Si)) {
  612.         hadd -mu30 itimer $chan on
  613.         if ($nick isop #) || ($nick ishop #) && ($2 == $me) {
  614.           .part $chan $c1(%3,Requested by) $c2(%3,$nick)
  615.           .msg $botchan $logo(%3,Part) $c1(%3,I have parted:) $c2(%3,$chan) $c1(%3,Requested by:) $c2(%3,$nick) $+($c2(%3,[),$c1(%3,$address($nick,2)),$c2(%3,]))
  616.         }
  617.       }
  618.       elseif ($regex($1,/^[!@~.](command(s)?|control)$/Si)) {
  619.         $output(%o $logo(%3,Commands) $c1(%3,http://hermes.beard-bot.co.uk))
  620.       }
  621.       elseif ($regex($1,/^[!@~.]set/Si)) && ($onoff($2)) {
  622.         if ($nick isop $chan) {
  623.           if ($istok($3-,off,32)) && (!$readini(Hermes.ini,$onoff($2),$chan)) {
  624.             writeini Hermes.ini $onoff($2) $chan off
  625.             .notice $nick $logo(%3,On/off) The feature: $c2(%3,$onoff($2)) $c1(%3,has been disabled in) $c2(%3,$chan)
  626.           }
  627.           elseif ($istok($3-,on,32)) && ($readini(Hermes.ini,$onoff($2),$chan)) {
  628.             remini Hermes.ini $onoff($2) $chan
  629.             .notice $nick $logo(%3,On/off) The feature: $c2(%3,$onoff($2)) $c1(%3,has been enabled in) $c2(%3,$chan)
  630.           }
  631.         }
  632.         else {
  633.           .notice $nick $logo(%3,On/off) Only ops can change channel settings
  634.         }
  635.       }
  636.       elseif ($regex($1,/^[!@~.](set|my)colou?r/Si)) {
  637.         var %n $nick
  638.         if ($2 && $3 isnum 1-15) {
  639.           writeini Hermes.ini colour1 $address(%n,3) $right($+(0,$2),2)
  640.           writeini Hermes.ini colour2 $address(%n,3) $right($+(0,$3),2)
  641.           .notice %n $logo(%n,Mycolour) 14Your default colours have been set to $c1(%n,Example) 14and $c2(%n,Example)
  642.         }
  643.         else {
  644.           var %x 1
  645.           while (%x <= 15) {
  646.             var %a %a  $+ $iif(%x == 1,14,1) $+ , $+ %x %x
  647.             inc %x
  648.           }
  649.           .notice %n $logo(%n,Mycolour) Please choose two colours from 1 to 15: %a
  650.         }
  651.       }
  652.     }
  653.   }
  654.   else {
  655.     hinc $+(-mz,$locktime) lockout $wildsite
  656.   }
  657. }
  658. on *:sockopen:*: {
  659.   if ($sockerr) {
  660.     .msg $botchan $logo(SocketError) $c2($sockname) $c1($sock($sockname).wsmsg)
  661.     hfree $sockname
  662.     sockclose $sockname
  663.     halt
  664.   }
  665.   var %path,%host beardbot.netii.net,%type $gettok($sockname,1,46),%% sockwrite -nt $sockname
  666.   if (%type == rsnews) {
  667.     var %path /parsers/rsnews.php
  668.   }
  669.   elseif (%type == rank) {
  670.     var %path $+(/parsers/rank.php?&table=,$hget($sockname,table),&rank=,$hget($sockname,position))
  671.   }
  672.   elseif (%type == compare) {
  673.     var %path $+(/parsers/compare.php?user1=,$hget($sockname,user1),&user2=,$hget($sockname,user2))
  674.   }
  675.   elseif (%type == alog) {
  676.     var %path $+(/parsers/alog.php?user=,$hget($sockname,rsn))
  677.   }
  678.   elseif (%type == quest) {
  679.     var %path $+(/parsers/quest.php?s=,$hget($sockname,search))
  680.   }
  681.   elseif (%type == item) {
  682.     var %path $+(/parsers/item.php?i=,$hget($sockname,item))
  683.   }
  684.   elseif (%type == alch) {
  685.     var %path $+(/parsers/alch.php?item=,$hget($sockname,item))
  686.   }
  687.   elseif (%type == cs) {
  688.     var %path $+(/parsers/cs.php?i=,$hget($sockname,search),&split=,$hget($sockname,split))
  689.   }
  690.   elseif (%type == ge) {
  691.     var %path $+(/parsers/ge.php?item=,$hget($sockname,item))
  692.   }
  693.   elseif (%type == world) {
  694.     var %path $+(/parsers/world.php?w=,$hget($sockname,world))
  695.   }
  696.   elseif (%type == rswiki) {
  697.     var %path $+(/parsers/rswiki.php?query=,$hget($sockname,query))
  698.   }
  699.   elseif (%type == fml) {
  700.     var %path /parsers/fml.php
  701.   }
  702.   elseif (%type == tfln) {
  703.     var %path /parsers/tfln.php?
  704.   }
  705.   elseif (%type == bash) {
  706.     var %path $+(/parsers/bash.php?id=,$hget($sockname,id))
  707.   }
  708.   elseif (%type == urban) {
  709.     var %path $+(/parsers/urban.php?term=,$hget($sockname,word))
  710.   }
  711.   elseif (%type == halo) {
  712.     var %path $+(/parsers/Halo3.php?player=,$hget($sockname,user))
  713.   }
  714.   elseif (%type == xbl) {
  715.     var %path $+(/parsers/xbl.php?tag=,$hget($sockname,user))
  716.   }
  717.   elseif (%type == gf) {
  718.     var %path $+(/parsers/gf.php?&w1=,$hget($sockname,word1),&w2=,$hget($sockname,word2))
  719.   }
  720.   elseif (%type == ytinfo) {
  721.     var %path $+(/parsers/ytinfo.php?search=,$hget($sockname,id))
  722.   }
  723.   elseif (%type == yt) {
  724.     var %path $+(/parsers/youtube.php?search=,$hget($sockname,search))
  725.   }
  726.   elseif (%type == google) {
  727.     var %path $+(/parsers/google.php?search=,$hget($sockname,search))
  728.   }
  729.   elseif (%type == botnews) {
  730.     var %path /parsers/twitter.php?page=hermesbot
  731.   }
  732.   elseif (%type == version) {
  733.     var %path /parsers/version.php
  734.   }
  735.   elseif (%type == define) {
  736.     var %path $+(/,$hget($sockname,search)),%host www.thefreedictionary.com
  737.   }
  738.   elseif (%type == rsp) {
  739.     var %path /title.ws,%host runescape.com
  740.   }
  741.   elseif (%type == ls) {
  742.     var %path /slu.ws?j=1&m=1
  743.   }
  744.   elseif (%type == st) {
  745.     var %path $+(/index_lite.ws?player=,$hget($sockname,rsn)),%host hiscore.runescape.com
  746.   }
  747.   elseif (%type == ncheck) {
  748.     var %path $+(/flookup.php?type=namecheck&name=,$hget($Sockname,name)),%host rscript.org
  749.   }
  750.   elseif (%type == geup) {
  751.     var %path /lookup.php?type=geupdate
  752.   }
  753.   elseif (%type == tracker) {
  754.     var %path $+(/flookup.php?type=track&user=,$hget($sockname,nick),&time=,$hget($sockname,time),&skill=all)
  755.   }
  756.   elseif (%type == track) {
  757.     var %path $+(/flookup.php?type=track&user=,$hget($sockname,nick),&time=,$hget($sockname,time),$chr(44),$duration(4w), $&
  758.       &skill=,$iif($hget($sockname,skill) == overall,0,$s2($hget($sockname,skill))))
  759.   }
  760.   elseif (%type == clan) {
  761.     var %path $+(/feeds/lowtech/searchuser.php?user=,$hget($sockname,user),&type=2),%host runehead.com
  762.   }
  763.   elseif (%type == ml) {
  764.     var %path $+(/feeds/lowtech/searchclan.php?search=,$hget($sockname,clan),&type=2)
  765.   }
  766.   elseif (%type == npcid) {
  767.     var %path $+(/runescape/index.php?rs2monster=&orderby=&keywords=,$hget($sockname,search),&levels=All&race=0),%host www.tip.it
  768.   }
  769.   elseif (%type == npc) {
  770.     var %path $+(/runescape/index.php?rs2monster_id=,$hget($sockname,id))
  771.   }
  772.   if ((%host && %path)) {
  773.     %% GET %path HTTP/1.1
  774.     %% Host: %host
  775.     %% $crlf
  776.   }
  777. }
  778. on *:sockread:*: {
  779.   if ($sockerr) {
  780.     .msg $botchan $logo(%cn,SocketError) $c2(%cn,$sockname) $c1(%cn,$sock($sockname).wsmsg)
  781.     hfree $sockname
  782.     sockclose $sockname
  783.     halt
  784.   }
  785.   if (rsp.* iswm $sockname) {
  786.     var %r,%cn $hget($sockname,colour)
  787.     sockread %r
  788.     if ($regex(%r,/<div id="players"><b>(.*)people/i)) {
  789.       $output($hget($sockname,output) $logo(%cn,Rsplayers) There are currently $c2(%3,$regml(1)) $c1(players online))
  790.       hfree $sockname
  791.       sockclose $sockname
  792.     }
  793.   }
  794.   elseif (ls.* iswm $sockname) {
  795.     var %l,%sn $sockname,%cn $hget($sockname,colour)
  796.     sockread %l
  797.     if (*<td class="m">Members</td>* iswm %l) {
  798.       hadd -m $sockname mf M
  799.     }
  800.     if (*<td class="f">Free</td>* iswm %l) {
  801.       hadd -m $sockname mf F
  802.     }
  803.     if (*World*</a>* iswm %l) {
  804.       hadd -m $sockname world $remove($token(%l,3,32),</a>)
  805.       sockread %l
  806.     }
  807.     if (title="Y" isin %l) {
  808.       var %mf $hget($sockname,mf)
  809.       hadd -m $sockname ls $hget($sockname,ls) $+($iif(M isin %mf,`),$c1(%cn,$hget($sockname,world)))
  810.     }
  811.     if (*<br class="clear"/>* iswm %l) {
  812.       tokenize 96 $hget($sockname,ls)
  813.       $output($hget($sockname,output) $logo(%cn,Lootshare worlds) $c2(%cn,F2P:) $c2(%cn,$1 |) $c2(%cn,P2P:) $2-)
  814.       hfree $sockname
  815.       sockclose $sockname
  816.     }
  817.   }  
  818.   elseif (ncheck.* iswm $sockname) {
  819.     var %n,%cn $hget($sockname,colour)
  820.     sockread %n
  821.     if (*NAMECHECK:* iswm %n) {
  822.       $output($hget($Sockname,output) $logo(%cn,Name check) $c2(%cn,$hget($sockname,name)) $c1(%cn,is) $iif(*NOT* iswm %n,$c2(%cn,unavailable),$c2(%cn,available)))
  823.     }
  824.     if (*SUGGESTIONS:* iswm %n) {
  825.       var %b $pos($gettok(%n,2,58),$chr(44),0),%y $replace($gettok(%n,2,58),$chr(44),$chr(124))
  826.       if (%b != 0) {
  827.         $output($hget($Sockname,output) $logo(%cn,Name suggestions) $replace($remtok(%y,$chr(124),%b,124),$chr(124),$chr(44)))
  828.         hfree $sockname
  829.         sockclose $sockname
  830.       }
  831.       else {
  832.         sockclose $sockname
  833.       }
  834.     }
  835.   }
  836.   elseif (ge.* iswm $sockname) {
  837.     var %a,%cn $hget($sockname,colour)
  838.     sockread %a
  839.     if (*No results* iswm %a) {
  840.       $output($hget($sockname,output) $logo(%cn,GE) $c1(%cn,Your Search For) $c2(%cn,$qt($hget($sockname,item))) $c1(%cn,Was Not Found On The Runescape Grand Exchange Database))
  841.       hfree $sockname
  842.       sockclose $sockname
  843.     }
  844.     elseif (*Single-item:* iswm %a) {
  845.       tokenize 124 $gettok(%a,2-,58)
  846.       var %quan $hget($sockname,quan)
  847.       if (%quan) {
  848.         var %min $calc($rp($4)*$v1),%mid $calc($rp($5)*$v1),%max $calc($rp($6)*$v1)),$&
  849.           %minstring $+(12,$bytes(%min,bd)) $c1(%cn,$sn(%min)),$&
  850.           %midstring $+(03,$bytes(%mid,bd)) $c1(%cn,$sn(%mid)),$&
  851.           %maxstring $+(04,$bytes(%max,bd)) $c1(%cn,$sn(%max))
  852.       }  
  853.       $output($hget($sockname,output) $logo(%cn,GE) $c2(%cn,$2) $iif(%quan,$c1(%cn,$+($v1,x))) $c1(%cn,$3) $&
  854.         $iif(%quan,%minstring,$+(12,$4)) $iif(%quan,%midstring,$+(03,$5)) $iif(%quan,%maxstring,$+(04,$6)) $c1(%cn,Today:) $+($iif(*-* iswm $7,04,03),$iif(%quan && $7 != N/A,$+($7 [,$bytes($calc($rp($7) * %quan),bd),]),$7) $&
  855.         $iif(!%quan,$+($c2(%cn,[),$c1(%cn,30 Days:)) $+($iif(*-* iswm $8,4,3),$8) $c1(%cn,90 Days:) $+($iif(*-* iswm $9,4,3),$9) $c1(%cn,180 Days:) $+($iif(*-* iswm $10,4,3),$10,$c2(%cn,])))))
  856.       $output($hget($sockname,output) $logo(%cn,GE) $c1(%cn,Link:) $hlink($+(http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=,$1)))
  857.       hfree $sockname
  858.       sockclose $sockname
  859.     }
  860.     elseif (*@@Multiple Results Displayed:* iswm %a) {
  861.       var %b $c1(%cn,$chr(124)),%quan $hget($sockname,quan)
  862.       while (*:End* !iswm %a) {
  863.         tokenize 124 $iif(*@@Multiple Results Displayed:* !iswm %a,%a)
  864.         hadd $sockname info $hget($sockname,info) $iif($1,$c2(%cn,$1) $c1(%cn,$2) $c2(%cn,$iif(%quan,$bytes($calc($rp($3) * %quan),bd),$3)) $&
  865.           $+($c2(%cn,$chr(40)),$c1(%cn,Today:) $iif(*-* iswm $4,04,03),$4 $iif(%quan && $4 != N/A,$+([,$bytes($calc($rp($4) * %quan),bd),])),$c2(%cn,$chr(41))) %b)
  866.         sockread %a
  867.       }
  868.       if (*:End* iswm %a) && ($hget($sockname,info)) {
  869.         var %end $pos($hget($sockname,info),$chr(124),0)
  870.         $output($hget($sockname,output) $logo(%cn,GE) $c2(%cn,Top Results:) $remtok($hget($sockname,info),$chr(124),%end,124))
  871.         hfree $sockname
  872.         sockclose $sockname
  873.       }
  874.     }
  875.   }
  876.   elseif (cs.* iswm $sockname) {
  877.     var %c,%cn $hget($sockname,colour)
  878.     sockread %c
  879.     if (*CS:* iswm %c) {
  880.       tokenize 124 $token(%c,2-,58)
  881.       var %b $c1(%cn,|)
  882.       $output($hget($sockname,output) $logo(%cn,Coinshare) Item: $c2(%cn,$replace($2,+,$chr(32))) %b People: $c2(%cn,$1) %b Approximate share per person: $c2(%cn,$3))
  883.       hfree $sockname
  884.       sockclose $sockname
  885.     }
  886.     elseif (*@@ERROR:* iswm %c) {
  887.       $output($hget($sockname,output) $logo(%cn,Coinshare) Item not found)
  888.       hfree $sockname
  889.       sockclose $sockname
  890.     }
  891.   }
  892.   elseif (world.* iswm $sockname) {
  893.     var %w,%cn $hget($sockname,colour)
  894.     sockread %w
  895.     if (*World:* iswm %w) {
  896.       tokenize 124 %w
  897.       var %status $+(,$iif(online isin $2,3,4),$2),%b $c1(%cn,|)
  898.       $output($hget($sockname,output) $logo(%cn,$1) $4 $c2(%cn,$3) %b Status: %status %b Players: $c2(%cn,$5) %b Lootshare: $c2(%cn,$6))  
  899.       sockclose $sockname
  900.     }
  901.   }
  902.   elseif (rsnews.* iswm $sockname) {
  903.     var %r,%cn $hget($sockname,colour)
  904.     sockread %r
  905.     if (*Title:* iswm %r) {
  906.       tokenize 124 %r
  907.       $output($hget($sockname,output) $logo(%cn,RsNews) $c2(%cn,$qt($remove($1,Title:))) $c1(%cn,$2) $c2(%cn,$3) $c1(%cn,$4))
  908.       hfree $sockname
  909.       sockclose $sockname
  910.     }
  911.   }
  912.   elseif (st.* iswm $sockname) {
  913.     var %s,%cn $hget($sockname,colour)
  914.     sockread %s
  915.     if (Page isin %s) {
  916.       $output($hget($sockname,output) $logo(%cn,Stats) $c2(%cn,The username) $c1(%cn,$hget($sockname,rsn)) $c2(%cn,was not found in the RuneScape Hiscores.))
  917.       hfree $sockname
  918.       sockclose $sockname
  919.       halt
  920.     }
  921.     if (*,*,* iswm %s) {
  922.       hinc $sockname snum 1
  923.       tokenize 44 %s
  924.       $iif($hget($sockname,hl),hadd $sockname $+($gettok($s1($hget($sockname,snum)),1,32),Rank) $1)
  925.       $iif($hget($sockname,skill) == $s1($hget($sockname,snum)),hadd $sockname skline %s)
  926.       $iif($hget($sockname,cmb) == cmbperc,hadd $sockname expline $hget($sockname,expline) $3)
  927.       hadd $sockname $gettok($s1($hget($sockname,snum)),1,32) $iif($hget($sockname,hl),$3,$2)
  928.     }
  929.     elseif ($hget($sockname,snum) >= 23) {
  930.       var %b $iif($hget($sockname,hl),2,1)
  931.       while (%b <= 26) {
  932.         var %stat $hget($sockname,$gettok($s1(%b),1,32)),%c $token($hget($sockname,elg),2,46),%t $token($hget($sockname,elg),1,46)
  933.         hadd $sockname statsline $hget($sockname,statsline) $iif(-1 !isin %stat,$+($c1(%cn,$gettok($s1(%b),1,32)),$chr(58),$chr(32),$c2(%cn,%stat),$chr(44),$iif(%b <= 25,$c1(%cn,$chr(124))))))
  934.         $iif($hget($sockname,cmb),hadd $sockname cmbline $hget($sockname,cmbline) %stat)
  935.         $iif($hget($sockname,hl),hadd $sockname hline $hget($sockname,hline) $iif(-1 !isin %stat,$+($v2,$chr(96),$gettok($s1(%b),1,32))))
  936.         $iif($hget($sockname,elg),hadd $sockname elgline $hget($sockname,elgline) $iif(%stat %t %c && -1 !isin %stat,$+($c1(%cn,$gettok($s1(%b),1,32)),$chr(58),$chr(32),$c2(%cn,%stat),$chr(44),$iif(%b <= 25,$c1(%cn,$chr(124))))))
  937.         inc %b
  938.       }
  939.       if ($hget($sockname,skill)) {
  940.         if (-1 isin $hget($sockname,skline)) {
  941.           $output($hget($sockname,output) $logo(%cn,Stats) Username $c2(%cn,$qt($hget($sockname,rsn))) $c1(%cn,unranked))
  942.           hfree $sockname        
  943.           sockclose $sockname
  944.           halt
  945.         }
  946.         var %skill $hget($sockname,skill),%dlv $iif(%skill == Dungeoneering,120,99),%rank $gettok($hget($sockname,skline),1,44),%lvl $lvl($gettok($hget($sockname,skline),3,44)),%xp $gettok($hget($sockname,skline),3,44),%next $iif($hget($sockname,goal) != no,$iif($v1 > %lvl,$v1,$calc(%lvl + 1)),$calc(%lvl + 1)),%exptogoal $calc($exp(%lvl)-%xp),%xp2nxt $calc($exp(%next)-%xp)
  947.         $output($hget($sockname,output) $logo(%cn,%skill) $+($c1(%cn,[),$c2(%cn,$hget($sockname,prsn)),$c1(%cn,])) $c1(%cn,Level:) $c2(%cn,$gettok($hget($sockname,skline),2,44)) $iif(%lvl > 99 && !$otherstats(%skill),$c1(%cn,$+([,$v1,]))) $c1(%cn,Exp:) $c2(%cn,$bytes(%xp,bd)) $iif(%skill != overall,$+($c1(%cn,$chr(40)),$&
  948.           $round($calc($iif(%xp == 0,1,$v1) / $iif(%next >= 99,$+(2,$str(0,8)),$exp(%dlv)) *100),2),$&
  949.           % $c1(%cn,of $iif(%next >= %dlv,200m,%dlv)),$chr(41))) $c1(%cn,Rank:) $c2(%cn,$bytes(%rank,bd)) $iif(%skill != overall,$c1(%cn,Experience to %next) $c2(%cn,$bytes(%xp2nxt,bd)) $+($c1(%cn,$chr(40)),$round($calc(%exptogoal / ($exp(%lvl) - $exp(%next))*100),2),% $c1(%cn,of %next),$chr(41))) $&
  950.           $iif($s2(%skill) isnum 1-7,$c1(%cn,| Pc points:) $c2(%cn,$pcpoints(%skill,100,%lvl,%xp2nxt)) $c1(%cn,| Zeal:) $c2(%cn,$soulwars(%skill,%lvl,%xp2nxt))) $iif(!$otherstats(%skill),$c1(%cn,| Penguin points:) $c2(%cn,$ceil($calc(%xp2nxt / (%lvl * 25)))) $c1(%cn,| TOG:) $c2(%cn,$tog(%lvl,%xp2nxt))))
  951.         $iif(%dlv == 99 && !$otherstats(%skill),$output($hget($sockname,output) $logo(%cn,%skill) $c1(%cn,Required for Level:) $c2(%cn,%next) $+($c1(%cn,$chr(40)),$c2(%cn,$bytes(%xp2nxt,bd)) $c1(%cn,$+(exp,$chr(41)))) $skillparams(%cn,%skill,%xp2nxt,%lvl)))))
  952.         hfree $sockname      
  953.         sockclose $sockname
  954.         halt
  955.       }
  956.       elseif ($hget($sockname,cmb) == yes) {
  957.         tokenize 32 $hget($sockname,cmbline)
  958.         var %cmbstats $2 $4 $3 $5-8 $25
  959.         $output($hget($sockname,output) $logo(%cn,Combat) $c2(%cn,$hget($sockname,prsn)) $c1(%cn,is level) $c2(%cn,$cmb(%cmbstats)) $c1(%cn,F2P:) $c2(%cn,$gettok($cmb($gettok(%cmbstats,1-7,32)),1,32)) $c1(%cn,ASDCRPM(SU)) $c2(%cn,$remove(%cmbstats,$chr(45))))
  960.         if ($($+($,nextlevel,$chr(40),%cmbstats,$chr(41),.,%cn),2)) {
  961.           var %v1 $v1
  962.           $output($hget($sockname,output) $logo(%cn,Combat) Next level in: %v1)
  963.         }
  964.         hfree $sockname
  965.         sockclose $sockname
  966.       }
  967.       elseif ($hget($sockname,cmb) == cmbperc) {
  968.         tokenize 32 $hget($sockname,expline)
  969.         var %cmbxp $calc($replace($2-8,$chr(32),+) + $25)
  970.         $output($hget($sockname,output) $logo(%cn,Cmb%) $c2(%cn,$hget($sockname,prsn)) $c1(%cn,has) $c2(%cn,$bytes(%cmbxp,bd)) $c1(%cn,combat exp and) $c2(%cn,$bytes($calc($1 - %cmbxp),bd)) $c1(%cn,skill exp, resulting in a combat percent of) $c2(%cn,$+($round($calc((%cmbxp / $1) *100),2),%)))
  971.         hfree $sockname
  972.         sockclose $sockname
  973.       }
  974.       elseif ($hget($sockname,hl)) {
  975.         var %type $v1,%slvl $sorttok($hget($sockname,hline),32,n),%low $gettok(%slvl,1,32),%high $gettok(%slvl,-1,32)
  976.         var %lowline $+($c1(%cn,[),$c2(%cn,Low),$c1(%cn,])) $c2(%cn,$gettok(%low,2,96)) $c1(%cn,- Lvl:) $c2(%cn,$lvl($gettok(%low,1,96))) $c1(%cn,|) Rank: $&
  977.           $c2(%cn,$bytes($hget($sockname,$+($gettok(%low,2,96),rank)),db))) $c1(%cn,|) Exp: $c2(%cn,$bytes($gettok(%low,1,96),bd)))
  978.         $output($hget($sockname,output) $logo(%cn,$hget($sockname,prsn)) $iif($istok(highlow high,%type,32),$+($c1(%cn,[),$c2(%cn,High),$c1(%cn,])) $c2(%cn,$gettok(%high,2,96)) $&
  979.           $c1(%cn,- Lvl:) $c2(%cn,$lvl($gettok(%high,1,96))) $c1(%cn,|) Rank: $c2(%cn,$bytes($hget($sockname,$+($gettok(%high,2,96),rank)),db)) $c1(%cn,|) Exp: $c2(%cn,$bytes($gettok(%high,1,96),bd)),%lowline))
  980.         $iif(%type == highlow,$output($hget($sockname,output) $logo(%cn,$hget($sockname,prsn)) %lowline))
  981.         hfree $sockname
  982.         sockclose $sockname
  983.       }
  984.       elseif ($hget($sockname,statsline)) {
  985.         if ($hget($sockname,elg) && !$hget($sockname,elgline)) {
  986.           tokenize 46 $hget($sockname,elg)
  987.           $output($hget($sockname,output) $logo(%cn,Stats) No stats $elg($1) $2)
  988.           hfree $sockname
  989.           sockclose $sockname
  990.         }
  991.         else {
  992.           var %line $hget($sockname,$iif($hget($sockname,elgline),elgline,statsline)),$&
  993.             %line $remtok(%line,$numtok(%line,124),124),%elg $elg($token($hget($sockname,elg),1,46)),$&
  994.             %logo $logo(%cn,$+(Stats,$iif(%elg,: %elg $token($hget($sockname,elg),2,46))))
  995.           tokenize 44 %line
  996.           $output($hget($sockname,output) %logo $+($c1(%cn,[),$c2(%cn,$hget($sockname,prsn)),$c1(%cn,])) $1-13)
  997.           $iif($14,$output($hget($sockname,output) $logo(%cn,Stats) $remove($14,$chr(124)) $15-26))  
  998.           hfree $sockname
  999.           sockclose $sockname
  1000.         }
  1001.       }
  1002.     }
  1003.   }
  1004.   elseif (rank.* iswm $sockname) {
  1005.     var %r,%b $c1(%cn,|),%cn $hget($sockname,colour)
  1006.     sockread %r
  1007.     if (*does not exist* iswm %r) {
  1008.       $output($hget($sockname,output) $logo(%cn,Rank) $c1(%cn,specified Rank:) $c2(%cn,$bytes($hget($sockname,position),bd)) $c1(%cn,does not exist.))
  1009.       hfree $sockname
  1010.       sockclose $sockname
  1011.     }
  1012.     if (*RANK:* iswm %r) {
  1013.       tokenize 124 %r
  1014.       $output($hget($sockname,output) $logo(%cn,$gettok($1,2,32)) Rank: $c2(%cn,$2) %b Name: $c2(%cn,$3) %b Exp: $c2(%cn,$5) $+($c1(%cn,[),$c2(%cn,$4),$c1(%cn,])))
  1015.       hfree $sockname
  1016.       sockclose $sockname
  1017.     }
  1018.   }
  1019.   elseif (compare.* iswm $sockname) {
  1020.     var %c,%cn $hget($sockname,colour)
  1021.     sockread %c
  1022.     if (*Invalid Username* iswm %c) {
  1023.       tokenize 58 %c
  1024.       $output($hget($sockname,output) $logo(%cn,Compare) Invalid username: $c2(%cn,$gettok($2,1,32)) $iif($gettok($3,1,32),$c1(%cn,Invalid username:) $c2(%cn,$v1)))
  1025.       hfree $sockname
  1026.       sockclose $sockname
  1027.     }
  1028.     elseif ($+(*,$hget($sockname,skill),*) iswm %c) {
  1029.       tokenize 58 %c
  1030.       var %levels $gettok($3,1,124),%exp $gettok($4,1,124),%rank $gettok($5,1-2,44),$&
  1031.         %user1 $hget($sockname,user1),%user2 $hget($sockname,user2),%luser1 $gettok(%levels,1,44),%luser2 $gettok(%levels,2,44),$&
  1032.         %euser1 $gettok(%exp,1,44),%euser2 $gettok(%exp,2,44),%ruser1 $gettok(%rank,1,44),%ruser2 $gettok(%rank,2,44),$&
  1033.         %complvl $c2(%cn,$calc($iif(%luser1 > %luser2,$v1 - $v2,$v2 - $v1))) $c1(%cn,lvls) $iif(%luser1 > %luser2,3higher,4lower),$&
  1034.         %compexp $c2(%cn,$bytes($calc($iif(%euser1 > %euser2,$v1 - $v2,$v2 - $v1)),bd)) $c1(%cn,exp) $iif(%euser1 > %euser2,3higher,4lower),$&
  1035.         %comprank $c2(%cn,$bytes($calc($iif(%ruser1 > %ruser2,$v1 - $v2,$v2 - $v1)),bd)) $c1(%cn,ranks) $iif(%ruser1 > %ruser2,4lower,3higher)
  1036.       $output($hget($sockname,output) $logo(%cn,Compare) $+([,$c2(%cn,$hget($sockname,skill)),$c1(%cn,])) $+(%user1,:) lvl $+($c2(%cn,%luser1),$c1(%cn,$chr(44))) exp $c2(%cn,$bytes(%euser1,bd)) $c1(%cn,$chr(124) $+(%user2,:) lvl) $+($c2(%cn,%luser2),$c1(%cn,$chr(44))) exp $c2(%cn,$bytes(%euser2,bd)))
  1037.       $output($hget($sockname,output) $logo(%cn,Compare) $c2(%cn,%user1) $c1(%cn,is) %complvl %compexp %comprank $c1(%cn,than) $c2(%cn,%user2))
  1038.       hfree $sockname
  1039.       sockclose $sockname
  1040.     }
  1041.   }
  1042.   elseif (geup.* iswm $sockname) {
  1043.     var %ge,%cn $hget($sockname,colour)
  1044.     sockread %ge
  1045.     if (Update isin %ge) {
  1046.       $output($hget($sockname,output) $logo(%cn,Geupdate) $c1(%cn,The Grand Exchange was last updated:) $c2(%cn,$duration($calc($ctime - $gettok(%ge,2,58)))) $c1(%cn,ago.))
  1047.       hfree $sockname
  1048.       sockclose $sockname
  1049.     }
  1050.   }
  1051.   elseif (clan.* iswm $sockname) {
  1052.     var %c,%cn $hget($sockname,colour)
  1053.     sockread %c
  1054.     if (*@@Not Found* iswm %c) {
  1055.       $output($hget($sockname,output) $logo(%cn,Clan) Your search for $c2(%cn,$hget($Sockname,user)) $c1(%cn,was not found))
  1056.       hfree $sockname
  1057.       sockclose $sockname
  1058.       halt
  1059.     }
  1060.     if (*http://* iswm %c) {
  1061.       while ($sock($sockname).rq) {
  1062.         if (*@@end* iswm %c) {
  1063.           break
  1064.         }
  1065.         hadd $sockname info $remove($hget($sockname,info),@@start) $+($gettok($v2,1,124),$chr(44))
  1066.         var %a %a $v2  
  1067.         sockread %c
  1068.       }
  1069.     }
  1070.     if (*@@end* iswm %c) {
  1071.       var %n $pos($hget($sockname,info),$chr(44),0),%clanstring $remtok($hget($sockname,info),$chr(44),%n,44)
  1072.       $output($hget($sockname,output) $logo(%cn,Clan) $c2(%cn,$hget($sockname,user)) $c1(%cn,is in) $c2(%cn,%n) $c1(%cn,clans) $c2(%cn,%clanstring) $&
  1073.         $c1(%cn,$chr(124) Link:) $hlink($+(http://runehead.com/clans/search.php?search=,$replace($hget($sockname,user),_,$+($chr(37),$chr(65),$chr(48)))))))
  1074.       hfree $sockname
  1075.       sockclose $sockname
  1076.     }
  1077.   }
  1078.   elseif (ml.* iswm $sockname) {
  1079.     var %m,%cn $hget($sockname,colour)
  1080.     sockread %m
  1081.   }
  1082.   if (*@@start* iswm %m) {
  1083.     var %m,%br $c1(%cn,$chr(124)),%cn $hget($sockname,colour)
  1084.     sockread %m
  1085.     tokenize 124 %m
  1086.     if (*@@Not Found* iswm $1) {
  1087.       $output($hget($sockname,output) $logo(%cn,Clan Info) $c2(%cn,$hget($sockname,clan)) $c1(%cn,Does not appear to be a valid Runehead memberlist))
  1088.       hfree $sockname
  1089.       sockclose $sockname
  1090.       halt
  1091.     }
  1092.     else {
  1093.       $output($hget($sockname,output) $logo(%cn,Clan Info) $+($c1(%cn,[),$c2(%cn,$5),$c1(%cn,])) $c2(%cn,$1) $+($c1(%cn,$chr(40)),$c2(%cn,$2),$c1(%cn,$chr(41))) %br $&
  1094.         Members: $c2(%cn,$6) %br Average: F2P: $c2(%cn,$16) $c1(%cn,P2P:) $c2(%cn,$7) $c1(%cn,HP:) $c2(%cn,$8) $c1(%cn,Mage:) $c2(%cn,$10) $c1(%cn,Range:) $c2(%cn,$11) $c1(%cn,Total:) $c2(%cn,$9) %br $&
  1095.         $c2(%cn,$12) $c1(%cn,based, Homeworld:) $c2(%cn,$15) %br Cape: $c2(%cn,$14) %br Category: $c2(%cn,$4) %br RHlink: $hlink($3))
  1096.       hfree $sockname
  1097.       sockclose $sockname
  1098.     }
  1099.   }
  1100.   elseif (alog.* iswm $sockname) {
  1101.     var %a,%cn $hget($sockname,colour)
  1102.     sockread %a
  1103.     if (*@@Not found* iswm %a) {
  1104.       $output($hget($sockname,output) $logo(%cn,Alog) $c2(%cn,$qt($hget($sockname,rsn))) $c1(%cn,does not exist))
  1105.       hfree $sockname
  1106.       sockclose $sockname
  1107.       halt
  1108.     }
  1109.     elseif (*@@Non member* iswm %a) {
  1110.       $output($hget($sockname,output) $logo(%cn,Alog) $c2(%cn,$qt($hget($sockname,rsn))) $c1(%cn,Has settings set to private or is a non member))
  1111.       hfree $sockname
  1112.       sockclose $sockname
  1113.       halt
  1114.     }
  1115.     elseif (*ALOG:* iswm %a) {
  1116.       while ($sock($sockname).rq) {
  1117.         if (*End@@* iswm %a) {
  1118.           break
  1119.         }
  1120.         hadd $sockname info $remove($hget($sockname,info),ALOG:~,.) $+($gettok($v2,1,64),$chr(126))
  1121.         sockread %a
  1122.       }
  1123.     }
  1124.     if (*End@@* iswm %a) {
  1125.       var %b $pos($hget($sockname,info),$chr(126),0)
  1126.       $output($hget($sockname,output) $logo(%cn,Alog) $c2(%cn,$hget($Sockname,rsn)) $c1(%cn,$replace($remtok($hget($sockname,info),$chr(126),%b,126),$chr(126),$chr(44))))
  1127.       hfree $sockname
  1128.       sockclose $sockname
  1129.     }
  1130.   }
  1131.   elseif (npcid.* iswm $sockname) {
  1132.     var %a,%cn $hget($sockname,colour)
  1133.     sockread %a
  1134.     var %b $+(*,$replace($gettok($hget($sockname,search),2-3,43),+,$chr(32)),*),%m2 $+(npc.,$right($sockname,5))
  1135.     if ($+(*,<a href="?rs2monster_id=*">,%b,</a></td>,*) iswm %a) {
  1136.       hadd -m $sockname monster $remove($gettok(%a,3,62),</a)
  1137.       hadd -m %m2 id $gettok($replace($nohtml($gettok(%a,3,61)),",$chr(32),>,),1,32)
  1138.       sockread %a
  1139.       hadd $sockname Race $nohtml(%a)
  1140.       sockread %a
  1141.       hadd $sockname members $nohtml(%a)
  1142.       sockread %a
  1143.       hadd $sockname Quest $nohtml(%a)
  1144.       sockread %a
  1145.       hadd $sockname Ratio $nohtml(%a)
  1146.       sockread %a
  1147.       hadd $sockname HP $nohtml(%a)
  1148.       sockopen %m2 www.tip.it 80
  1149.       sockclose $sockname  
  1150.     }
  1151.     if (*</body>* iswm %a) {
  1152.       $output($hget($sockname,output) $logo(%cn,Npc) $c1(%cn,Your search for) $c2(%cn,$replace($hget($sockname,search),+,$chr(32))) $c1(%cn,didn't return any results.))
  1153.       hfree $sockname
  1154.       sockclose $sockname
  1155.       halt
  1156.     }
  1157.   }
  1158.   elseif (npc.* iswm $sockname) {
  1159.     var %c $+(npcid.,$right($sockname,5)),%cn $hget($sockname,colour),%a
  1160.     sockread %a
  1161.     if (*Level:* iswm %a) {
  1162.       var %a
  1163.       sockread %a
  1164.       hadd $sockname level $nohtml(%a)
  1165.     }
  1166.     elseif (*Aggressive?* iswm %a) {
  1167.       hadd $sockname Aggressive $nohtml(%a)
  1168.     }
  1169.     elseif (*Retreats?* iswm %a) {
  1170.       hadd $sockname Retreats $nohtml(%a)
  1171.     }
  1172.     elseif (*Poisonous?* iswm %a) {
  1173.       hadd $sockname poison $nohtml(%a)
  1174.     }
  1175.     elseif (*habitat:* iswm %a) {
  1176.       var %a
  1177.       sockread %a
  1178.       hadd $sockname habitat $nohtml(%a)
  1179.       $output($hget(%c,output) $logo(%cn,Npc) $hget(%c,monster) $c2(%cn,Lvl:) $c1(%cn,$hget($sockname,level)) $c2(%cn,HP:) $c1(%cn,$hget(%c,hp)) $c2(%cn,Ratio:) $c1(%cn,$hget(%c,Ratio)) $c2(%cn,Race) $c1(%cn,$hget(%c,race)) $&
  1180.         $iif(*yes* iswm $hget($sockname,poison),3Poisonous) $iif(*yes* iswm $hget($sockname,aggressive),4+Aggressive,3Non Aggressive) $iif(*yes* iswm $hget(%c,members),10P2P,12F2P))
  1181.       $output($hget(%c,output) $logo(%cn,Npc) $c2(%cn,Location:) $c1(%cn,$hget($sockname,habitat)) $c2(%cn,Link:) $hlink($+(http://www.tip.it/runescape/index.php?rs2monster_id=,$hget($sockname,id))))
  1182.       hfree %c
  1183.       hfree $sockname
  1184.       sockclose $sockname
  1185.     }
  1186.   }
  1187.   elseif (quest.* iswm $sockname) {
  1188.     var %q,%cn $hget($sockname,colour)
  1189.     sockread %q
  1190.     if (*@@Error* iswm %q) {
  1191.       $output($hget($sockname,output) $logo(%cn,Quest) $c1(%cn,Quest not found in database))
  1192.       hfree $sockname
  1193.       sockclose $sockname
  1194.       halt
  1195.     }
  1196.     elseif (*ID:* iswm %q) {
  1197.       hadd $sockname link $c1(%cn,Link:) $hlink($+(http://www.tip.it/runescape/index.php?rs2quest_id=,$gettok(%q,2,58)))
  1198.     }
  1199.     elseif (*NAME:* iswm %q) {
  1200.       hadd $sockname name $c2(%cn,$gettok(%q,2,58))
  1201.     }
  1202.     elseif (*DIFFICULTY:* iswm %q) {
  1203.       hadd $sockname difficulty $c1(%cn,Difficulty:) $c2(%cn,$gettok(%q,2,58))  
  1204.     }
  1205.     elseif (*QP:* iswm %q) {
  1206.       hadd $sockname qp $c1(%cn,QP:) $c2(%cn,$gettok(%q,2,58))  
  1207.     }
  1208.     elseif (*REWARD:* iswm %q) {
  1209.       $output($hget($sockname,output) $logo(%cn,Quest) $hget($sockname,name) $c1(%cn,|) $hget($sockname,difficulty) $c1(%cn,|) $hget($sockname,qp) $c1(%cn,|) $c2(%cn,$hget($sockname,link)))
  1210.       $output($hget($sockname,output) $logo(%cn,Quest Rewards) $replace($gettok(%q,2-,58),experience,XP))
  1211.       hfree $sockname
  1212.       sockclose $sockname
  1213.       halt
  1214.     }
  1215.   }
  1216.   elseif (item.* iswm $sockname) {
  1217.     var %i,%cn $hget($sockname,colour)
  1218.     sockread %i
  1219.     if (*@@Error* iswm %i) {
  1220.       $output($hget($sockname,output) $logo(%cn,item) $c1(%cn,Item not found in database))
  1221.       hfree $sockname
  1222.       sockclose $sockname
  1223.       halt
  1224.     }
  1225.     elseif (*ID:* iswm %i) {
  1226.       hadd $sockname link $c1(%cn,Link:) $c2(%cn,$+(http://www.tip.it/runescape/index.php?rs2item_id=,$gettok(%i,2,58)))
  1227.     }
  1228.     elseif (*NAME:* iswm %i) {
  1229.       hadd $sockname name $c2(%cn,$gettok(%i,2,58))
  1230.     }
  1231.     elseif (*MEMBERS:* iswm %i) {
  1232.       hadd $sockname members $c2(%cn,$iif(*yes* iswm $gettok(%i,2,58),2[M],10[F]))
  1233.     }
  1234.     elseif (*QUEST:* iswm %i) {
  1235.       hadd $sockname quest $iif(*yes* iswm $gettok(%i,2,58),3Quest,4Non-Quest)
  1236.     }
  1237.     elseif (*TRADE:* iswm %i) {
  1238.       hadd $sockname trade $iif(*yes* iswm $gettok(%i,2,58),3Tradeable,4Non-Tradeable)
  1239.     }
  1240.     elseif (*STACK:* iswm %i) {
  1241.       hadd $sockname stack $iif(*yes* iswm $gettok(%i,2,58),3Stacks,4Non-Stackable)
  1242.     }
  1243.     elseif (*LOCATION:* iswm %i) {
  1244.       hadd $sockname location $gettok(%i,2,58)
  1245.     }
  1246.     elseif (*EQUIP:* iswm %i) {
  1247.       $output($hget($sockname,output) $logo(%cn,Item) $hget($sockname,members) $hget($sockname,name) $c1(%cn,|) $hget($sockname,quest) $c1(%cn,|) $&
  1248.         $hget($sockname,trade) $c1(%cn,|) $hget($sockname,stack) $c1(%cn,|) $c2(%cn,$iif(*Equipable* iswm $gettok(%i,2,58),Equipable,Non-Equipable)) $&
  1249.         $c1(%cn,|) $hget($sockname,location) $c1(%cn,||) $hget($Sockname,link))
  1250.     }
  1251.     if (*@@STATS* iswm %i) {
  1252.       if (*None* iswm %i) {
  1253.         hfree $sockname
  1254.         sockclose $sockname
  1255.         halt
  1256.       }
  1257.       elseif (*STAB:* iswm %i) {
  1258.         tokenize 32 %i  
  1259.         var %sta $c2(%cn,$gettok($gettok($2,2,58),1,124)),%std $c2(%cn,$gettok($gettok($2,2,58),2,124)),%sla $c2(%cn,$gettok($gettok($3,2,58),1,124)),%sld $c2(%cn,$gettok($gettok($3,2,58),2,124)), $&
  1260.           %cra $c2(%cn,$gettok($gettok($4,2,58),1,124)),%crd $c2(%cn,$gettok($gettok($4,2,58),2,124)),%ma $c2(%cn,$gettok($gettok($5,2,58),1,124)),%md $c2(%cn,$gettok($gettok($5,2,58),2,124)), $&
  1261.           %ra $c2(%cn,$gettok($gettok($6,2,58),1,124)),%rd $c2(%cn,$gettok($gettok($6,2,58),2,124))
  1262.         $output($hget($sockname,output) $logo(%cn,iStats) Stab: $c1(%cn,Att:) %sta $c1(%cn,Def:) %std $c1(%cn,|) Slash: Att: %sla $c1(%cn,Def:) %sld $c1(%cn,|) Crush: Att: %cra $c1(%cn,Def:) %crd $c1(%cn,|) $&
  1263.           Magic: Att: %ma $c1(%cn,Def:) %md $c1(%cn,|) Range: Att: %ra $c1(%cn,Def:) %rd $c1(%cn,|) Summoning: $c2(%cn,$gettok($7,2,58)) $c1(%cn,|) Strength: $&
  1264.           $c2(%cn,$iif(*shared* iswm $gettok($8,2,58),Shared,$v2)) $c1(%cn,|) Prayer: $c2(%cn,$gettok($9,2,58)) $c1(%cn,|) Ranged Strength: $c2(%cn,$gettok($10,2,58)))
  1265.         hfree $sockname
  1266.         sockclose $sockname
  1267.         halt
  1268.       }
  1269.     }
  1270.   }
  1271.   elseif (alch.* iswm $sockname) {
  1272.     var %a,%cn $hget($sockname,colour)
  1273.     sockread %a
  1274.     if (*@@Error* iswm %a) {
  1275.       $output($hget($sockname,output) $logo(%cn,Alch) $c1(%cn,Item not found in database))
  1276.       hfree $sockname
  1277.       sockclose $sockname
  1278.       halt
  1279.     }
  1280.     if (*NAME:* iswm %a) {
  1281.       hadd $sockname name $c2(%cn,$gettok(%a,2,58))
  1282.     }
  1283.     elseif (*HIGH:* iswm %a) {
  1284.       hadd $sockname high $c2(%cn,$gettok(%a,2,58))
  1285.     }
  1286.     elseif (*LOW:* iswm %a) {
  1287.       $output($hget($sockname,output) $logo(%cn,Alch) $hget($sockname,name) $c1(%cn,High:) $hget($sockname,high) $c1(%cn,Low:) $c2(%cn,$gettok(%a,2,58)))
  1288.       hfree $sockname
  1289.       sockclose $sockname
  1290.       halt
  1291.     }
  1292.   }
  1293.   elseif (tracker.* iswm $sockname) {
  1294.     var %t,%cn $hget($sockname,colour)
  1295.     sockread %t
  1296.     if (*END* iswm %t) {
  1297.       $output($hget($sockname,output) $logo(%cn,Track) $c1(%cn,$hget($sockname,nick)) $c2(%cn,Invalid username))
  1298.       hfree $sockname
  1299.       sockclose sockname
  1300.       halt
  1301.     }
  1302.     if (*START* iswm %t) {
  1303.       var %t
  1304.       sockread %t
  1305.       if (*start:* iswm %t) {
  1306.         while ($sock($sockname).rq) {
  1307.           if (*started:* iswm %t) {
  1308.             break
  1309.           }
  1310.           var %v $replace($v2,:,$chr(32),start,)
  1311.           hadd $sockname $+(start.,$gettok(%v,1,32)) $hget($sockname,$+(start.,$gettok(%v,1,32))) $gettok($v2,3,58)
  1312.           hinc $sockname $+(start.,total) $iif(!$otherstats($v2),$iif($lvl($gettok(%v,2,32)) <= 99,$v1,99))
  1313.           sockread %t
  1314.         }
  1315.       }
  1316.       if (*started:* iswm %t) {
  1317.         var %t
  1318.         sockread %t
  1319.         if (*gain:* iswm %t) {
  1320.           while ($sock($sockname).rq) {
  1321.             if (*END* iswm %t) {
  1322.               break
  1323.             }
  1324.             var %v $replace($v2,:,$chr(32),gain,)
  1325.             hadd $sockname $+(gain.,$gettok(%v,1,32)) $hget($sockname,$+(gain.,$gettok(%v,1,32))) $calc($hget($sockname,$+(start.,$gettok(%v,1,32))) - $gettok($v2,4,58))
  1326.             hinc $sockname $+(gain.,total) $iif(!$otherstats($v2),$iif($lvl($calc($hget($sockname,$+(start.,$gettok(%v,1,32))) - $gettok(%v,3,32))) <= 99,$v1,99))
  1327.             sockread %t
  1328.           }
  1329.         }
  1330.         if (*END* iswm %t) {
  1331.           var %x 2
  1332.           while (%x <= 26) {
  1333.             var %a %a $iif($hget($sockname,$+(start.,$s1(%x))) > $hget($sockname,$+(gain.,$s1(%x))),$+($c2(%cn,$s1(%x)),$c1(%cn,$chr(40)),$c1(%cn,$lvl($hget($sockname,$+(gain.,$s1(%x))))),$&
  1334.               $iif($lvl($hget($sockname,$+(start.,$s1(%x)))) != $lvl($hget($sockname,$+(gain.,$s1(%x)))),$iif($lvl($hget($sockname,$+(start.,$s1(%x)))) > 0,$+(->,$lvl($hget($sockname,$+(start.,$s1(%x))))))),$chr(41)) $&
  1335.               $c2(%cn,$+(+,$bytes($calc($hget($sockname,$+(start.,$s1(%x))) - $hget($sockname,$+(gain.,$s1(%x)))),bd))) $c2(%cn,|))
  1336.             inc %x
  1337.           }
  1338.           if (!$gettok(%a,1-,124)) {
  1339.             $output($hget($sockname,output) $logo(%cn,Track) $hget($sockname,pnick) has gained no xp over $c2(%cn,$hget($sockname,t)))
  1340.             hfree $sockname
  1341.             sockclose $sockname
  1342.           }
  1343.           var %os $hget($sockname,$+(start.,total)),%og $hget($sockname,$+(gain.,total)),%overall $iif($calc(%os - %og) > 1,$+(+,$v1))
  1344.           $output($hget($sockname,output) $logo(%cn,Track) Exp gains for $c1(%cn,$hget($sockname,pnick)) $c2(%cn,in last $hget($sockname,t)) $&
  1345.             Overall: %overall $iif($calc($hget($sockname,$+(start.,overall)) - $hget($sockname,$+(gain.,overall))) > 1,$c1(%cn,$+(+,$bytes($v1,bd)))) $gettok(%a,1-8,124))
  1346.           $iif($numtok(%a,124) > 8, $output($hget($sockname,output) $logo(%cn,Track) $gettok(%a,9-17,124)))
  1347.           $iif($numtok(%a,124) > 18, $output($hget($sockname,output) $logo(%cn,Track) $gettok(%a,18-,124)))
  1348.           $output($hget($sockname,output) $logo(%cn,Graph) $hlink($+(http://runetracker.org/track-,$hget($sockname,nick))))
  1349.           hfree $sockname
  1350.           sockclose $sockname
  1351.           Halt
  1352.         }  
  1353.       }
  1354.     }
  1355.   }
  1356.   elseif (track.* iswm $sockname) {
  1357.     var %r,%cn $hget($sockname,colour)
  1358.     sockread %r
  1359.     if (*Invalid argument* iswm %r) {
  1360.       $output($hget($sockname,output) $logo(%cn,Track) $c1(%cn,$hget($sockname,nick)) $c2(%cn,Is an invalid username))
  1361.       hfree $sockname
  1362.       sockclose $sockname
  1363.     }
  1364.     if (*started:* iswm %r) {
  1365.       var %x $gettok(%r,2,58)
  1366.     }
  1367.     if (0:* iswm %r) {
  1368.       if (-1 isin $gettok(%r,2,58)) {
  1369.         $output($hget($sockname,output) $logo(%cn,Track) $c1(%cn,$hget($sockname,nick)) $c2(%cn,invalid username))
  1370.         hfree $sockname
  1371.         sockclose $sockname
  1372.       }
  1373.       else {
  1374.         hadd $sockname xp $gettok(%r,2,58)
  1375.       }
  1376.     }
  1377.     if (2419200:* iswm %r) {
  1378.       var %plvl $lvl($calc($hget($sockname,xp) - $gettok(%r,2,58))), %lvl $lvl($hget($sockname,xp)),%skill $hget($sockname,skill)
  1379.       hadd $sockname month $bytes($gettok(%r,2,58),bd) $iif(!$otherstats(%skill),$iif(%plvl < %lvl,$+(%plvl,->,%lvl),%lvl))
  1380.     }
  1381.     if ($+($hget($sockname,time),:,*) iswm %r) {
  1382.       hadd $sockname Gain $gettok(%r,2,58)
  1383.       if ($gettok(%r,2,58) == 0) {
  1384.         $output($hget($sockname,output) $logo(%cn,Track) $c1(%cn,$hget($sockname,pnick)) $c2(%cn,has gained no exp in) $&
  1385.           $c1(%cn,$hget($sockname,skill)) $c2(%cn,for) $c1(%cn,$hget($sockname,t)))
  1386.         hfree $sockname
  1387.         sockclose $sockname
  1388.       }
  1389.       else {
  1390.         var %plvl $lvl($calc($hget($sockname,xp) - $hget($sockname,Gain))),%lvl $lvl($hget($sockname,xp)),%skill $hget($sockname,skill)
  1391.         $output($hget($sockname,output) $logo(%cn,Track) $c1(%cn,%skill) $c2(%cn,exp achieved by) $c1(%cn,$hget($sockname,pnick)) $&
  1392.           $c2(%cn,in the last $+($hget($sockname,t),:)) $c1(%cn,$+(+,$bytes($hget($sockname,Gain),bd))) $&
  1393.           $iif(!$otherstats(%skill),$c1(%cn,|) $c2(%cn,lvl:) $c1(%cn,$iif(%plvl < %lvl,$+(%plvl,$chr(45),$chr(62),%lvl),%lvl)))))
  1394.         $output($hget($sockname,output) $logo(%cn,Track) $c2(%cn,Graph:) $hlink($+(http://runetracker.org/track-,$hget($sockname,nick))) $&
  1395.           $iif($hget($sockname,month),$c1(%cn,Month:) $c2(%cn,$v1)))
  1396.         hfree $sockname      
  1397.         sockclose $sockname
  1398.       }
  1399.     }
  1400.   }
  1401.   elseif (rswiki.* iswm $sockname) {
  1402.     var %r,%x $hget($sockname,query),%cn $hget($sockname,colour)
  1403.     sockread %r
  1404.     if (*RSWIKI:* iswm %r) {
  1405.       tokenize 32 $token(%r,2,58)
  1406.       $output($hget($sockname,output) $logo(%cn,Rswiki: %x) $1-50)
  1407.       $output($hget($sockname,output) $logo(%cn,Rswiki) $iif($51,$c1(%cn,$51- $chr(124))) $c2(%cn,Link:) $hlink($+(http://runescape.wikia.com/wiki/,$fname(%x))))
  1408.       hfree $sockname
  1409.       sockclose $sockname
  1410.     }
  1411.     elseif (*NOT FOUND* iswm %r) {
  1412.       $output($hget($sockname,output) $logo(%cn,Rswiki) Query: $c2(%cn,$qt(%x)) $c1(%cn,Not Found))  
  1413.       hfree $sockname
  1414.       sockclose $sockname
  1415.     }
  1416.   }
  1417.   elseif (fml.* iswm $sockname) {
  1418.     var %f,%cn $hget($sockname,colour)
  1419.     sockread %f
  1420.     if (*Today,* iswm %f) {
  1421.       hadd $sockname fml %f
  1422.     }
  1423.     elseif (*AGREE:* iswm %f) {
  1424.       hadd $sockname agree $gettok(%f,2,58)
  1425.     }
  1426.     elseif (*DESERVED:* iswm %f) {
  1427.       hadd $sockname deserve $gettok(%f,2,58)
  1428.     }
  1429.     elseif (*COMMENTS:* iswm %f) {
  1430.       $output($hget($sockname,output) $logo(%cn,FML) $c1(%cn,$hget($sockname,fml)) $c1(%cn,||) $c2(%cn,Agree:) $c1(%cn,$hget($sockname,agree)) $&
  1431.         $c2(%cn,Deserved:) $c1(%cn,$hget($sockname,deserve)) $c2(%cn,Comments:) $c1(%cn,$gettok(%f,2,58)))
  1432.       hfree $sockname
  1433.       sockclose $sockname
  1434.     }
  1435.   }
  1436.   elseif (tfln.* iswm $sockname) {
  1437.     var %t,%cn $hget($sockname,colour)
  1438.     sockread %t
  1439.     if (*TFLN:* iswm %t) {
  1440.       tokenize 58 %t
  1441.       $output($hget($sockname,output) $logo(%cn,TFLN) $c2(%cn,$replace($2,$chr(40),[,$chr(41),],$chr(32),)) $c1(%cn,$3))
  1442.       hfree $sockname
  1443.       sockclose $sockname
  1444.     }
  1445.   }
  1446.   elseif (bash.* iswm $sockname) {
  1447.     var %b,%cn $hget($sockname,colour)
  1448.     sockread %b
  1449.     if (*Does Not exist* iswm %b) {
  1450.       $output($hget($sockname,output) $logo(%cn,Bash) Quote: $qt($hget($sockname,id)))
  1451.       hfree $sockname
  1452.       sockclose $sockname
  1453.     }
  1454.     if (*Number only please* iswm %b) {
  1455.       $output($hget($sockname,output) $logo(%cn,Bash) $c1(%cn,Correct syntax:) $c2(%cn,!bash #number))
  1456.       hfree $sockname
  1457.       sockclose $sockname
  1458.     }
  1459.     if (*QUOTE:* iswm %b) {
  1460.       hadd $sockname quote $remove($replace($gettok(%b,2-,58),lt,<,gt,>,","),&,;)
  1461.     }
  1462.     if (*ID:* iswm %b) {
  1463.       hadd $sockname quoteid $gettok(%b,2,58)
  1464.     }
  1465.     if (*RATING:* iswm %b) {
  1466.       $output($hget($sockname,output) $logo(%cn,Bash) $hget($sockname,quote) $c2(%cn,Rating:) $c1(%cn,$gettok(%b,2,58)) $c2(%cn,ID:) $c1(%cn,$hget($sockname,quoteid)))
  1467.       hfree $sockname
  1468.       sockclose $sockname
  1469.     }
  1470.   }
  1471.   elseif (urban.* iswm $sockname) {
  1472.     var %u,%cn $hget($sockname,colour)
  1473.     sockread %u
  1474.     if (*Word not found* iswm %u) {
  1475.       $output($hget($sockname,output) $logo(%cn,Urban) $c2(%cn,$qt($hget($sockname,word))) $c1(%cn,Not found in the urban dictionary))
  1476.       hfree $sockname
  1477.       sockclose $sockname
  1478.     }
  1479.     elseif (*URBAN:* iswm %u) {
  1480.       $output($hget($sockname,output) $logo(%cn,Urban) $c2(%cn,$qt($hget($sockname,word))) $c1(%cn,$regsubex($gettok(%u,2-,58),/^(.)/S,$upper(\t))))
  1481.       hfree $sockname
  1482.       sockclose $sockname
  1483.     }
  1484.   }
  1485.   elseif (halo.* iswm $sockname) {
  1486.     var %h,%cn $hget($sockname,colour)
  1487.     sockread %h
  1488.     if (*HALO3:* iswm %h) {
  1489.       if (*not found* iswm %h) || ($+(*,$str(|,8),*) iswm %h) {
  1490.         $output($hget($Sockname,output) $logo(%cn,Halo3) $c1(%cn,No information was found for) $c2(%cn,$qt($hget($sockname,user))))
  1491.         hfree $sockname
  1492.         sockclose $sockname
  1493.       }
  1494.       else {
  1495.         var %b $c1(%cn,$chr(124))
  1496.         tokenize 124 %h
  1497.         $output($hget($Sockname,output) $logo(%cn,Halo3) $c2(%cn,$replace($hget($sockname,user),+,$chr(32))) $c1(%cn,$remove($1,HALO3:)) $&
  1498.           %b $c1(%cn,Highest skill:) $c2(%cn,$2) %b $c1(%cn,Total exp:) $c2(%cn,$4) %b $c1(%cn,Next:) $c2(%cn,$9) %b $c1(%cn,Total Games:) $c2(%cn,$3))
  1499.         $output($hget($Sockname,output) $logo(%cn,Halo3) $c1(%cn,Ranked:) $c2(%cn,$5) %b $c1(%cn,Social:) $c2(%cn,$6) %b $c1(%cn,Custom:) $c2(%cn,$7) $&
  1500.           %b $c1(%cn,Campaign:) $c2(%cn,$8) %b $c1(%cn,Link:) $hlink($+(http://www.bungie.net/stats/halo3/careerstats.aspx?player=,$hget($sockname,user))))
  1501.         hfree $sockname
  1502.         sockclose $sockname
  1503.       }
  1504.     }
  1505.   }
  1506.   elseif (xbl.* iswm $sockname) {
  1507.     var %x,%cn $hget($sockname,colour)
  1508.     sockread %x
  1509.     if (*@@Does Not Exist* iswm %x) {
  1510.       $output($hget($Sockname,output) $logo(%cn,Xbl) Gamertag $c2(%cn,$qt($hget($sockname,user))) $c1(%cn,does not exist))
  1511.       hfree $sockname
  1512.       sockclose $sockname
  1513.     }
  1514.     elseif (*@@privacy settings turned on* iswm %x) {
  1515.       $output($hget($Sockname,output) $logo(%cn,Xbl) $c2(%cn,$qt($hget($sockname,user))) $c1(%cn,has privacy settings enabled))
  1516.       hfree $sockname
  1517.       sockclose $sockname
  1518.     }
  1519.     elseif (*GAMERTAG:* iswm %x) {
  1520.       hadd $sockname tag $gettok(%x,2,58)
  1521.     }
  1522.     elseif (*REP:* iswm %x) {
  1523.       hadd $sockname rep $gettok(%x,2,58)
  1524.     }
  1525.     elseif (*GAMERSCORE:* iswm %x) {
  1526.       hadd $sockname gs $gettok(%x,2,58)
  1527.     }
  1528.     elseif (*LOCATION:* iswm %x) {
  1529.       hadd $sockname loc $gettok(%x,2,58)
  1530.     }
  1531.     elseif (*ZONE:* iswm %x) {
  1532.       hadd $sockname zone $gettok(%x,2,58)
  1533.     }
  1534.     elseif (*STATUS:* iswm %x) {
  1535.       hadd $sockname status $gettok(%x,2,58)
  1536.     }
  1537.     elseif (*LAST SEEN:* iswm %x) {
  1538.       var %b $c1(%cn,|),%rep $hget($sockname,rep)
  1539.       $output($hget($sockname,output) $logo(%cn,3Xbox 7Live) $c2(%cn,$hget($sockname,tag)) %b Gamerscore: $c2(%cn,$hget($sockname,gs)) %b Rep: $stars(%cn,xbl,$remove(%rep,%),%rep) $&
  1540.         Location: $c2(%cn,$hget($sockname,loc)) %b Zone: $c2(%cn,$hget($sockname,zone)) %b Status $c2(%cn,$hget($sockname,status)) $&
  1541.         $c1(%cn,$iif($hget($sockname,status) == offline,Last seen:,currently)) $c2(%cn,$gettok(%x,2-,58)))
  1542.       hfree $sockname
  1543.       sockclose $sockname
  1544.     }
  1545.   }
  1546.   elseif (gf.* iswm $sockname) {
  1547.     var %g,%cn $hget($sockname,colour)
  1548.     sockread %g
  1549.     if (*W1:* iswm %g) {
  1550.       hadd $sockname results1 $gettok(%g,3,58)
  1551.     }
  1552.     if (*W2:* iswm %g) {
  1553.       if (($gettok(%g,2,58) && $hget($sockname,results1) !isnum)) {
  1554.         $output($hget($sockname,output) $logo(%cn,Googlefight) Both $c2(%cn,$hget($sockname,word1)) $c1(%cn,and) $c2(%cn,$hget($sockname,word2)) $c1(%cn,Returned) $c2(%cn,0) $c1(%cn,Results))
  1555.         hfree $sockname
  1556.         sockclose $sockname
  1557.       }
  1558.       else {
  1559.         var %a $hget($sockname,results1),%b $gettok(%g,2,58),%sort $sorttok(%a %b,32,nr),$&
  1560.           %c $c2(%cn,$iif(%a == $gettok(%sort,1,32),$hget($sockname,word1),$hget($sockname,word2))) $c1(%cn,won by:) $c2(%cn,$bytes($calc($gettok(%sort,1,32) - $gettok(%sort,2,32)),bd))
  1561.         $output($hget($sockname,output) $logo(%cn,Googlefight) $hget($sockname,word1) has $c2(%cn,$bytes(%a,bd)) $c1(%cn,results while $hget($sockname,word2) has) $c2(%cn,$bytes(%b,bd)) $c1(%cn,results.))
  1562.         $output($hget($sockname,output) $logo(%cn,Googlefight) $iif(%a == %b,$c2(%cn,Result:) $c1(%cn,Draw, both received an equal number of results),Winner: %c $c1(%cn,results.)))  
  1563.         hfree $sockname
  1564.         sockclose $sockname
  1565.       }
  1566.     }
  1567.   }
  1568.   elseif (ytinfo.* iswm $sockname) {
  1569.     var %y,%cn $hget($sockname,colour)
  1570.     sockread %y
  1571.     if (*Video not found* iswm %y) {
  1572.       $output($hget($sockname,output) $logo(%cn,Youtube) No Video results found)
  1573.       hfree $sockname
  1574.       sockclose $sockname
  1575.     }
  1576.     elseif (*Title* iswm %y) {
  1577.       tokenize 124 %y
  1578.       var %b $c1(%cn,|),%title $gettok($1,2,58),%length $gettok($2,2-3,58),%rating $remove($gettok($3,2,58),$chr(32)),%views $remove($gettok($4,2,58),$chr(32)),%ratings $remove($gettok($5,2,58),$chr(32)),%meh %y
  1579.       $output($hget($sockname,output) $logo(%cn,$+(,$c2(%cn,You),0,$chr(44),4tube,$chr(15))) $c1(%cn,Title:) $c2(%cn,%title) %b $c1(%cn,Duration:) $c2(%cn,%length) %b $c1(%cn,Rating:) $stars(%cn,yt,%rating,%rating) %b $&
  1580.         $c1(%cn,Views:) $c2(%cn,$+(%views,$c1(%cn,$+($chr(40),$iif(%ratings,$v1,0) ratings,$chr(41))))))  
  1581.       hfree $sockname
  1582.       sockclose $sockname
  1583.     }
  1584.   }
  1585.   elseif (yt.* iswm $sockname) {
  1586.     var %y,%cn $hget($sockname,colour)
  1587.     sockread %y
  1588.     if (*Video not found* iswm %y) {
  1589.       $output($hget($sockname,output) $logo(%cn,Youtube) No Video results found)
  1590.       hfree $sockname
  1591.       sockclose $sockname
  1592.     }
  1593.     elseif (*Title* iswm %y) {
  1594.       tokenize 124 %y
  1595.       var %b $c1(%cn,|),%title $gettok($1,2,58),%link $remove($gettok($2,2,58),$chr(32)),%length $gettok($3,2-3,58),%rating $remove($gettok($4,2,58),$chr(32)),%views $remove($gettok($5,2,58),$chr(32))
  1596.       $output($hget($sockname,output) $logo(%cn,$+(,$c2(%cn,You),0,$chr(44),4tube,$chr(15))) $c1(%cn,Title:) $c2(%cn,%title) %b $c1(%cn,Duration:) $c2(%cn,%length) %b $c1(%cn,Rating:) $stars(%cn,yt,%rating,%rating) %b $&
  1597.         Views: $c2(%cn,%views) %b Link: $hlink($+(http://www.youtube.com/watch?v=,%link)))
  1598.       hfree $sockname
  1599.       sockclose $sockname
  1600.     }
  1601.   }
  1602.   elseif (google.* iswm $sockname) {
  1603.     var %g,%cn $hget($sockname,colour)
  1604.     sockread %g
  1605.     if (*@@Search for that on your own* iswm %g) {
  1606.       $output($hget($sockname,output) $logo(%cn,Google) LET ME GOOGLE THAT FOR YOU! $c2(%cn,Wait just open up a browser to search for) $+($c1(%cn,$qt($hget($sockname,search))),$c2(%cn,...)))
  1607.       hfree $sockname
  1608.       sockclose $sockname
  1609.     }
  1610.     if (*Title* iswm %g) {
  1611.       tokenize 124 %g
  1612.       var %b $c1(%cn,|)
  1613.       $output($hget($sockname,output) $logo(%cn,12G4O7O12G3L4E) $c2(%cn,Title:) $c1(%cn,$remove($1,Title:)) %b $c2(%cn,Description:) $c1(%cn,$2) %b $hlink($3))
  1614.       hfree $sockname
  1615.       sockclose $sockname
  1616.     }
  1617.   }
  1618.   elseif (define.* iswm $sockname) {
  1619.     var %c,%cn $hget($sockname,colour)
  1620.     sockread %c
  1621.     if (*Word not found* iswm %c) {
  1622.       $output($hget($sockname,output) no definitions for $c2(%cn,$qt($hget($sockname,search))) $c1(%cn,found))
  1623.       hfree $sockname
  1624.       sockclose $sockname
  1625.     }
  1626.     else {
  1627.       if ($regex(%c,/<i>abbreviation(.*?)<\/div>/gi)) {
  1628.         $output($hget($sockname,output) $logo(%cn,Define) $c2(%cn,$+($hget($sockname,search),:)) $c1(%cn,Abbreviation $nohtml($regml(1))))
  1629.         hfree $sockname
  1630.         sockclose $sockname
  1631.       }
  1632.       elseif ($regex(%c,/<div class="ds-list"><b>1. </b>(.*?)<\/div>/Si)) {
  1633.         $output($hget($sockname,output) $logo(%cn,Define) $c2(%cn,$+($hget($sockname,search),:)) $c1(%cn,$replace($regml(1),<i>,:,</i>,)))
  1634.         hfree $sockname
  1635.         sockclose $sockname
  1636.       }
  1637.     }
  1638.   }
  1639.   elseif (botnews.* iswm $sockname) {
  1640.     var %b,%cn $hget($sockname,colour)
  1641.     sockread %b
  1642.     if (*LAST TWEET:* iswm %b) {
  1643.       if (%b != $hget(Botnews,latest)) && ($readini(Hermes.ini,settings,Botnews) == 1) {
  1644.         var %n $chan(0)
  1645.         hadd -m Botnews latest %b
  1646.         while (%n) {
  1647.           var %s $logo(%cn,Bot News) $gettok(%b,2-,58)
  1648.           $iif(!$chstop($chan(%n)),.msg $chan(%n) $iif(c isincs $chan(%n).mode,$strip(%s),%s))
  1649.           dec %n
  1650.         }
  1651.         sockclose $sockname
  1652.       }
  1653.     }
  1654.   }
  1655.   elseif (version.* iswm $sockname) {
  1656.     var %v,%cn $hget($sockname,colour)
  1657.     sockread %v
  1658.     if (*Version:* iswm %v) {
  1659.       var %x $gettok(%v,2,58)
  1660.       $output($hget($sockname,output) $logo(%cn,Version) Runescape Bot framework $c2(%cn,$+(v,$release)))
  1661.       $iif(%x != $release,$output(%o $hget($sockname,output) $logo(%cn,Version) Get the latest version here: $c2(%cn,http://bit.ly/dtqV5f)))
  1662.       sockclose $sockname
  1663.     }
  1664.   }
  1665. }
  1666. on *:invite:#: {
  1667.   if ($hget(itimer,$chan)) {
  1668.     halt
  1669.   }
  1670.   if ($+(*,$chr(44),*) !iswm $chan) { var %cn $nick
  1671.     .join $chan
  1672.     if ($readini(Hermes.ini,Blacklist,$chan)) {
  1673.       .msg $chan $logo(%cn,Invite) Channel blacklisted
  1674.       .part $chan
  1675.       .msg $botchan $logo(%cn,Invite) $me has left $chan channel $c2(%cn,blacklisted)
  1676.     }
  1677.     .msg $chan $iif($readini(Hermes.ini,settings,invmsg),$c2(%cn,$remove($v1,$chr(126))) $c1(%cn,I was invited by) $c2(%cn,$nick),$c1(%cn,Easy to use Runescape bot "Hermes") $c2(%cn,Hello world!))
  1678.     .msg $botchan $logo(%cn,Invite) Invited by %cn $address(%cn,2) to channel $chan $chan($1).mode)
  1679.   }
  1680. }
  1681. on *:kick:#:{
  1682.   if ($knick == $me) { var %n $nick
  1683.     hadd -mu30 itimer $chan on
  1684.     .msg $botchan $logo(%n,Kick) I've been kicked from $c1(%n,$chan) by $c2(%n,%n) $c1(%n,$qt($1-))
  1685.   }
  1686. }
  1687. on *:load:{
  1688.   writeini Hermes.ini Settings noreply #bots #chan1 #chan2 #chan3 #etc
  1689.   .dialog -md cpanel cpanel
  1690. }
  1691.  
  1692. on *:start: {
  1693.   .flood +c 300 5 5 30
  1694.   .timer 1 3 echo -s $+(.:,$botchan is currently set as default bot channel- you can use the Hermes dialog to change this,:.)
  1695. }
  1696. on *:connect: {
  1697.   $iif($readini(Hermes.ini,settings,Botnews) == 1,/timerbotnews 0 3600 sockopen $+(botnews.,$right($ticks,5)) beardbot.netii.net 80)
  1698.   .join $iif($readini(Hermes.ini,settings,Botchan) != $chr(35),$remove($v1,$chr(126)),#Beard)
  1699.   .join $iif($readini(Hermes.ini,settings,Homechan) != $chr(35),$remove($v1,$chr(126)),#Beard)
  1700. }
  1701. ctcp *:hermes:?: {
  1702.   .ctcp $nick beard-bot.co.uk Hermes Version: $release
  1703. }
  1704. alias -l rp {
  1705.   ;Calculates an equation & replaces abbreviations for large numbers
  1706.   var %a $remove($1,$chr(44))
  1707.   return $calc($regsubex(%a, /(\d+\.?\d+?|\d+)([kmbt])/g,$chr(40)\1*1 $+ $str(000,$pos(kmbt,\2)) $+ $chr(41)))
  1708. }
  1709. alias -l stars {
  1710.   ;Creates the rating stars for the youtube and xboxlive scripts
  1711.   var %n $1,%a $int($calc(5*$ceil($iif($2 == yt,$calc($3 * 20),$3)) /100)),%b $calc(5-%a),%c1 7,%c2 14
  1712.   return $+(%c1,,$str(*,%a),%c2,$str(*,%b),$chr(32),,$+($c1(%n,[),$c2(%n,$4),$c1(%n,]))))
  1713. }
  1714. alias -l sn {
  1715.   ;Returns an abbreviation of a large number
  1716.   if ($remove($$1,$chr(44)) isnum) {
  1717.     var %a $gettok($bytes($v1,b),0,44),%b $bytes($v1,b),%c $+($gettok(%b,1,44),$iif(%a != 1,.),$iif($mid($gettok(%b,2,44),1,2) == 0,0,$v1),$replace(%a,1,$null,2,k,3,m,4,b,5,t))
  1718.     return $iif(%c >= 1000 || $regex(%c,/[kmbt]/),$+($chr(40),%c,$chr(41)))
  1719.   }
  1720. }
  1721. alias -l s1 {
  1722.   ;Returns skill name based on number
  1723.   return $gettok(Overall.Attack.Defence.Strength.Constitution.Ranged.Prayer.Magic.Cooking.Woodcutting.Fletching.Fishing.Firemaking.Crafting.Smithing.Mining.Herblore.Agility.Thieving.Slayer.Farming.Runecraft.Hunter.Construction.Summoning.Dungeoneering,$1,46)
  1724. }
  1725. alias -l s2 {
  1726.   ;Returns number based on skill name
  1727.   return $findtok(attack.defence.strength.Constitution.ranged.prayer.magic.cooking.woodcutting.fletching.fishing.firemaking.crafting.smithing.mining.herblore.agility.thieving.slayer.farming.runecraft.hunter.construction.summoning.dungeoneering,$1,1,46)
  1728. }
  1729. alias -l lvl {
  1730.   ;Returns Level based on experience
  1731.   var %a 0,%b 1,%c $1
  1732.   while (%a <= %c) {
  1733.     inc %a $calc($floor($calc(%b + 300 * 2 ^ (%b / 7))) / 4)
  1734.     inc %b
  1735.   }
  1736.   return $calc(%b - 1)
  1737. }
  1738. alias -l exp {
  1739.   ;Returns experience based on level
  1740.   var %x 1,%l $calc($1 - 1),%xp 0
  1741.   while (%x <= %l) {
  1742.     var %tx $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4)
  1743.     inc %xp %tx
  1744.     inc %x
  1745.   }
  1746.   return $int(%xp)
  1747. }
  1748. alias -l soulwars {
  1749.   ;$1 skill, $2 current level,$3 xptonext
  1750.   var %expperzeal $floor($calc((($2 ^ 2) / 600) * $iif($regex($1,/(attack|strength|defence|constitution)/Si),525,$iif($regex($1,/(magic|ranged)/Si),480,270))))
  1751.   return $ceil($calc($3 / %expperzeal))
  1752. }
  1753. alias -l tog {
  1754.   ;$1 current level, $2 xptonext
  1755.   return $bytes($ceil($calc($2 / $iif($1 >= 30,60,$calc((100 + $floor($2 / 27)) / 10)))),b)
  1756. }
  1757. alias -l pcpoints {
  1758.   ;$1 skill, $2 10/100, $3 current level, $4 xptonext
  1759.   var %base $ceil($calc((($3 ^ 2) / 600) * $iif($regex($1,/(attack|strength|defence|constitution)/Si),35,$iif($regex($1,/(magic|ranged)/Si),32,18))))
  1760.   var %bonus $ceil($calc(%base * $iif($2 == 10, 1.01,1.10)))
  1761.   return $floor($calc($4 / %bonus))
  1762. }
  1763. alias -l cmb {
  1764.   ;Calculates combat level: $cmb(96 94 94 99 94 78 86 79) returns: 129.5 [Melee]
  1765.   tokenize 32 $1-
  1766.   var %att $1,%str $2,%def $3,%hp $4,%range $5,%prayer $6,%magic $7,%summ $8
  1767.   ;base level calculation
  1768.   var %a $calc(%def *100),%b $calc(%hp *100)
  1769.   var %c $iif($and(%prayer,1),$calc((%prayer -1) *50),$calc(%prayer *50)),%d $iif($and(%summ,1),$calc((%summ -1) *50),$calc(%summ *50))
  1770.   var %p2pbase $calc((%a + %b + %c + %d)/400),%f2pbase $calc((%a + %b + %c)/400)
  1771.   ;combat class calculation
  1772.   var %e $calc(%att * 130),%g $calc(%str * 130)
  1773.   var %h $iif($and(%range,1),$calc((%range *195)-65),$calc(%range *195)),%i $iif($and(%magic,1),$calc((%magic *195)-65),$calc(%magic *195))
  1774.   var %melee-cmb $+($calc((%e + %g)/400),:Melee),%range-cmb $+($calc(%h /400),:,Range),%mage-cmb $+($calc(%i /400),:,Mage)
  1775.   ;final combat calculation
  1776.   var %sort $sorttok(%melee-cmb %range-cmb %mage-cmb,32,nr)
  1777.   var %base $iif($8,%p2pbase,%f2pbase),%highest $gettok(%sort,1,58),%class $+([,$token($token(%sort,2,58),1,32),])
  1778.   return $calc(%highest + %base) $iif(!$prop,%class)
  1779. }
  1780. alias -l nextlevel {
  1781.   var %string Att/Str: Def/Cns: Prayer: Summ:,%i 1,
  1782.   var %p2p $ncmb($1-),%f2p $ncmb($puttok($1-,0,8,32))
  1783.   while (%i <= 4) {
  1784.     var %l $+(%i,-,$calc(%i +1)),%stat $token($1-,%l,32)
  1785.     var %str $iif(%i == 4,$token($1-,8,32),$token(%stat,1,32) || $token(%stat,2,32))
  1786.     var %f $token(%f2p,%i,32),%p $token(%p2p,%i,32)
  1787.     var %x %x $iif(%str < 99,$iif(%p || %f,$c2($prop,$token(%string,%i,32)) $&
  1788.       $c1($prop,%p $+($chr(40),$iif(%i == 4,0,%f),$chr(41)))))
  1789.     inc %i
  1790.   }
  1791.   return %x
  1792. }
  1793. alias -l ncmb {
  1794.   var %stats $1-,%cmb $cmb(%stats),%i 1,%ntok $numtok($1-,32)
  1795.   var %nextlevel $calc($floor($cmb(%stats).base) +1),%result
  1796.   while (%i <= %ntok) {
  1797.     var %statstart $token(%stats,%i,32),%stat %statstart
  1798.     var %tempstats $puttok(%stats,%stat,%i,32)
  1799.     while ($floor($cmb(%tempstats).base) < %nextlevel) {
  1800.       inc %stat
  1801.       var %tempstats $puttok(%stats,%stat,%i,32)
  1802.     }
  1803.     var %result %result $calc(%stat - %statstart)
  1804.     inc %i
  1805.   }
  1806.   tokenize 32 %result
  1807.   var %which.stats $iif(*melee* iswm %cmb,$1 $3,$iif(*range* iswm %cmb,$5,$7))
  1808.   return %which.stats $6 $8
  1809. }
  1810. alias -l otherstats return $regex($$1,/(Overall|Bounty|Bounty-Rogue|FOG|BA-Attacker|BA-Defender|BA-Collector|BA-Healer)/Si)
  1811. alias -l elg {
  1812.   if ($1 == $chr(60)) { return less than }
  1813.   elseif ($1 == $chr(61)) { return equal to }
  1814.   elseif ($1 == $chr(62)) { return greater than }
  1815. }
  1816. alias -l skill {
  1817.   if ($regex($1,/^(overall|total)/Si)) Return Overall
  1818.   elseif ($regex($1,/^(att|atk|attack)/Si)) Return Attack
  1819.   elseif ($regex($1,/^(str|strenth|strength)/Si)) Return Strength
  1820.   elseif ($regex($1,/^(def|defence)/Si)) Return Defence
  1821.   elseif ($regex($1,/^(hp|hits|hitpoints|constitution)/Si)) Return Constitution
  1822.   elseif ($regex($1,/^(range|ranging)/Si)) Return Ranged
  1823.   elseif ($regex($1,/^(pray(er)?)/Si)) Return Prayer
  1824.   elseif ($regex($1,/^(mage|magic)/Si)) Return Magic
  1825.   elseif ($regex($1,/^(cook|cooking)/Si)) Return Cooking
  1826.   elseif ($regex($1,/^(wc|wood(cut(ting)?))/Si)) Return Woodcutting
  1827.   elseif ($regex($1,/^(fletch|fletching)/Si)) Return Fletching
  1828.   elseif ($regex($1,/^(fishing|fish)/Si)) Return Fishing
  1829.   elseif ($regex($1,/^(fm|fire|firemaking)/Si)) Return Firemaking
  1830.   elseif ($regex($1,/^(craft|crafting)/Si)) Return Crafting
  1831.   elseif ($regex($1,/^(smithing|smith)/Si)) Return Smithing
  1832.   elseif ($regex($1,/^(mine|mining)/Si)) Return Mining
  1833.   elseif ($regex($1,/^(herb|Herblore)/Si)) Return Herblore
  1834.   elseif ($regex($1,/^(agil|agility)/Si)) Return Agility
  1835.   elseif ($regex($1,/^(theif|theiv|thiev|theiving|thieving)/Si)) return Thieving
  1836.   elseif ($regex($1,/^(slay|Slayer)/Si)) Return Slayer
  1837.   elseif ($regex($1,/^(farm|Farming)/Si)) Return Farming
  1838.   elseif ($regex($1,/^(rune|rc|runecrafting|runecraft)/Si)) Return Runecraft
  1839.   elseif ($regex($1,/^(hunt|hunting|hunter)/Si)) Return Hunter
  1840.   elseif ($regex($1,/^(con|construction)/Si)) Return Construction
  1841.   elseif ($regex($1,/^(sum|summ|summon|summoning)/Si)) Return Summoning
  1842.   elseif ($regex($1,/^(dung?(eon)?|dg)/Si)) Return Dungeoneering
  1843. }
  1844. alias -l skillparams {
  1845.   ;$1 nickforcolours, $2 skill, $3 xptillnxt,$4 current level
  1846.   var %b $c1($1,|),%cn $1
  1847.   if ($regex($2,/^(attack|strength|defence|combat)/Si)) {
  1848.     ;combat paramater values
  1849.     var %params Shadow Warriors:268`Dagganoth(74):280`Yaks:200`Bandits:204 $&
  1850.       `Armoured Zombies:340`Orgres:240`Green Dragons:300`Dust Devils:420`Fire Giants:444
  1851.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1852.     while (%x <= %n) {
  1853.       tokenize 58 $token(%params,%x,96)
  1854.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1855.       inc %x
  1856.     }
  1857.     return %a
  1858.   }
  1859.   elseif ($2 == Constitution) {
  1860.     var %params Shadow Warriors:89.33`Dagganoth:93.33`Yaks:66.66`Bandits:68 $&
  1861.       `Armoured Zombies:113.33`Orgres:80`Green Dragons:100`Dust Devils:140`Fire Giants:148
  1862.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1863.     while (%x <= %n) {
  1864.       tokenize 58 $token(%params,%x,96)
  1865.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1866.       inc %x
  1867.     }
  1868.     return %a
  1869.   }
  1870.   elseif ($2 == Ranged) {
  1871.     ;normal-xp cannoned-xp
  1872.     var %params Dagannoth:396 198`Yaks:200 100`Bandits:204 102`Hellhounds:464 232 $&
  1873.       `Ogres:240 120`Blue dragons:436 218`Monkey Guard:520 260`Firegiants:444 222
  1874.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1875.     while (%x <= %n) {
  1876.       tokenize 58 $token(%params,%x,96)
  1877.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,1,32))),db)) $&
  1878.         $+($c2(%cn,[),$c1(%cn,$bytes($ceil($calc($2 / $token(%xptillnxt,2,32))),db)),$c2(%cn,])) $iif(%x != %n,%b)
  1879.       inc %x
  1880.     }
  1881.     return $+($c2(%cn,[),$c1(%cn,Cannon),$c2(%cn,])) %a
  1882.   }
  1883.   elseif ($2 == Prayer) {
  1884.     ;Prayer Paramaters
  1885.     var %params Bones:4.5`Big bones:15`Baby dragon bones:30`Dragon bones:72`[Altar:252`[Ecto:288`Dagannoth bones:125
  1886.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1887.     while (%x <= %n) {
  1888.       tokenize 58 $token(%params,%x,96)
  1889.       var %a %a $c1(%cn,$1) $+($c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)),$iif(%x isnum 5-6,$c1(%cn,]))) $&
  1890.         $iif(%x != %n && %x !isnum 4-5,%b)
  1891.       inc %x
  1892.     }
  1893.     return %a
  1894.   }
  1895.   elseif ($2 == Magic) {
  1896.     var %params $+(Curse:29`Stun:90`High alch:65`Humidify:65`Camelot teleport:55.5`,$lvlspell($3),$iif($3 >= 70,`Ice burst:40),$iif($3 >= 94,`Ice barrage:52))
  1897.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1898.     while (%x <= %n) {
  1899.       tokenize 58 $token(%params,%x,96)
  1900.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1901.       inc %x
  1902.     }
  1903.     return %a
  1904.   }
  1905.   elseif ($2 == Cooking) {
  1906.     var %params Trout:70`Salmon:90`Tuna:100`Lobster:120`Swordfish:140`Monkfish:150`Shark:210`Curry:280
  1907.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1908.     while (%x <= %n) {
  1909.       tokenize 58 $token(%params,%x,96)
  1910.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1911.       inc %x
  1912.     }
  1913.     return %a
  1914.   }
  1915.   elseif ($2 == Woodcutting) {
  1916.     var %params Normal logs:25`Oak logs:37.5`Willow logs:67.5`Teak logs:85`Maple logs:100 $&
  1917.       `Mahogany logs:125`Eucalyptus logs:165`Yew logs:175`Mage logs:250
  1918.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1919.     while (%x <= %n) {
  1920.       tokenize 58 $token(%params,%x,96)
  1921.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1922.       inc %x
  1923.     }
  1924.     return %a
  1925.   }
  1926.   elseif ($2 == Fletching) {
  1927.     var %params Maple longbow:116.6`Adamant arrows:10`Yew shortbow:133 $&
  1928.       `Yew longbow:150`Mage shortbow:166.6`Mage longbow:183
  1929.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1930.     while (%x <= %n) {
  1931.       tokenize 58 $token(%params,%x,96)
  1932.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1933.       inc %x
  1934.     }
  1935.     return %a
  1936.   }
  1937.   elseif ($2 == Fishing) {
  1938.     var %params Salmon:70`Tuna:80`Lobster:90`Bass:100`Swordfish:100`Shark:110`Monkfish:120
  1939.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1940.     while (%x <= %n) {
  1941.       tokenize 58 $token(%params,%x,96)
  1942.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1943.       inc %x
  1944.     }
  1945.     return %a
  1946.   }
  1947.   elseif ($2 == Firemaking) {
  1948.     var %params Normal logs:40`Oak logs:60`Willow logs:90`Maple logs:135`Yew logs:202.5`Magic logs:303.75
  1949.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1950.     while (%x <= %n) {
  1951.       tokenize 58 $token(%params,%x,96)
  1952.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1953.       inc %x
  1954.     }
  1955.     return %a
  1956.   }
  1957.   elseif ($2 == crafting) {  
  1958.     var %params Hard Leather Body:35,Glass orb:52.5`Tiara:52.5`Green d'hide:62`Blue d'hide:70`Black d'hide:79
  1959.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1960.     while (%x <= %n) {
  1961.       tokenize 58 $token(%params,%x,96)
  1962.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1963.       inc %x
  1964.     }
  1965.     return %a
  1966.   }
  1967.   elseif ($2 == Smithing) {
  1968.     ;smelt smith both
  1969.     var %params Iron:12.5 25 37.5`Steel:17.5 37.5 55`Mithril:30 50 80`Adamant:37.5 62.5 100 $&
  1970.       `Gold:22.5 56.2`Adamant Platebodies:312.5`Cannon balls:43.1
  1971.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1972.     while (%x <= %n) {
  1973.       tokenize 58 $token(%params,%x,96)
  1974.       var %a %a $iif(%x isnum 1-4,$c1(%cn,$1) $+($c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,1,32))),db)),$&
  1975.         $c1(%cn,/),$c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,2,32))),db)),$c1(%cn,/),$&
  1976.         $c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,3,32))),db))),$iif(%x isnum 5,$c1(%cn,Smelt Gold) $&
  1977.         $c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,1,32))),db)) $c1(%cn,(w/Gaunts)) $&
  1978.         $c2(%cn,$bytes($ceil($calc(%xptillnxt / $token($2,2,32))),db)),$c1(%cn,$1) $&
  1979.         $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)))) $iif(%x != %n,%b)
  1980.       inc %x
  1981.     }
  1982.     return $+($c1(%cn,[),$c2(%cn,smelt),$c1(%cn,/),$c2(%cn,smith),$c1(%cn,/),$c2(%cn,both),$c1(%cn,]),$c1(%cn,:)) %a
  1983.   }
  1984.   elseif ($2 == mining) {
  1985.     var %params Iron:35`Mithril:80`Adamant:95`Rune:125 $&
  1986.       `Silver:40`Gems:65`Granite:61.67`Coal:50`Pure essence:5
  1987.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1988.     while (%x <= %n) {
  1989.       tokenize 58 $token(%params,%x,96)
  1990.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  1991.       inc %x
  1992.     }
  1993.     return %a
  1994.   }
  1995.   elseif ($2 == Herblore) {
  1996.     var %params Prayer:87.5`Super attack:100`Super strength:125`Super restore:142.5 $&
  1997.       `Super energy:117.5`Fishing:112.5`Hunter:120`Ranging:162.5`Magic:172.5`Saradomin brew:180
  1998.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  1999.     while (%x <= %n) {
  2000.       tokenize 58 $token(%params,%x,96)
  2001.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2002.       inc %x
  2003.     }
  2004.     return %a
  2005.   }
  2006.   elseif ($2 == Agility) {
  2007.     var %params Gnome:86`Barbarian:153.2`Werewolf:540,Wilderness:571.5 $&
  2008.       `Ape Atoll:580`Dorgesh-Kaan:1375`Pyramid:1014`Brimhaven (100):30800
  2009.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2010.     while (%x <= %n) {
  2011.       tokenize 58 $token(%params,%x,96)
  2012.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2013.       inc %x
  2014.     }
  2015.     return %a
  2016.   }
  2017.   elseif ($2 == Thieving) {
  2018.     var %params Warriors:26`Master farmers:43`Guards:46.8`Fremenniks:65`Knights:84.3`Paladins:151.8`Heroes:273.3
  2019.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2020.     while (%x <= %n) {
  2021.       tokenize 58 $token(%params,%x,96)
  2022.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2023.       inc %x
  2024.     }
  2025.     return %a
  2026.   }
  2027.   elseif ($2 == Slayer) {
  2028.     var %params Dagannoths:99`Greater demons:87`Kalphites:90`Trolls:90`Gargoyles:105 $&
  2029.       `Nechryael:105`Bloodveld:120`Black demons:157`Abyssal demon:150`Iron dragon:173`Steel dragon:220
  2030.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2031.     while (%x <= %n) {
  2032.       tokenize 58 $token(%params,%x,96)
  2033.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2034.       inc %x
  2035.     }
  2036.     return %a
  2037.   }
  2038.   elseif ($2 == Farming) {
  2039.     var %params Ranarr:57.5`Kwuarm:147`Willow tree:1481.3`Maple tree:3448.4 $&
  2040.       `Pineapple:4684.2`Papaya:6245.4`Yew tree:7150.9`Calquat:12274`Palm tree:10302.1
  2041.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2042.     while (%x <= %n) {
  2043.       tokenize 58 $token(%params,%x,96)
  2044.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2045.       inc %x
  2046.     }
  2047.     return %a
  2048.   }
  2049.   elseif ($2 == Runecraft) {
  2050.     var %params Air: 5`Water:6`Earth:6.5`Fire:7`Chaos:8.5`Nature:9`Law:9.5`Death:10`Blood:11`ZMI:17.3
  2051.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2052.     while (%x <= %n) {
  2053.       tokenize 58 $token(%params,%x,96)
  2054.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2055.       inc %x
  2056.     }
  2057.     return %a
  2058.   }
  2059.   elseif ($2 == Hunter) {
  2060.     var %params Dark Kebbit:132`Dashing Kebbit:156`Kyatt:300`Orange Salamander:224 $&
  2061.       `Red Salamander:272`Red Chinchompa:265`Razor-backed Kebbit:348`Imp:450
  2062.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2063.     while (%x <= %n) {
  2064.       tokenize 58 $token(%params,%x,96)
  2065.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2066.       inc %x
  2067.     }
  2068.     return %a
  2069.   }
  2070.   elseif ($2 == construction) {
  2071.     var %params Normal planks:25`Oak planks:60`Teak planks:90`Mahogany planks:140`Oak larder:480
  2072.     var %n $numtok(%params,96),%x 1,%xptillnxt $3
  2073.     while (%x <= %n) {
  2074.       tokenize 58 $token(%params,%x,96)
  2075.       var %a %a $c1(%cn,$1) $c2(%cn,$bytes($ceil($calc(%xptillnxt / $2)),db)) $iif(%x != %n,%b)
  2076.       inc %x
  2077.     }
  2078.     return %a
  2079.   }
  2080.   elseif ($2 == Summoning) {
  2081.     var %x Gold Crimson Green Blue,%n 4,%l 1
  2082.     while (%l <= %n) {
  2083.       var %info $($+($,makewhat,$chr(40),$4,$chr(41),.,$gettok(%x,%l,32)),2),$&
  2084.         %exp $gettok(%info,6,64),%shards $gettok(%info,5,64),%name $gettok(%info,2,64),$&
  2085.         %charm $replace($gettok(%x,%l,32),Gold,07Gold,Crimson,04Crimson,Blue,02Blue,Green,03Green)
  2086.       var %a %a $c2(%cn,%name) $+($c1(%cn,[),$bytes($ceil($calc($3 / %exp)),bd),x,%charm,$c1(%cn,])) $&
  2087.         $+([S:,$bytes($ceil($calc(($3 /%exp) * %shards)),bd),]) $iif(%l != 4,%b)
  2088.       inc %l
  2089.     }
  2090.     return %a
  2091.   }
  2092. }
  2093. alias -l lvlspell {
  2094.   if ($1 isnum 3-35) return Fire bolt:22.5
  2095.   elseif ($1 isnum 36-47) return Water blast:28.5
  2096.   elseif ($1 isnum 48-53) return Earth blast:31.5
  2097.   elseif ($1 isnum 54-59) return Fire blast:34.5
  2098.   elseif ($1 isnum 60-65) return Water wave:37.5
  2099.   elseif ($1 isnum 66-70) return Earth wave:40
  2100.   elseif ($1 isnum 71-75) return Fire wave:42.5
  2101.   elseif ($1 isnum 76-81) return Wind surge:75
  2102.   elseif ($1 isnum 82-85) return Water surge:80
  2103.   elseif ($1 isnum 86-90) return Earth Surge:85
  2104.   else return Fire surge:90
  2105. }
  2106. alias -l charmdisplay {
  2107.   var %number $rp($3),%cn $1
  2108.   tokenize 64 $($+($,makewhat,$chr(40),$2,$chr(41),.,$4),2)
  2109.   if ($prop == Charms) {
  2110.     return $c2(%cn,$2) $replace($3,Gold,07Gold,Crimson,04Crimson,Blue,02Blue,Green,03Green) $&
  2111.       $+($c1(%cn,Shards:) $c2(%cn,$5) $c1(%cn,$chr(40)),$c2(%cn,$bytes($ceil($calc($5 * %number)),db)),$c1(%cn,$chr(41)) $&
  2112.       $c1(%cn,Exp:) $c2(%cn,$bytes($ceil($6),db)) $c1(%cn,$chr(40)),$c2(%cn,$bytes($ceil($calc($6 * %number)),db)),$c1(%cn,$chr(41)) $&
  2113.       $c1(%cn,Cost:) $c2(%cn,$bytes($calc($5 * %number *25),db)) gp)
  2114.   }
  2115. }
  2116. alias -l makewhat {
  2117.   ;($1 Level) ($2 Pouch) ($3 Charm) ($4 Seconds) ($5 Shards) ($6 exp)
  2118.   ;Gold
  2119.   if ($prop == Gold) {
  2120.     if ($1 isnum 1-3) return 1@Spirit wolf@Gold@Wolf bones@7@4.8
  2121.     elseif ($1 isnum 4-9) return 4@Dreadfowl@Gold@Raw chicken@8@9.3
  2122.     elseif ($1 isnum 10-12) return 10@Spirit spider@Gold@Spider carcass@8@12.6
  2123.     elseif ($1 isnum 13-15) return 13@Thorny snail@Gold@Thin snail@9@12.6
  2124.     elseif ($1 isnum 16-16) return 16@Granite crab@Gold@Iron ore@7@21.6
  2125.     elseif ($1 isnum 17-39) return 17@Mosquito@Gold@Proboscis@1@46.5
  2126.     elseif ($1 isnum 40-51) return 40@Bull ant@Gold@Marigolds@11@52.8
  2127.     elseif ($1 isnum 52-65) return 52@Spirit terrorbird@Gold@Raw bird meat@12@68.4
  2128.     elseif ($1 isnum 66-66) return 66@Barker toad@Gold@Swamp toad@11@87.0
  2129.     elseif ($1 isnum 67-70) return 67@War tortoise@Gold@Tortoise shell@1@58.6
  2130.     elseif ($1 isnum 71-126) return 71@Arctic bear@Gold@Polar kebbit fur@14@93.2
  2131.   }
  2132.   ;Green
  2133.   elseif ($prop == Green) {
  2134.     if ($1 isnum 18-27) return 18@Desert wyrm@Green@Bucket of sand@45@31.2
  2135.     elseif ($1 isnum 28-32) return 28@Compost mound@Green@Compost@47@49.8
  2136.     elseif ($1 isnum 33-33) return 33@Beaver@Green@Willow logs@72@57.6
  2137.     elseif ($1 isnum 34-40) return 34@Void ravager@Green@Ravager charm@74@59.6
  2138.     elseif ($1 isnum 41-42) return 41@Macaw@Green@Clean guam@78@72.4
  2139.     elseif ($1 isnum 43-46) return 43@Spirit Cockatrice or variants@Green@Cockatrice egg@88@75.2
  2140.     elseif ($1 isnum 47-53) return 47@Magpie@Green@Gold ring@88@83.2
  2141.     elseif ($1 isnum 54-55) return 54@Abyssal parasite@Green@Abyssal charm@106@94.8
  2142.     elseif ($1 isnum 56-61) return 56@Ibis@Green@Harpoon@109@98.8
  2143.     elseif ($1 isnum 62-67) return 62@Abyssal lurker@Green@Abyssal charm@119@109.6
  2144.     elseif ($1 isnum 68-68) return 68@Bunyip@Green@Raw shark@110@119.2
  2145.     elseif ($1 isnum 69-75) return 69@Fruit bat@Green@Banana@130@121.2
  2146.     elseif ($1 isnum 76-77) return 76@Forge Regent@Green@Ruby harvest@141@134.0
  2147.     elseif ($1 isnum 78-79) return 78@Giant ent@Green@Willow branch@124@136.8
  2148.     elseif ($1 isnum 80-87) return 80@Hydra@Green@Water orb@128@140.8
  2149.     elseif ($1 isnum 88-92) return 88@Unicorn stallion@Green@Unicorn horn@140@154.4
  2150.     elseif ($1 isnum 93-126) return 93@Abyssal Titan@Green@Abyssal charm@113@163.2
  2151.   }
  2152.   ;Crimson
  2153.   elseif ($prop == Crimson) {
  2154.     if ($1 isnum 19-21) return 19@Spirit scorpion@Crimson@Bronze claws@57@83.2  
  2155.     elseif ($1 isnum 22-30) return 22@Spirit Tz-Kih@Crimson@Obsidian charm@64@96.8  
  2156.     elseif ($1 isnum 31-31) return 31@Vampire bat@Crimson@Vampire dust@81@136.0  
  2157.     elseif ($1 isnum 32-41) return 32@Honey badger@Crimson@Honeycomb@84@140.8  
  2158.     elseif ($1 isnum 42-45) return 42@Evil turnip@Crimson@Evil Carved turnip@104@184.8  
  2159.     elseif ($1 isnum 46-48) return 46@Pyrelord@Crimson@Tinderbox@111@202.4  
  2160.     elseif ($1 isnum 49-60) return 49@Bloated leech@Crimson@Raw beef@117@215.2  
  2161.     elseif ($1 isnum 61-62) return 61@Smoke devil@Crimson@Goat horn dust@141@268.0  
  2162.     elseif ($1 isnum 63-63) return 63@Spirit cobra@Crimson@Snake hide@116@276.8  
  2163.     elseif ($1 isnum 64-69) return 64@Stranger plant@Crimson@Bagged plant 1@128@281.6  
  2164.     elseif ($1 isnum 70-71) return 70@Ravenous Locust@Crimson@Pot of flour@79@132.0  
  2165.     elseif ($1 isnum 72-73) return 72@Phoenix@Crimson@Phoenix quill@165@302.0  
  2166.     elseif ($1 isnum 74-74) return 74@Granite lobster@Crimson@Granite (500g)@166@325.6  
  2167.     elseif ($1 isnum 75-76) return 75@Praying mantis@Crimson@Flowers -Red-@168@329.6  
  2168.     elseif ($1 isnum 77-82) return 77@Talon beast@Crimson@Talon beast charm@174@1015.2  
  2169.     elseif ($1 isnum 83-84) return 83@Spirit dagannoth@Crimson@Dagannoth hide@1@364.8  
  2170.     elseif ($1 isnum 85-91) return 85@Swamp Titan@Crimson@Swamp lizard@150@373.6  
  2171.     elseif ($1 isnum 92-94) return 92@Wolpertinger@Crimson@Raw rabbit+Wolf bones@203@404.8  
  2172.     elseif ($1 isnum 95-95) return 95@Iron Titan@Crimson@Iron platebody@198@417.6  
  2173.     elseif ($1 isnum 96-98) return 96@Pack yak@Crimson@Yak-hide@211@422.4  
  2174.     elseif ($1 isnum 99-126) return 99@Steel Titan@Crimson@Steel platebody@198@417.6  
  2175.   }
  2176.   ;Blue
  2177.   elseif ($prop == Blue) {
  2178.     if ($1 isnum 23-24) return 23@Albino rat@Blue@Raw rat meat@75@202.4  
  2179.     elseif ($1 isnum 25-28) return 25@Spirit kalphite@Blue@Potato cactus@51@220.0  
  2180.     elseif ($1 isnum 29-33) return 29@Giant Chinchompa@Blue@Chinchompa@84@255.2  
  2181.     elseif ($1 isnum 34-33) return 34@Void spinner@Blue@Spinner charm@74@59.6  
  2182.     elseif ($1 isnum 34-33) return 34@Void torcher@Blue@Torcher charm@74@59.6  
  2183.     elseif ($1 isnum 34-35) return 34@Void shifter@Blue@Shifter charm@74@59.6  
  2184.     elseif ($1 isnum 36-45) return 36@Bronze minotaur@Blue@Bronze bar@102@316.8  
  2185.     elseif ($1 isnum 46-54) return 46@Iron minotaur@Blue@Iron bar@125@404.8  
  2186.     elseif ($1 isnum 55-55) return 55@Spirit jelly@Blue@Jug of water@151@484.0  
  2187.     elseif ($1 isnum 56-56) return 56@Steel minotaur@Blue@Steel bar@141@492.8  
  2188.     elseif ($1 isnum 57-56) return 57@Spirit Graahk@Blue@Graahk fur@154@501.6  
  2189.     elseif ($1 isnum 57-56) return 57@Spirit Kyatt@Blue@Kyatt fur@153@501.6  
  2190.     elseif ($1 isnum 57-57) return 57@Spirit Larupia@Blue@Larupia fur@153@501.6  
  2191.     elseif ($1 isnum 58-65) return 58@Karamthulhu overlord@Blue@Fishbowl -Empty-@144@510.4  
  2192.     elseif ($1 isnum 66-72) return 66@Mithril minotaur@Blue@Mithril bar@152@580.8  
  2193.     elseif ($1 isnum 73-75) return 73@Obsidian Golem@Blue@Obsidian charm@195@642.4  
  2194.     elseif ($1 isnum 76-78) return 76@Adamant minotaur@Blue@Adamantite bar@144@668.8  
  2195.     elseif ($1 isnum 79-79) return 79@Fire Titan@Blue@Fire talisman@198@695.2  
  2196.     elseif ($1 isnum 79-82) return 79@Moss Titan@Blue@Earth talisman@202@695.2  
  2197.     elseif ($1 isnum 83-85) return 83@Lava Titan@Blue@Obsidian charm@219@730.4  
  2198.     elseif ($1 isnum 86-88) return 86@Rune minotaur@Blue@Runite bar@1@756.8  
  2199.     elseif ($1 isnum 89-126) return 89@Geyser Titan@Blue@Water talisman@222@783.2  
  2200.   }
  2201. }
  2202. alias rings {
  2203.   ;Thanks to RSWiki for making this data publicly available.
  2204.   ;http://runescape.wikia.com/wiki/Fairy_ring
  2205.   if ($regex($1-,/East/Si)) return CKS@Canifis Mushroom Patch-DLS@Canifis Pub-ALQ@Haunted Woods-BKR@Mort Myre Swamp-BIQ@Khardian Desert (NorthWest)-DLQ@ Kharidian Desert (East)
  2206.   elseif ($regex($1-,/(C|S)ent(er|re)/Si)) return DKR@EdgeVille-DIS@Wizard Tower-AIQ@MudSkipper Point-BLP@TzHaar-DKP@Karambwan Fishing Area-CKR@Southern Karajima-
  2207.   elseif ($regex($1-,/West/Si)) return AKQ@Woodlands Hunting Area-AJS@Penguin Island-CIP@Miscellania-DKS@Keldagrim and Snow Hunting-AJR@Slayer Cave-CJR@Sinclair Mansion-DJR@Sinclair Mansion-ALS@McGrubor's Wood-BLR@Legend's Guild-BIS@Unicorn Pen Ardougne Zoo-DJP@Necromancer-CIQ@South Tree Gnome Village-CLS@Hazelmere-BKP@Chompy Frog Pond West-AKS@Chompy Frog Pond SouthEast-BJQ@Ancient Cavern
  2208.   elseif ($regex($1-,/Slay(er)?/Si)) return AJR@Slayer Cave-CKS@Slayer Tower-BJQ@Ancient Cavern-ALR@Abyssal Demons
  2209.   elseif ($regex($1-,/Farm(ing|er)?/Si)) return ALQ@NorthWest Port Phasmatys-AJR@Troll Stronghold
  2210.   elseif ($regex($1-,/(^AIQ$)|Mud(skip(p)?(er)?)?/i)) return AIQ@Asgarnia MudSkipper Point  
  2211.   elseif ($regex($1-,/(^AJQ$)|Dorgesh|Kaan/i)) return AJQ@Dark cave south of Dorgesh-Kaan
  2212.   elseif ($regex($1-,/(AJR)|Rock( )?Crab(s)?|^Slayer( cave)$/i)) return AJR@Slayer Cave SouthEast of Relleka, Troll Strong Hold, and Rock Crabs
  2213.   elseif ($regex($1-,/(^AKQ$)|Kandarin|Piscatoris|Fishing Colony|Phoenix|Falcon(er|ing)?|Monk( )?(Fish)?/i)) return AKQ@Kandarin: Piscatoris, Phoenix Cave, Falconer, and MonkFish
  2214.   elseif ($regex($1-,/(^AKS$)|Jungle Hunt|Chompy/i)) return AKQ@Feldip area
  2215.   elseif ($regex($1-,/(^ALQ$)|Morytania|Haunt(ed)? Wood(s)?/i)) return ALQ @ Mortyania: Haunted Woods East of Canifis  
  2216.   elseif ($regex($1-,/(^ALS$)|McGrubor|Coal Truck|Fish(ing)? Guild/i)) return ALS@Kandarin: McGrubor's Wood, Coal Trucks, Fishing Guild, Hemenster  
  2217.   elseif ($regex($1-,/(^KIQ$)$|Kalphite|Shanty|Bedabin/i)) return BIQ@Kharidian Desert: Shanty, Kalphite Lair, Bedabin Camp
  2218.   elseif ($regex($1-,/(^BJQ$)|Ancient Cavern|Waterfiend|Kuradal|Mithril D(ragon)?/i)) return BJQ@ Ancient Cavern: Mirthril Dragons and Waterfieds  
  2219.   elseif ($regex($1-,/(^BJR$)|Fish(ing|er)? Re(a)?lm/i)) return BJR@Fisher Realm  
  2220.   elseif ($regex($1-,/(^BKP$)|Feldip Hill?|Chompy|C(astle)?W(ars)?|Jiggig/i)) return BKP@Feldip Hills, South of CastleWars, Chompy, and Jiggig
  2221.   elseif ($regex($1-,/(^BKR$)|Mory(tania)?|Mort( Myre)?|Canifis|Nature Spirit/i)) return BKR@Morytania: Mort Myre, Canifis, Nature Spirit Alter
  2222.   elseif ($regex($1-,/(^BLP$)|TzHarr|Fire Cape|Onyx/i)) return BLP@TzHarr  
  2223.   elseif ($regex($1-,/(^BLR$)|Legend(\')?(s)?|Thormac( Tower)?/i)) return BLR@Legends Guild, Thormac's Tower Witchaven
  2224.   elseif ($regex($1-,/(^CIP$)|Miscellania|Kingdom/i)) return CIP@Miscellania
  2225.   elseif ($regex($1-,/(^CIQ$)|Yan(v)?ille|Tree( )?Gnome( )?(Village)?/i)) return CIQ@Yanille: Tree Gnome Village and Castle Wars
  2226.   elseif ($regex($1-,/(^CJR$)|Rel(l)?iek(k)?a|(Seers|Cam(alot|my)) (Maple|Tree)/i)) return CJR@Kandarin: Relieka, Seers/Camalot Maple Trees  
  2227.   elseif ($regex($1-,/(^CKR$)|Kar(a|i)mja|Nature Alt(e|a)r|Karam(bwanji)?/i)) return CKR@Karamja: Shilo, Nature Alter, Tai Bwo Wannai  
  2228.   elseif ($regex($1-,/(^CKS$)|Morytania|Kharyll|Mushroom|Burgh De Rott|Slayer Tower/i)) return CKS@Morytania: Kharyll Teleport, Mushroom Patch, Burgh De Rott, Slayer Tower  
  2229.   elseif ($regex($1-,/(^CLS$)|Yan(v)?ille Island/i)) return CLS@Yanille Island: Hazelmere and Jungle Spiders
  2230.   elseif ($regex($1-,/(^DIS$)|Wizard Tower|Draynor|Lumberage( Swamp)?|R(une)?C(rafting)? Guild/i)) return DIS@Misthalin: Wizard Tower, Draynor, Lumberage Swamp, RuneCrafting Guild
  2231.   elseif ($regex($1-,/(^DJP$)|Tower( Of)?( Life)?|Ard(y|ougne)|Port khazard/i)) Return DJP@Kandarin:  Tower of Life, Ardougne, and Port Khazard
  2232.   elseif ($regex($1-,/(^DJR$)|Sinclair( Mansion)?/i)) return DJR@Kandarin: Sinclair Mansion
  2233.   elseif ($regex($1-,/(^DKP$)|Musa( Point)?/i)) return DKP@Musa Point  
  2234.   elseif ($regex($1-,/(^DKR$)|Edge(ville)?|G(rand)?E(xchange)?/i)) return DKR@Misthalin: EdgeVille and GrandExchange  
  2235.   elseif ($regex($1-,/(^DKS$)|(Snow(y)?|Polar) Hunt(er)?/i)) return DKS@Kandarin: Snowy/Polar Hunder Area
  2236.   elseif ($regex($1-,/(^DLQ$)|(Desert)?Lizard(s)?|Nardah|Ruin(s)?Uzer/i)) return DLQ@Kharidian: Desert Lizards, Nardah, Ruins Uzer
  2237.   elseif ($regex($1-,/(^DLS$)|Myreque Hidout|Hollow(s)?|Blood( Alt(a|e)r)?/i)) return DLS@Myreque: Hollows and Blood Alter
  2238.   else return Error
  2239. }
  2240. alias onoff {
  2241.   if ($regex($1,/public/Si)) return public
  2242.   elseif ($regex($1,/(rsp|rsplayers)$/Si)) return rsp
  2243.   elseif ($regex($1,/skills$/Si)) return skills
  2244.   elseif ($regex($1,/l(oot)?s(hare)?$/Si)) return lootshare
  2245.   elseif ($regex($1,/(rs|runescape)news$/Si)) return rsnews
  2246.   elseif ($regex($1,/name(check)?/Si)) return namecheck
  2247.   elseif ($regex($1,/stats$/Si)) return stats
  2248.   elseif ($skill($1)) return $skill($1)
  2249.   elseif ($regex($1,/cmb-est$/Si)) return cmb-est
  2250.   elseif ($regex($1,/co?mba?t?%?/Si)) return cmb
  2251.   elseif ($regex($1,/(high|low)$/Si)) return highlow
  2252.   elseif ($regex($1,/(le?ve?l|exp)( |$)/Si)) return level
  2253.   elseif ($regex($1,/rank$/Si)) return rank
  2254.   elseif ($regex($1,/compare$/Si)) return compare
  2255.   elseif ($regex($1,/Charm(s)?/Si)) return charm
  2256.   elseif ($regex($1,/(con)?grat[sz]\b/Si)) return gratz
  2257.   elseif ($regex($1,/F(airy(Ring)?|R)( |$)/Si))  return fairy
  2258.   elseif ($regex($1,/(gu|geupdate)$/Si)) return geupdate
  2259.   elseif ($regex($1,/ge$/Si)) && (!$regex($1,/geup/)) return ge
  2260.   elseif ($regex($1,/cs$/Si)) return coinshare
  2261.   elseif ($regex($1,/world$/Si)) return world
  2262.   elseif ($regex($1,/clan$/Si)) return clan
  2263.   elseif ($regex($1,/ml$/Si)) return memberlist
  2264.   elseif ($regex($1,/alog$/Si)) return alog
  2265.   elseif ($regex($1,/(npc|monster)$/Si)) return npc
  2266.   elseif ($regex($1,/quest$/Si)) return quest
  2267.   elseif ($regex($1,/(item|istats)$/Si)) return item
  2268.   elseif ($regex($1,/alch$/Si)) return alch
  2269.   elseif ($regex($1,/track?/Si)) return track
  2270.   elseif ($regex($1,/rswiki$/Si)) return rswiki
  2271.   elseif ($regex($1,/fml$/Si)) return fml
  2272.   elseif ($regex($1,/bash$/Si)) return bash
  2273.   elseif ($regex($1,/(urban|ud)$/Si)) return urban
  2274.   elseif ($regex($1,/(halo|h3)$/Si)) return halo
  2275.   elseif ($regex($1,/(xbl|gc)$/Si)) return xbl
  2276.   elseif ($regex($1,/(gf|googlefight)$/Si)) return gf
  2277.   elseif ($regex($1,/(yt|youtube)$/Si)) return youtube
  2278.   elseif ($regex($1,/google$/Si)) return google
  2279.   elseif ($regex($1,/ascii$/Si)) return ascii
  2280.   elseif ($regex($1,/calc(ulator)$/Si)) return calculator
  2281. }
  2282. dialog cpanel {
  2283.   title "Hermes"
  2284.   size -1 -1 148 87
  2285.   option dbu
  2286.   box "Hermes Easy to use Runescape bot v0.3.8.1", 1, 3 3 143 82
  2287.   edit "#", 2, 55 22 44 12
  2288.   edit "#", 3, 55 38 44 12
  2289.   combo 4, 12 22 37 28, drop
  2290.   button "ok", 5, 12 38 37 12, ok
  2291.   text "Bot colours Channels", 6, 13 13 76 8
  2292.   text "Bot Channel", 7, 104 22 37 12
  2293.   text "Home Channel", 8, 104 38 37 12
  2294.   edit "", 9, 12 56 87 10, multi vsbar
  2295.   edit "", 10, 12 70 87 10, multi vsbar
  2296.   text "Noreply chans", 11, 104 55 37 12
  2297.   text "Invite message", 12, 104 70 37 12
  2298.   check "Auto Bot news", 13, 92 12 50 10
  2299. }
  2300.  
  2301. On *:dialog:cpanel:init:*: {
  2302.   didtok $dname 4 32 02 03 04 06 07 10 13
  2303.   didtok $dname 2 35 $remove($readini(Hermes.ini,settings,Botchan),$chr(126))
  2304.   didtok $dname 3 35 $remove($readini(Hermes.ini,settings,Homechan),$chr(126))
  2305.   didtok $dname 9 96 $remove($readini(Hermes.ini,settings,noreply),$chr(126))
  2306.   didtok $dname 10 96 $remove($readini(Hermes.ini,settings,invmsg),$chr(126))
  2307.   did $iif($readini(Hermes.ini,settings,Botnews) == 1,-c,-u) $dname 13
  2308. }
  2309. On *:dialog:cpanel:sclick:5: {
  2310.   writeini Hermes.ini Settings Colour $iif($did(4).seltext,$v1,13)
  2311.   writeini Hermes.ini Settings Botchan $did(2)
  2312.   writeini Hermes.ini Settings Homechan $did(3)
  2313.   writeini Hermes.ini Settings noreply $didtok(9,32)
  2314.   writeini Hermes.ini Settings invmsg $didtok(10,32)
  2315.   writeini Hermes.ini Settings Botnews $did(13).state
  2316.   $iif($did(13).state == 1,/timerbotnews 0 $duration(1d) sockopen $+(botnews.,$right($ticks,5)) $&
  2317.     beardbot.netii.net 80,/timerbotnews off)
  2318. }
  2319. menu * {
  2320.   -
  2321.   Hermes:Hermes
  2322.   -
  2323. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×