glacier_rat

Glacier_Rat

Jun 22nd, 2010
612
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Runescript Script:
  2. [quote]
  3. Commands:
  4. !stats username
  5. !skill username
  6. !combat username
  7. .!defname username
  8. Extra Info: I added auto protection for hacking it, there is an auto 6sec ignore on any user who triggers to prevent flooding/spam/etc.. , and I added support for channels with mode +c, and you can pm the bot for the script aswell
  9. All aliases required have been added, although I didnt make an item to next level thing, Im not doing all the work for ya lol
  10. btw: combat alias is smooth's cause his owns and i blow at math :D
  11. [/quote]
  12. [code]
  13. alias pcp { return $calc($floor($calc(($1 * $1) / 600)) * 35) }
  14. alias s1 { return $iif(c isincs $chan($1).mode,$strip($2-),$+($chr(3),10,$2-)) }
  15. alias s2 { return $iif(c isincs $chan($1).mode,$strip($2-),$+($chr(3),07,$2-)) }
  16. alias s3 { return $iif(c isincs $chan($1).mode,$strip($2-),$+($chr(3),03,$2-)) }
  17. alias fskill {
  18.   return $findtok(Stats.Atk.Def.Str.Hp.Range.Pray.Mage.Cook.Wc.Fletch.Fish.Fm.Craft.Smith.Mine.Herb.Agil.Thief.Slay.Farm.Rc.Hunt.Con.Summ.Dung,$1,46)
  19. }
  20. alias gskill {
  21.   return $gettok(Stats.Attack.Defence.Strength.Hitpoints.Ranged.Prayer.Magic.Cooking.Woodcutting.Fletch.Fish.Firemake.Craft.Smith.Mine.Herb.Agility.Thief.Slayer.Farm.Rc.Hunt.Construct.Summon.Dungeoneering,$1,46)
  22. }
  23. alias iSkill {
  24.   if ($regex($1,/^(cmb|combat)$/Si)) return Combat
  25.   elseif ($1 == 1) || ($regex($1,/^(rsstats|stats|overall)$/Si)) return Stats
  26.   elseif ($1 == 2) || ($regex($1,/^at(t|k|tack)$/Si)) return Atk
  27.   elseif ($1 == 3) || ($regex($1,/^def(en[cs]e)?$$/Si)) return Def
  28.   elseif ($1 == 4) || ($regex($1,/^str(ength|enght)?$/Si)) return Str
  29.   elseif ($1 == 5) || ($regex($1,/^hp|hit(s|points?)?$/Si)) return Hp
  30.   elseif ($1 == 6) || ($regex($1,/^range(r|d|ing)?$/Si)) return Range
  31.   elseif ($1 == 7) || ($regex($1,/^Pray(er)?$$/Si)) return Pray
  32.   elseif ($1 == 8) || ($regex($1,/^mag(e|ic)$$/Si)) return Mage
  33.   elseif ($1 == 9) || ($regex($1,/^cook(ing)?$/Si)) return Cook
  34.   elseif ($1 == 10) || ($regex($1,/^wc|wood(cut(ting)?)?$/Si)) return Wc
  35.   elseif ($1 == 11) || ($regex($1,/^fletch(ing)?$/Si)) return Fletch
  36.   elseif ($1 == 12) || ($regex($1,/^fish(ing)?$/Si)) return Fish
  37.   elseif ($1 == 13) || ($regex($1,/^(fire|fm)(make?(ing)?|ing)?$/Si)) return Fm
  38.   elseif ($1 == 14) || ($regex($1,/^craft(ing)?$/Si)) return Craft
  39.   elseif ($1 == 15) || ($regex($1,/^(smith|smelt)(ing)?$/Si)) return Smith
  40.   elseif ($1 == 16) || ($regex($1,/^min(e|ing)?$/Si)) return Mine
  41.   elseif ($1 == 17) || ($regex($1,/^herb(law|lore)?$/Si)) return Herb
  42.   elseif ($1 == 18) || ($regex($1,/^agil(ity)?$/Si)) return Agil
  43.   elseif ($1 == 19) || ($regex($1,/^(th(ei|ie)[fv](e|ing)?)$/Si)) return Thief
  44.   elseif ($1 == 20) || ($regex($1,/^slay(er|ing)?$/Si)) return Slay
  45.   elseif ($1 == 21) || ($regex($1,/^farm(er|ing)?$/Si)) return Farm
  46.   elseif ($1 == 22) || ($regex($1,/^(rc|runecraft)(er|ing)?$/Si)) return Rc
  47.   elseif ($1 == 23) || ($regex($1,/^hunt(er|ing)?$/Si)) return Hunt
  48.   elseif ($1 == 24) || ($regex($1,/^(con|construct)(ion|ing)?$/si)) return Con
  49.   elseif ($1 == 25) || ($regex($1,/^(summon)(ing)?$/si)) return Summ
  50.   elseif ($1 == 26) || ($regex($1,/^(dg|dun)?(g|ge|geon|geoneering)?$/si))  return Dungeoneering
  51. }
  52. alias exp {
  53.   /var %x = 1, %level = $calc($1 - 1), %xp = 0
  54.   /while (%x <= %level) {
  55.     /var %tempxp = $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4)
  56.     /inc %xp %tempxp
  57.     /inc %x
  58.   }
  59.   /return $int(%xp)
  60. }
  61. alias cmb {
  62.   tokenize 46 $1-
  63.   var %att = $calc($2 * 100), %btt = $calc($4 * 100), %ett = $calc($1 * 130), %ftt = $calc($3 * 130)
  64.   var %ctt = $iif($and($6,1) == 1,$calc($calc($6 - 1) * 50),$calc($6 * 50)), %dtt = $iif($and($8,1) == 1,$calc($calc($8 - 1) * 50),$calc($8 * 50))
  65.   var %gtt = $iif($and($5,1) == 1,$calc($calc($calc($5 - 1) + $calc($5 * 2)) * 65),$calc($5 * 195)), %htt = $iif($and($7,1) == 1,$calc($calc($calc($7 - 1) + $calc($7 * 2)) * 65),$calc($7 * 195))
  66.   var %base = $calc($calc(%att + %btt + %ctt + %dtt) / 400), %mclass = $calc($calc(%ett + %ftt) / 400), %rclass = $calc(%gtt / 400), %maclass = $calc(%htt / 400)
  67.   if ((%mclass > %rclass) && (%mclass > %maclass)) { return $calc(%mclass + %base) Melee Based }
  68.   elseif ((%rclass > %mclass) && (%rclass > %maclass)) { return $calc(%rclass + %base) Ranged Based }
  69.   elseif ((%maclass > %mclass) && (%maclass > %rclass)) { return $calc(%maclass + %base) Magic Based }
  70. }
  71. On $*:TEXT:/^[!.](def|set)(name|rsn)/Si:*: {
  72.   if ($count($1-,$,%,#,^,&,*) > 0) { halt }
  73.   if ($len($2-) <= 12) && ($len($2-) >= 3) {
  74.     writeini -n DefRSN.ini $address($nick,3) rsn $replace($2-,$chr(32),_)
  75.     notice $nick Hostmask $address($nick,3) Has been registred to the name: $2-
  76.   }
  77.   else { notice $nick Error in trying to set a defname }
  78. }
  79. on $*:TEXT:/^.\D/S:*:{
  80.   if (!$iSkill($right($1,-1))) { halt }
  81.   if ($count($1-,$,%,#,^,&,*) > 0) { msg $chan $s1($chan,[) $s2($chan,ERROR) $s1($chan,]) $s1($chan,:) $s1($chan,Illegal characters detected, 60 second ignore to prevent abuse) | .ignore $+(-pcntikdu,60) $address($nick,2) | halt }
  82.   var %lookup = $iSkill($right($1,-1))
  83.   var %z = $+($r(1,100),$r(1,100),$r(1,100),$r(1,100),$r(1,100),$r(1,100),$r(1,100),$r(1,100))
  84.   sockopen $+(stats,.%z) hiscore.runescape.com 80
  85.   sockmark $+(stats,.%z) $+($iif($query($nick),.msg $nick,$iif($left($1,1) == @,msg $chan,notice $nick)),.,$iif($2,$replace($2-,$chr(32),_),$iif($readini(DefRSN.ini,$address($nick,3),rsn),$v1,$replace($nick,$chr(32),_))),.,%lookup,.,$iif($query($nick),$nick,$chan))
  86.   .ignore $+(-pcntikdu,6) $address($nick,2)
  87.   if ($query($nick)) { close -m }
  88. }
  89. on *:SOCKOPEN:stats.*: {
  90.   tokenize 46 $sock($sockname).mark
  91.   if ($len($2) > 12) || ($len($2) < 3) {
  92.     $1 $s1($4,[) $s2($4,ERROR) $s1($4,]) $s1($4,:) $s1($4,Please specify a RSN less then) $s2($4,12) $s1($4,characters and greater then) $s2($4,3)
  93.   }
  94.   else {
  95.     sockwrite -n $sockname GET $+(/index_lite.ws?player=,$2) HTTP/1.1
  96.     sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
  97.   }
  98. }
  99. on *:SOCKREAD:stats.*: {
  100.   var %chan = $gettok($sock($sockname).mark,4,46)
  101.   if ($sockerr) {
  102.     $gettok($sock($sockname).mark,1,46) $s1(%chan,Socket Error)
  103.     halt
  104.   }
  105.   var %stats
  106.   sockread %stats
  107.   if (*404 - Page not found* iswm %stats) {
  108.     $gettok($sock($sockname).mark,1,46) $s1(%chan,[) $s2(%chan,ERROR) $s1(%chan,]) $s1(%chan,:) $s2(%chan,$gettok($sock($sockname).mark,2,46)) $s1(%chan,not found in highscores)
  109.     sockclose $sockname
  110.     halt
  111.   }
  112.   if (*,*,* iswm %stats) {
  113.     tokenize 44 %stats
  114.     sockmark $sockname $+($gettok($sock($sockname).mark,1-,46),.,$+($1 $2 $3))
  115.   }
  116. }
  117. on *:SOCKCLOSE:stats.*: {
  118.   var %lookup = $gettok($sock($sockname).mark,3,46),%chan = $gettok($sock($sockname).mark,4,46),%s = $gettok($sock($sockname).mark,5-,46)
  119.   var %loc = $fskill(%lookup),%sloc = $gskill(%loc)
  120.   if (%lookup == Stats) {
  121.     var %t = 1 | while (%t <= 25) { var %g %g $+($s1(%chan,$iSkill(%t)),$chr(32),$s2(%chan,$gettok($gettok(%s,%t,46),2,32))) | inc %t }
  122.     $gettok($sock($sockname).mark,1,46) $s1(%chan,[) $s2(%chan,$gettok($sock($sockname).mark,2,46)) $s1(%chan,]) $s1(%chan,:) %g
  123.   }
  124.   if (%lookup = Combat) {
  125.     var %D = $gettok($gettok(%s,3,46),3,32),%H = $gettok($gettok(%s,5,46),3,32),%P = $gettok($gettok(%s,7,46),3,32),%A = $gettok($gettok(%s,2,46),3,32),%St = $gettok($gettok(%s,4,46),3,32),%SU = $gettok($gettok(%s,25,46),3,32),%M = $gettok($gettok(%s,8,46),3,32),%R = $gettok($gettok(%s,6,46),3,32)
  126.     var %cest = $calc(%A + %D + %H + %St + %SU + %M + %R + %P),%est = $round($calc((%cest / $iif($gettok($gettok(%s,1,46),3,32) == -1,1,$v1)) * 100),2)
  127.     var %tD = $gettok($gettok(%s,3,46),2,32),%tH = $gettok($gettok(%s,5,46),2,32),%tP = $gettok($gettok(%s,7,46),2,32),%tA = $gettok($gettok(%s,2,46),2,32),%tSt = $gettok($gettok(%s,4,46),2,32),%tSU = $gettok($gettok(%s,25,46),2,32),%tM = $gettok($gettok(%s,8,46),2,32),%tR = $gettok($gettok(%s,6,46),2,32)
  128.     var %cmb = $cmb($replace($+(%tA,.,%tD,.,%tSt,.,%tH,.,%tR,.,%tP,.,%tM,.,%tSU),-1,1))
  129.     var %rank = $iif($gettok($gettok(%s,1,46),1,32) = -1,-,$v1),%lvl = $iif($gettok($gettok(%s,1,46),2,32) = -1,-,$v1),%exp = $iif($gettok($gettok(%s,1,46),3,32) = -1,-,$v1)
  130.     $gettok($sock($sockname).mark,1,46) $s1(%chan,[) $s2(%chan,$gettok($sock($sockname).mark,2,46)) $s1(%chan,]) $s1(%chan,:) $s1(%chan,$chr(40)) $s2(%chan,%cmb) $s1(%chan,$chr(41)) $&
  131.       $s1(%chan,Rank) $s2(%chan,%rank) $s1(%chan,Level) $s2(%chan,$bytes(%lvl,b)) $s1(%chan,Experience) $s2(%chan,$bytes(%exp,b)) $s1(%chan,Combat Exp) $s2(%chan,$bytes(%cest,b)) $s1(%chan,Combat%) $s2(%chan,$iif(%exp = -,-,$+(%est,%))) $&
  132.       $s1(%chan,Attack) $s2(%chan,$gettok($gettok(%s,2,46),2,32)) $s1(%chan,Strength) $s2(%chan,$gettok($gettok(%s,4,46),2,32)) $s1(%chan,Defence) $s2(%chan,$gettok($gettok(%s,3,46),2,32)) $s1(%chan,Hitpoints) $s2(%chan,$gettok($gettok(%s,5,46),2,32)) $&
  133.       $s1(%chan,Prayer) $s2(%chan,$gettok($gettok(%s,7,46),2,32)) $s1(%chan,Magic) $s2(%chan,$gettok($gettok(%s,8,46),2,32)) $s1(%chan,Ranged) $s2(%chan,$gettok($gettok(%s,6,46),2,32)) $s1(%chan,Summoning) $s2(%chan,$gettok($gettok(%s,25,46),2,32)) $s1(%chan,Dungeoneering) $s2(%chan,$gettok($gettok(%s,10,46),2,32
  134.   }
  135.   if (!$istok(Stats.Combat,%lookup,46)) {
  136.     var %r = $gettok($gettok(%s,%loc,46),1,32),%l = $gettok($gettok(%s,%loc,46),2,32),%e = $gettok($gettok(%s,%loc,46),3,32)
  137.     $gettok($sock($sockname).mark,1,46) $s1(%chan,[) $s2(%chan,$gettok($sock($sockname).mark,2,46)) $s1(%chan,]) $s1(%chan,:) $&
  138.       $s1(%chan,Skill) $s2(%chan,%sloc) $s1(%chan,Rank) $s2(%chan,$bytes(%r,b)) $s1(%chan,Level) $s2(%chan,$bytes(%l,b)) $s1(%chan,Experience) $s2(%chan,$bytes(%e,b)) $&
  139.       $s1(%chan,Exp to) $iif(%l < 99,$s1(%chan,Level) $s2(%chan,$calc(%l + 1)) $s2(%chan,$bytes($calc($exp($calc(%l + 1)) - %e),b)),$s1(%chan,Perfection) $s2(%chan,$bytes($calc(200000000 - %e),b))) $&
  140.       $iif(%l < 99 && $istok(Attack.Defence.Strength.Hitpoints.Magic.Ranged.Prayer,%sloc,46),$s1(%chan,Pc points to) $s2(%chan,$calc(%l + 1)) $s2(%chan,$calc($calc($exp($calc(%l + 1)) - %e) / $pcp($calc(%l + 1))) ) )
  141.     ;to add items to next level make it urself and use $exp($calc(%l + 1) to return exp to next level calc it yourself
  142.     if ($istok(#world148 #glacier_Rat #xp #shelfy #worldcup #tezz #irchelp #xbnc #swiftirc #bnc #onzichtbaar ,$chan,32)) { HALT }
  143.   }
  144. }
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.

×