All pastes #948060 Raw Edit

Mine

public text v1 · immutable
·published 2008-03-18 21:38 UTC
rendered paste body
on *:text:!next*:#: {
  if (runescript ison $chan || %runescript ison $chan || $chan == #rs) { halt }
  if ($readini(Combatcheck.ini,$chan,$network) == on || $chan == #fireworkingarea) { 
    if ($sock(next)) sockclose next
    set %next.nick $2
    set %next.display msg $chan
    set %color.nick $nick
    sockopen next www.rscript.org 80 
  }
}
on *:sockopen:next: { 
  sockwrite -nt $sockname GET /lookup.php?type=stats&user= $+ %next.nick HTTP/1.1
  sockwrite -nt $sockname Host: www.rscript.org
  sockwrite -nt $sockname $crlf 
}
on *:sockread:next: {
  if ($sockerr) { %exp.display Error please inform $me about this error | halt
  }
  var %sockreader
  sockread %sockreader 
  if (*stat* iswm %sockreader) { hadd -m next $remove(%sockreader,STAT:,) }
  if (*STAT: not found* iswm %sockreader) { %next.display $c1(%next.nick) $c2(Does not show in the High Scores page.) | sockclose $sockname | halt }
  if (*end* iswm %sockreader) {  
    set %test $hget(next,attack)
    set %x 2
    while (%x <= 25) { 
      tokenize 32 $hget(next,$setskill(%x))
      set %nextlevel $calc($2 + 1)
      if ($2 < 99) {
        set %next. $+ $setskill(%x) $calc($readini(experiance.ini,skills,%nextlevel) - $3),$chr(173)
      }
      else { set %next. $+ $setskill(%x) $3 }
      inc %x
    }
    set %next.to.exp %next.Attack | set %next.to Attack
    if (%next.to.exp >= %next.Summoning) { set %next.to.exp %next.Summoning | set %next.to Summoning }
    if (%next.to.exp >= %next.defence) { set %next.to.exp %next.defence | set %next.to Defence }
    if (%next.to.exp >= %next.Hitpoints) { set %next.to.exp %next.Hitpoints | set %next.to Hitpoints }
    if (%next.to.exp >= %next.Ranged) { set %next.to.exp %next.Ranged | set %next.to Ranged }
    if (%next.to.exp >= %next.Prayer) { set %next.to.exp %next.Prayer | set %next.to Prayer }
    if (%next.to.exp >= %next.Magic) { set %next.to.exp %next.Magic | set %next.to Magic }
    if (%next.to.exp >= %next.Cooking) { set %next.to.exp %next.Cooking | set %next.to Cooking }
    if (%next.to.exp >= %next.Woodcutting) { set %next.to.exp %next.Woodcutting | set %next.to Woodcutting }
    if (%next.to.exp >= %next.Fletching) { set %next.to.exp %next.Fletching | set %next.to Fletching }
    if (%next.to.exp >= %next.Fishing) { set %next.to.exp %next.Fishing | set %next.to Fishing }
    if (%next.to.exp >= %next.Firemaking) { set %next.to.exp %next.Firemaking | set %next.to Firemaking }
    if (%next.to.exp >= %next.Crafting) { set %next.to.exp %next.Crafting | set %next.to Crafting }
    if (%next.to.exp >= %next.Smithing) { set %next.to.exp %next.Smithing | set %next.to Smithing }
    if (%next.to.exp >= %next.Mining) { set %next.to.exp %next.Mining | set %next.to Mining }
    if (%next.to.exp >= %next.Herblore) { set %next.to.exp %next.Herblore | set %next.to Herblore }
    if (%next.to.exp >= %next.Agility) { set %next.to.exp %next.Agility | set %next.to Agility }
    if (%next.to.exp >= %next.Thieving) { set %next.to.exp %next.Thieving | set %next.to Thieving }
    if (%next.to.exp >= %next.Slayer) { set %next.to.exp %next.Slayer | set %next.to Slayer }
    if (%next.to.exp >= %next.Farming) { set %next.to.exp %next.Farming | set %next.to Farming }
    if (%next.to.exp >= %next.Hunter) { set %next.to.exp %next.Hunter | set %next.to Hunter }
    if (%next.to.exp >= %next.Runecraft) { set %next.to.exp %next.Runecraft | set %next.to Runecraft }
    if (%next.to.exp >= %next.Construction) { set %next.to.exp %next.Construction | set %next.to Construction }
    if (%next.to.exp >= %next.Strength) { set %next.to.exp %next.strength | set %next.to strength }
    %next.display ***[ $+ $c1(%next.nick) $+ ]: Closest level up is $c1(%next.to) in $c1($bytes(%next.to.exp,b)) Exp.
    sockclose $sockname | unset %next.* | hfree next
  }
}

