All pastes #296096 Raw Edit

Divers

public text v1 · immutable
#296096 ·published 2006-12-29 23:13 UTC
rendered paste body
on *:TEXT:!event*:#: { .notice $nick We are now holding a monthly Dueling Arena Event, this is your one chance to own an OP now doesn't that sound good? All you have to do is behave and bring people into the channel. Sounds easy right? Then get to it! } 
on *:TEXT:!kq*:#: { msg $chan KQ trip today, we need about 3-4 people with veracs, donations of sharks and P Pots are appreciated . }

on *:TEXT:!tb*:#: { 
  if ($nick isop $chan) || ($nick ishop $chan) {
    if (!$nick($chan,$2)) { 
      .notice $nick $2 isn't on $chan 
    } 
    elseif ($3 !isnum) { 
      .notice $nick The time for the ban is invalid, it must be a number.
    } 
    elseif (!$4) { 
      .notice $nick Please put a reason.
    } 
    elseif ($nick($chan,$2,oh)) { 
      notice $nick I will not use this command on Ops and Halfops
    } 
    elseif ($nick($chan,$nick,oh)) { 
      inc %kcount 
      ban $+(-,ku,$calc($3 * 60)) $chan $2 3 4 $2 is thrown inside a volcano! BURN IN HELL - 5Noobs burnt:4 ( $+ %kcount $+ ) 
      .notice $2 You have been banned from $chan for $3 minutes Reason: $4- - $3
    } 
  } 
  on *:unban:#:{ 
    if $bnick { .notice $bnick You have been unbanned from $chan } 
  }
}

on *:JOIN:#:{ 
  if ($nick != Sefirosu|Sephiroth) { 
    /notice $nick 12Hello5 $nick 12Require a voice within3 $chan  ?  
    /notice $nick 12Then please use your Runescape Nick and also Pm a H-Op or an OP in Runescape
  }
}

on *:TEXT:!commands*:#: { /msg $nick $2 the commands are !pm, !cmb, !price, !stats, !wsuggest, !pcw, !Requirements, !Rules, !World, !Worldinfo, !calc, !clan. }
on $*:TEXT:/^[@!]k ./Si:#:{ if $nick($chan,$nick,oh) { kick $chan $2 $3- } }
on *:TEXT: brb*:#: { msg $chan $2 $nick Remember to check the PCW when you come back. }
on *:TEXT:!Requirements*:#* { .notice $nick The Requirements with #Sacred-PC are 90+ combat and /or 80 Magic/Ranged. }
on *:TEXT: !pm*:#: { msg $chan $2 1DON'T GOT A 12VOICE?1 THEN PM A 7 H-OP1 OR AN 4 OP 1 IN RUNESCAPE FOR 12VOICE. }
on *:TEXT: back*:#: { msg $chan $2 $nick Type !PCW incase the world may have changed while you were away. }
on *:TEXT: !wsuggest*:#: { .notice $nick Thank you for suggesting a world our admin are checking it out now. }
on *:TEXT:!Rules*:#: { .notice $nick $2 Please Type !Rule 1 To !Rule 6 For Rules 1 though to 6. }
on *:TEXT:!World*:#:{ msg $chan If you wish to help us out by finding worlds please type /join #Sacred-Worlds or simply double click #Sacred-Worlds , MAKE SURE you read the Topic . }
on *:TEXT:!info*:#: { msg $chan Remember that NO access is given in #Sacred-Worlds, so even if your an H-OP in here, you won't have it in #Sacred-Worlds. }
on *:TEXT:!Rule 1*:#: { /msg $nick Do not Multi PC. }
on *:TEXT:!Rule 2*:#: { /msg $nick Do not use @ signs. }
on *:TEXT:!Rule 3*:#* { /msg $nick NEVER say world in room }
on *:TEXT:!Rule 4*:#* { /msg $nick To gain Autovoice within #Sacred-PC you must stay active and also bring new people into the chanel, that also goes for H-op's. }
on *:TEXT:!Rule 5*:#* { /msg $nick You must ALWAYS use your RSN within #Sacred-PC so we know who you are. }
on *:TEXT:!Rule 6*:#* { /msg $nick No swearing of anykind is permitted within #Sacred-PC. }
Coded By Pc_Dark
OSS Team - Admin@O-SS.Net
http://o-ss.net
!calc | @calc
*/
on $*:text:/^[!@.>]calc */Si:#: {
  ;;; If there is a equation;;;;
  if ($2) {
    $iif($left($1,1) == @ && ($nick !isreg $chan),msg $chan,.notice $nick) 02 $2- is:02 10 $bytes($calc($replace($remove($2-,$chr(32)),K,000,M,000000)),b) 10
    /halt
  }
  /notice $nick Specify an Equation!
}
on *:text:!clan*:#:{
  /set %csearch.chan $chan
  /set %csearch.nick $2
  if ($sock(clansearch)) { /sockclose search }
  /sockopen clansearch runehead.com 80
}