alias -l setskill { 
  if ($regex($1,/^(total|overall)/Si)) || ($1 == 1) { Return Overall } 
  elseif ($regex($1,/^(att|atk|attack)/Si)) || ($1 == 2) { Return Attack } 
  elseif ($regex($1,/^(str|strenth|strength)/Si)) || ($1 == 4) { Return Strength } 
  elseif ($regex($1,/^(def|defend|defence)/Si)) || ($1 == 3) { Return Defence } 
  elseif ($regex($1,/^(hp|hits|hitpoints|hit)/Si)) || ($1 == 5) { Return Hitpoints } 
  elseif ($regex($1,/^(range|ranging|arch|archery|arching)/Si)) || ($1 == 6) { Return Ranged } 
  elseif ($regex($1,/^(pray|prayer|praying)/Si)) || ($1 == 7) { Return Prayer } 
  elseif ($regex($1,/^(mage|magic)/Si)) || ($1 == 8) { Return Magic } 
  elseif ($regex($1,/^(cook|cooking)/Si)) || ($1 == 9) { Return Cooking } 
  elseif ($regex($1,/^(wc|wood|woodcut|woodcutting)/Si)) || ($1 == 10) { Return Woodcutting } 
  elseif ($regex($1,/^(fletch|fletching)/Si)) || ($1 == 11) { Return Fletching } 
  elseif ($regex($1,/^(Fish(ing)?|fishing|fishcatching)/Si)) || ($1 == 12) { Return Fishing } 
  elseif ($regex($1,/^(fm|fire|firemaking)/Si)) || ($1 == 13) { Return Firemaking } 
  elseif ($regex($1,/^(craft|crafting)/Si)) || ($1 == 14) { Return Crafting } 
  elseif ($regex($1,/^(smithing|metalmaking|smith)/Si)) || ($1 == 15) { Return Smithing } 
  elseif ($regex($1,/^(Mine|mining)/Si)) || ($1 == 16) { Return Mining } 
  elseif ($regex($1,/^(Herb|Herblore)/Si)) || ($1 == 17) { Return Herblore } 
  elseif ($regex($1,/^(Agil|agi|Agility)/Si)) || ($1 == 18) { Return Agility } 
  elseif ($regex($1,/^(th(ei|ie)[fv](e|ing)?)$/Si)) || ($1 == 19) { return Thieving } 
  elseif ($regex($1,/^(slay|slayer)/Si)) || ($1 == 20) { Return Slayer } 
  elseif ($regex($1,/^(farm|Farming|planting)/Si)) || ($1 == 21) { Return Farming } 
  elseif ($regex($1,/^(rune|rc|runecrafting|runecraft)/Si)) || ($1 == 22) { Return Runecraft } 
  elseif ($regex($1,/^(hunt|hunting|hunter)/Si)) || ($1 == 23) { return Hunter } 
  elseif ($regex($1,/^con(scruct)?(tion)?/Si)) || ($1 == 24) { return Construction } 
  elseif ($regex($1,/^(sum|summon|summoning)/Si)) || ($1 == 25) { return Summoning } 
}