on *:sockopen:clansearch:{
  sockwrite -nt $sockname GET /clans/search.php?search= $+ %csearch.nick $+ &searchtype=exact HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf $crlf
}

on *:sockread:clansearch:{
  /var %cstatus  
  sockread %cstatus
  if ($SockErr) { /msg %csearch.chan Sorry an error occured. }
  else {
    if ( *'ml.php?clan=*'>*</a></td> iswm %cstatus ) { /msg %csearch.chan %csearch.nick is in $htmlfree(%cstatus) }
  }
}
alias -l htmlfree {
  ; Cleans all html from a file
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
alias c1 { return $+(07,$1-) }
alias c2 { return $+(04,$1-) }
alias c3 { return $+(10,$1-) }
alias c4 { return $+(02,$1-) }
alias c5 { return $+(04,$1-) }
alias c6 { return $+(03,$1-) }

on *:TEXT:!kb*:*:{ if ($nick isop $chan) {
    .mode # -o $2
    .mode $chan +b $address($2,3) $2 $address($2,4) $address($2,6) )
    .kick $chan $2  $3-  $+ [ $+ $nick $+ ]
.msg $chan $2 <---= N00b got owned!! } }

on *:TEXT:!setpcw*:*: {
  if ($nick isop $chan) || ($nick ishop $chan) {
    set %world $2
    notice $nick Changed Pest control World to $2 $+ .
  }
  else { /notice $nick Sorry, You are not a Half-Op or an Op, Only Half-Ops and Op's can set world. }
}
on *:VOICE:#:{ if ($vnick == $me) { inc %vo 1 | msg $chan Thanks For The Voice $nick 2 (I've been Voiced4 %vo 2Times) }
}
on *:devoice:#:{ if ($vnick == $me) { inc %dv 1 | msg $chan There goes my voice thanks alot $nick 4 (I've lost voice4 %dv 7times) }
}
on *:op:#:{ if ($opnick == $me) { inc %op 1 | msg $chan YaY! i get OP Thank you $nick 5(I've had12 %op 4ops) }
}
on *:deop:#:{ if ($opnick == $me) { inc %do 1 | msg $chan Noo! not my op status Evil Bitch....was not me, Please OP me again $nick 3(I've had14 %do 5Deops) }
}
on *:help:#:{ if ($hnick == $me) { inc %ho 1 | msg $chan Thanks For The half op $nick 2(I've been halfopd4 %ho 7Times) }
}
on *:dehelp:#:{ if ($hnick == $me) { inc %dho 1 | msg $chan Aww Please give me my half op back $nick 15(I've lost halfop4 %dho 5Times) }
}
}
on $*:text:/^[!@]price(s|check)*/Si:#: {
if ( !$2 ) { notice $nick Sorry you must specify what to search for - !price <item> }
else {
  /var %number 1
  while ($sock(price.socket. $+ %number)) { /inc %number }
  if (!* iswm $1) { /set %price.displaystyle. [ $+ [ %number ] ] private }
  /set %price.item. [ $+ [ %number ] ] $2-
  /set %price.nick. [ $+ [ %number ] ] $nick
  /set %price.chan. [ $+ [ %number ] ] $chan
  /sockopen $+(price.socket.,%number) zybez.net 80
} ;Closes Else
} ;Ends the !pricecheck section

on *:sockopen:price.socket.*:{
  sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $replace(%price.item. [ $+ [ $right($SockName,-13) ] ] ,$chr(32),$chr(43)) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1
  sockwrite -nt $sockname Host: zybez.net
  sockwrite -nt $sockname $crlf $crlf
}

on *:sockread:price.socket.*:{
  var %i $right($sockname,-13)
  if ($sockerr) { /notice %price.nick. [ $+ [ %i ] ] Sorry but an error occured while searching for %price.item. [ $+ [ %i ] ] | halt }
  else {
    var %temptext
    sockread %temptext
    ;Once bot gets the Item + Price which is represented my %readnextline == 2, it runs this to display the results for the user then restarts the whole proccess.

    if (%readnextline == 2) {
      /inc %price.displayed. [ $+ [ %i ] ]
      /var %price.displayprice $htmlfree(%temptext)
      /var %message 12,15 %price.displayitem. [ $+ [ %i ] ] - %price.displayprice
      /unset %readnextline

      ; Limits how many items are displayed before it stops reading. Prevents the bot from flooding.
      if ( %price.displayed. [ $+ [ %i ] ] < 6 ) {
        if ( %price.displaystyle. [ $+ [ %i ] ] == private ) { /notice %price.nick. [ $+ [ %i ] ] %message }
        else { /msg %price.chan. [ $+ [ %i ] ] %message }
      } ; Closes if statement - if ( %price.displayed. [ $+ [ %i ] ] < 6 )
      else { /notice %price.nick. [ $+ [ %i ] ] Sorry but your search for " $+ %price.item. [ $+ [ %i ] ] $+ " was not specific enough. Please narrow your searh down, ie: Rune --> Rune Platelegs | /sockclose $+(price.socket.,%i) | /unset %price.*. [ $+ [ %i ] ] }
    } ; Closes if statement - if (%readnextline == 2)

    if (%readnextline == 1) { /set %price.displayitem. [ $+ [ %i ] ] $htmlfree(%temptext) | /set %readnextline 2 }
    if ( *<img src="/img/member.gif"* iswm %temptext || <td class="tablebottom"><!-- Blank --></td> isin %temptext || <!-- <td class="tablebottom">Zybez is screwing up our parser because we don't credit them. ^_^</td> isin %temptext || <td class="tablebottom">http://www.zybez.net</td> --> isin %temptext) { /set %readnextline 1 }
    if (*Your search did not * iswm %temptext) { /notice %price.nick. [ $+ [ %i ] ] Sorry I did not find " $+ %price.item. [ $+ [ %i ] ] $+ " in the Zybez database. Please make sure you spelled everything correctly and the item you are searching for exists in Runescape. }
  } ; Closes else
} ;Ends the sockread section

on *:sockclose:price.socket.*:{ /unset %price.*. [ $+ [ $right($SockName,-13) ] ] }


alias -l htmlfree {
  ; Cleans all html from a file
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
} ;Ends the html cleaner alias   

on 1:text:*!nlvl*:#:{ 
  var %nlvl = $rand(1,4)
  describe $chan is looking on hiscores...
  if (%nlvl == 1) .timer 1 2 msg $chan 12Your combat lvl is 46...(noob!)
  if (%nlvl == 2) .timer 1 2 msg $chan 6I'm sorry to say but you'r a noob...
  if (%nlvl == 3) .timer 1 2 msg $chan 12What to lazy to look say !stats? 6(noob)
  if (%nlvl == 4) .timer 1 2 msg $chan 9I'll give you his combat lvl if you give me 5 bucks.
}
on $*:TEXT:/^[@!]thebigredbutton ./Si:#:{ if $nick($chan,$nick,oh) { kick $chan $2 $3- } }
on *:TEXT:`game*:#: { .notice $2 $nick i have a fun game i think u will like but u have to say `2. }
on *:TEXT:`2*:#: { .notice $2 $nick the game is realy realy funny just say `3. }
on *:text:`3*:#: { .notice $@ $nick to start just say bigredbutton. }

alias c1 { return $+(12,$1-) }
alias c2 { return $+(04,$1-) }
on *:text:*:#: { 
  tokenize 32 $strip($1-)
  if ($left($1,1) !isin @!.) halt
  if ($right($1,-1) == stats) {
    var %style = astats
    if ($2 == zezima) {
      hadd -u10 zezima.flood $+($nick,.,$ticks) 1
      if ($hget(zezima.flood,0).item > 6) halt
    }
  }
  elseif ($regex($1,/co?mb(at)?/Si)) var %style = combat
  elseif ($setskill($remove($1,@,!,.))) var %style = istat, %skill = $setskill($remove($1,@,!,.))
  elseif ($right($1,-1) == setname) && ($2) {
    writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($2-,$chr(32),-)
    .notice $nick You're default RSN for the host $mask($fulladdress,3) has been set to $2-
    halt
  }
  else halt

  inc %ID
  if ($len($2-) > 12) {
    $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($2-) $c1(is too long)
    cleanup %ID
    halt
  }
  elseif ($2) set $+(%,stats.rsn.,%ID) $replace($2-,$chr(32),-)
  elseif ($readini(DefRSN.ini,RSNs,$mask($fulladdress,3))) set $+(%,stats.rsn.,%ID) $ifmatch
  elseif ($readini(DefRSN.ini,RSNs,$nick)) set $+(%,stats.rsn.,%ID) $ifmatch
  else set $+(%,stats.rsn.,%ID) $nick

  set $+(%,stats.style.,%ID) %style
  set $+(%,stats.skill.,%ID) %skill
  set $+(%,stats.display.,%ID) $iif($left($1,1) == @,msg $chan,notice $nick)
  sockopen $+(stats.,%ID) hiscore.runescape.com 80
}
on *:sockopen:stats.*: {
  var %id = $gettok($sockname,2,46)
  sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ $($+(%,stats.rsn.,%ID),2) HTTP/1.1
  sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
}
on *:sockread:stats.*: {
  sockread &Incoming
  bwrite $sockname -1 -1 &Incoming
  if ($bfind(&Incoming, 1, </html>).text) makehash $sockname
  elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) {
    $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($($+(%,stats.rsn.,%ID),2)) $c1(Does not appear in the hiscores)
    cleanup $gettok($sockname,2,46)
  }
}
alias -l makehash {
  var %file = $1
  bread %file 1 $file(%file).size &stats
  var %currentstat, %x = 1
  while (%x) {
    var %x = $bfind(&stats,$calc(%x + 1),<a href="overall.ws?table=)
    var %currentstat = $striptags($bvar(&stats,%x,200).text)
    tokenize 10 %currentstat
    hadd -m %file $1 $2 $3 $4 $xp2next($3,$4)
  }
  process %file
}
alias process {
  var %table = $1, %id = $gettok($1,2,46), %x = 0, $&
    %display = $($+(%,stats.display.,%ID),2), $&
    %rsn = $($+(%,stats.rsn.,%ID),2), $&
    %skill = $($+(%,stats.skill.,%ID),2), $&
    %style = $($+(%,stats.style.,%ID),2)
  ;shoot;
  if (%style == astats) {
    while (%x <= 22) {
      tokenize 32 $hget(%table,$setskill(%x))
      if ($2) var %statline = %statline $c1($setskill(%x)) $c2($2)
      inc %x
    }
    %display $c1(Stats for) $c2(%rsn) $+ $c1(:)
    %display %statline
  }
  elseif (%style == istat) {
    if (!$hget(%table,%skill)) %display $c1(The nick) $c2(%rsn) $c1(does not appear in the hiscores for) $c2(%skill)
    else {
      tokenize 32 $hget(%table,%skill)
      %display $c2(%skill) $c1(stats for) $c2(%rsn) $+ $c1(:)
      %display $c1(Rank:) $c2($1) $c1(Level:) $c2($bytes($2,b)) $c1(Exp:) $c2($3) $&
        $iif(%skill != Overall,$c1(Exp to lvl) $c2($calc($2 + 1)) $+ $c1(:) $c2($bytes($4,b)))
      var %pcpoint = $calc(($2 * $2) /6)
      var %pcpray = $calc(($2 * $2) /12)
      if (%skill = Hitpoints) %display $c1(Pest Points to lvl $c2($calc($2 + 1)) $+ $c1(:)) $c2($calc($4 / %pcpoint))
      elseif (%skill = Attack) %display $c1(Pest Points to lvl $c2($calc($2 + 1)) $+ $c1(:)) $c2($calc($4 / %pcpoint))
      elseif (%skill = strength) %display $c1(Pest Points to lvl $c2($calc($2 + 1)) $+ $c1(:)) $c2($calc($4 / %pcpoint))
      elseif (%skill = defence) %display $c1(Pest Points to lvl $c2($calc($2 + 1)) $+ $c1(:)) $c2($calc($4 / %pcpoint))
      elseif (%skill = Prayer) %display $c1(Pest Points to lvl $c2($calc($2 + 1)) $+ $c1(:)) $c2($calc($4 / %pcpray))
    }
  }
  elseif (%style == combat) {
    var %a.mult = .32707, %s.mult = .324, %d.mult = .25, %h.mult = .25, %p.mult = .124, %r.mult = .487, %m.mult = .487
    var %a = $iif($gettok($hget(%table,attack),2,32),$v1,-), $&
      %s = $iif($gettok($hget(%table,strength),2,32),$v1,-), $&
      %d = $iif($gettok($hget(%table,defence),2,32),$v1,-), $&
      %h = $iif($gettok($hget(%table,hitpoints),2,32),$v1,-), $&
      %r = $iif($gettok($hget(%table,ranged),2,32),$v1,-), $&
      %m = $iif($gettok($hget(%table,magic),2,32),$v1,-), $&
      %p = $iif($gettok($hget(%table,prayer),2,32),$v1,-)

    var %meleecombat  = $calc(%a * %a.mult + %s * %s.mult + %d * %d.mult + %h * %h.mult + %p * %p.mult), $&
      %RangedCombat = $calc(%r * %r.mult + %p * %p.mult + %d * %d.mult + %h * %h.mult), $&
      %MagicCombat  = $calc(%m * %m.mult + %p * %p.mult + %d * %d.mult + %h * %h.mult)

    if (%MagicCombat == %RangedCombat) && (%MagicCombat == %RangedCombat) {
      %display $c1(The nick) $c2(%rsn) $c1(does not appear in the hiscores for any combat skills)
      cleanup %id
      halt
    }
    elseif (%MagicCombat > %RangedCombat) && (%MagicCombat > %MeleeCombat) var %cmbstyle = Magic, %Combat = %MagicCombat
    elseif (%RangedCombat > %MeleeCombat) var %cmbstyle = Ranged, %Combat = %RangedCombat
    else var %cmbstyle = melee, %combat = %MeleeCombat

    var %cmb.temp = $abs($calc($int($calc(%combat +1)) - %combat)), $&
      %a.2lvl = $ceil($calc(%cmb.temp / %a.mult)), %s.2lvl = $ceil($calc(%cmb.temp / %s.mult)), $&
      %d.2lvl = $ceil($calc(%cmb.temp / %d.mult)), %m.2lvl = $ceil($calc(%cmb.temp / %m.mult)), $&
      %r.2lvl = $ceil($calc(%cmb.temp / %r.mult)), %p.2lvl = $ceil($calc(%cmb.temp / %p.mult))

    if (%cmbstyle == magic) var %dynamic.2lvl = $c1(Magic:) $c2(%m.2lvl)
    elseif (%cmbstyle == Ranged) var %dynamic.2lvl = $c1(Ranged:) $c2(%r.2lvl)
    else var %dynamic.2lvl = $c1(Att:) $c2(%a.2lvl) $c1(Str:) $c2(%s.2lvl)
    var %combat = $round(%combat,2), %next = $ceil(%combat)

    %display $c2(%rsn) $c1(is) $c2(%combat) $c1(%cmbstyle style combat)
    %display $c1(Attack:) $c2(%a) $c1(Defence:) $c2(%d) $c1(Strength:) $c2(%s) $c1(Hits:) $c2(%h) $&
      $c1(Mage:) $c2(%m) $c1(Range:) $c2(%r) $c1(Pray:) $c2(%p)
    %display $c1(Levels for) $c2(%next) $+ $c1(:) %dynamic.2lvl $&
      $c1(Def/Hp:) $c2(%d.2lvl) $c1(Prayer:) $c2(%p.2lvl)
  }
  cleanup %id
}
alias -l cleanup {
  unset $+(%,stats.*.,$1)
  sockclose $+(Stats.,$1)
  .remove $+(Stats.,$1)
}
alias -l xp {
  var %x = 1, %level = $calc($1 - 1), %xp = 0
  while (%x <= %level) {
    var %TempXp = $calc((%x + 300 * 2^(%x / 7)) /4)
    inc %xp %TempXp
    inc %x
  }
  return $int(%xp)
}

alias -l xp2Next {
  var %xp = $remove($2,$chr(44)), %nextxp = $xp($calc($1 + 1))
  return $calc(%nextxp - %xp)
}
alias -l striptags { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
alias -l setskill {
  if ($1 == 0) || ($regex($1,/^(st|(skill)?total|overall)$/Si)) return Overall
  elseif ($1 == 1) || ($regex($1,/^at(t|k|tack)$/Si)) return Attack
  elseif ($1 == 2) || ($regex($1,/^def(en[cs]e)?$$/Si)) return Defence
  elseif ($1 == 3) || ($regex($1,/^str(ength)?$/Si)) return Strength
  elseif ($1 == 4) || ($regex($1,/^hp|hit(s|points?)?$/Si)) return Hitpoints
  elseif ($1 == 5) || ($regex($1,/^range(r|d|ing)?$/Si)) return Ranged
  elseif ($1 == 6) || ($regex($1,/^Pray(er)?$$/Si)) return Prayer
  elseif ($1 == 7) || ($regex($1,/^mag(e|ic)$$/Si)) return Magic
  elseif ($1 == 8) || ($regex($1,/^cook(ing)?$/Si)) return Cooking
  elseif ($1 == 9) || ($regex($1,/^wc|wood(cut(ting)?)?$/Si)) return Woodcutting
  elseif ($1 == 10) || ($regex($1,/^fletch(ing)?$/Si)) return Fletching
  elseif ($1 == 11) || ($regex($1,/^fish(ing)?$/Si)) return Fishing
  elseif ($1 == 12) || ($regex($1,/^(fire|fm)(make?(ing)?|ing)?$/Si)) return Firemaking
  elseif ($1 == 13) || ($regex($1,/^craft(ing)?$/Si)) return Crafting
  elseif ($1 == 14) || ($regex($1,/^(smith|smelt)(ing)?$/Si)) return Smithing
  elseif ($1 == 15) || ($regex($1,/^mine(ing)?$/Si)) return Mining
  elseif ($1 == 16) || ($regex($1,/^herb(law|lore)?$/Si)) return Herblore
  elseif ($1 == 17) || ($regex($1,/^agil(ity)?$/Si)) return Agility
  elseif ($1 == 18) || ($regex($1,/^(th(ei|ie)[fv](e|ing)?)$/Si)) return Thieving
  elseif ($1 == 19) || ($regex($1,/^slay(er|ing)?$/Si)) return Slayer
  elseif ($1 == 20) || ($regex($1,/^farm(er|ing)?$/Si)) return Farming
  elseif ($1 == 21) || ($regex($1,/^(rc|runecraft)(er|ing)?$/Si)) return Runecraft
  elseif ($1 == 22) || ($regex($1,/^(con)(ion|ing)?$/Si)) return Construction
  elseif ($1 == 23) || ($regex($1,/^hunt(er|ing)?$/Si)) return Hunter