All pastes #339807 Raw Edit

Stuff

public text v1 · immutable
·published 2007-02-04 09:53 UTC
rendered paste body
on *:TEXT:!setpcw*:#:{ msg $chan 12 $- $nick 4Please /msg Xuck 12!setpcw4 $chan 12World4 Thanks :D }
on *:TEXT:!world:#:{
  if ($nick isop $chan) || ($nick ishop $chan) || ($nick isvoice $chan) {
    if ($readini PestControl.ini WORLD $chan == $null) /notice $nick World for $chan not set. type !setpcw to set world.  
    else {
      /notice $nick 4[12PC World4]12 The current Pest Control world is $readini PestControl.ini WORLD $chan
    }
  }
}
on *:TEXT:!pcw*:#:{
  if ($nick isop $chan) || ($nick ishop $chan) || ($nick isvoice $chan) {
    if ($readini PestControl.ini WORLD $chan == $null) /notice $nick World for $chan not set. type !setpcw to set world.  
    else {
      /notice $nick 4[12PC World4]12 The current 4Pest Control12 world is4 $readini PestControl.ini WORLD $chan
    }
  }
}
on *:TEXT:!setpcw*:?:{
  if ($2 == $null || $3 == $null) {
    /msg $nick 4To set 12PC World4 type 12!setpcw4 #channel12 world
  halt }
  else {
    if ($nick isop $2 || $nick ishop $2) {
      .writeini PestControl.ini WORLD $2 $3 Set by: $nick At:  $date $time (+2 GMT)
      msg $2 4[12world4]12 has been updated4,12 Type 4!world12.
    }
  }
}
on *:TEXT:!suggest**:#:{
  /set %suggestedworld $nick suggested world $2
  .msg $chan $nick 12suggested new world.. type 4!sworld12 to see it
}
on *:TEXT:!sworld*:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
    /notice $nick %suggestedworld
  }
}
on *:TEXT:!aov**:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
    /writeini avoice.ini ADRESSES $address($2,2) $2
    /msg $chan added $2 to auto voice list
    /mode $chan +v $2
  }
}
on *:join:#:{
  if ($readini(avoice.ini,ADRESSES,$address($nick,2))) {
    /mode $chan +v $nick
} }


-------------------------------------------------------------------------------

on $*:TEXT:/^[@!]set ?co?m?b((a)?(t))? ?(.+)$/Si:#: {
  if ($nick isop $chan) {
    writeini -n pccheck.ini $chan cmb $regml($regml(0))
    msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The required combat level for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ has been set to $+($chr(3),$iif(? iswm $readini(pccheck.ini,$chan,color2),0 $+ $v2,$v2)) $+ $regml($regml(0))
  }
}
on $*:TEXT:/^[@!]set ?(at[kt]|str) ?(.+)$/Si:#: {
  if ($nick isop $chan) {
    writeini -n pccheck.ini $chan attstr $regml($regml(0))
    msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The required combined attack and strength level for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ has been set to $+($chr(3),$iif(? iswm $readini(pccheck.ini,$chan,color2),0 $+ $v2,$v2)) $+ $regml($regml(0))
  }
}
on $*:TEXT:/^[@!]ban ?(time)? ?(.+)$/Si:#: {
  if ($nick isop $chan) {
    writeini -n pccheck.ini $chan ban $regml($regml(0))
    msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The amount of Seconds a user will be banned when not meeting the requirements for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ has been set to $+($chr(3),$iif(? iswm $readini(pccheck.ini,$chan,color2),0 $+ $v2,$v2)) $+ $regml($regml(0))
  }
}
on $*:TEXT:/^[@!]color1 ?(.+)$/Si:#: {
  if ($nick isop $chan) {
    writeini -n pccheck.ini $chan color1 $regml($regml(0))
    msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The first color for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ has been set to $+($chr(3),$iif(? iswm $readini(pccheck.ini,$chan,color2),0 $+ $v2,$v2)) $+ $regml($regml(0))
  }
}
on $*:TEXT:/^[@!]color2 ?(.+)$/Si:#: {
  if ($nick isop $chan) {
    writeini -n pccheck.ini $chan color2 $regml($regml(0))
    msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The second color for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ has been set to $+($chr(3),$iif(? iswm $readini(pccheck.ini,$chan,color2),0 $+ $v2,$v2)) $+ $regml($regml(0))
  }
}
on $*:TEXT:/^[@!]enable$/:#: {
  if ($nick isop $chan) {
    if ($istok($readini(pccheck.ini,achan,achan),$chan,44)) { msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The combat checking function has already been enabled $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan }
    else {
      writeini -n pccheck.ini achan achan $addtok($readini(pccheck.ini,achan,achan),$chan,44)
      set %pccheck.chans $readini(pccheck.ini,achan,achan)
      if (!$readini(pccheck.ini,$chan,cmb)) { writeini -n pccheck.ini $chan cmb 100 }
      if (!$readini(pccheck.ini,$chan,attstr)) { writeini -n pccheck.ini $chan attstr 180 }
      if (!$readini(pccheck.ini,$chan,color1)) { writeini -n pccheck.ini $chan color1 14 }
      if (!$readini(pccheck.ini,$chan,color2)) { writeini -n pccheck.ini $chan color2 04 }
      if (!$readini(pccheck.ini,$chan,ban)) { writeini -n pccheck.ini $chan ban 600 }
      msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The combat checking function has been enabled for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan $+ $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ $iif($me isop $chan,$chr(46),$iif($me ishop $chan,$chr(46),$chr(44) but I do not have the power to kick users if they do not meet the requirements.))
    }
  }
}
on $*:TEXT:/^[@!]disable$/:#: {
  if ($nick isop $chan) {
    if (!$istok($readini(pccheck.ini,achan,achan),$chan,44)) { msg $chan $+($chr(3),$iif($readini(pccheck.ini,$chan,color1),$v1,14)) $+ The combat checking function has already been disabled $+($chr(3),$iif($readini(pccheck.ini,$chan,color2),$v1,14)) $+ $chan }
    else {
      writeini -n pccheck.ini achan achan $iif($deltok($readini(pccheck.ini,achan,achan),$findtok($readini(pccheck.ini,achan,achan),$chan,1,44),44),$v1,#&null)
      set %pccheck.chans $readini(pccheck.ini,achan,achan)
      msg $chan $+($chr(3),$readini(pccheck.ini,$chan,color1)) $+ The combat checking function has been disabled for $+($chr(3),$readini(pccheck.ini,$chan,color2)) $+ $chan
    }
  }
}
on *:JOIN:%pccheck.chans: {
  pccheck $chan $nick
}
alias pccheck {
  if ($2) {
    var %i 1
    while ($sock(pccheck. $+ %i)) {
      inc %i
    }
    set %pccheck. $+ %i $+ .chan $1
    set %pccheck. $+ %i $+ .user $2
    sockopen pccheck. $+ %i www.o-ss.net 80
  }
}
on *:SOCKOPEN:pccheck.*:{
  /sockwrite -t $sockname GET /parsers/stats.php?user= $+ $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) HTTP/1.1 $+ $crlf
  /sockwrite -t $sockname Host: www.o-ss.net $+ $crlf
  /sockwrite -t $sockname $crlf
}
on *:SOCKREAD:pccheck.*:{
  if ($sockerr) {
    $($+(%,pccheck.,$gettok($sockname,2,46),.self),2) Socket error while looking up $(% $+ $sockname $+ .user,2) $+ : $sockerr
    unset %pccheck. $+
  }
  else {
    sockread %read
    while ($sockbr > 0) {
      sockread %read
      tokenize 32 %read
      if ($1 == <b>Warning</b>:) { msg $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) $+($chr(3),$readini(pccheck.ini,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),color1)) $+ Unable to connect to highscores for user $+($chr(3),$readini(pccheck.ini,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),color2)) $+ $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) | sockclose $sockname }
      else {
        if ($1 == Attack) { var %att = $replace($3,Ranked,1) }
        if ($1 == Defence) { var %def = $replace($3,Ranked,1) }
        if ($1 == Strength) { var %str = $replace($3,Ranked,1) }
        if ($1 == Hitpoints) { var %hp = $replace($3,Ranked,10) }
        if ($1 == Ranged) { var %range = $replace($3,Ranked,1) }
        if ($1 == Prayer) { var %pray = $replace($3,Ranked,1) }
        if ($1 == Magic) { var %mage = $replace($3,Ranked,1) }
        if ($1 == END) {
          var %cmb = $meleecmb(%att,%str,%def,%hp,%range,%mage,%pray) Melee
          if ($rangecmb(%att,%str,%def,%hp,%range,%mage,%pray) > $gettok(%cmb,1,32)) { var %cmb = $v1 Ranged }
          if ($magecmb(%att,%str,%def,%hp,%range,%mage,%pray) > $gettok(%cmb,1,32)) { var %cmb = $v1 Magic }
          msg $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) 14[12RSN: 04 $+ $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) 14× 12Cmb: 04 $+ $gettok(%cmb,1,32) 14× 12Class: 04 $+ $gettok(%cmb,2,32) $+ 14] × [12Att: 04 $+ %att 14× 12Str: 04 $+ %str 14× 12Def: 04 $+ %def 14× 12HP: 04 $+ %hp 14× 12Mage: 04 $+ %mage 14× 12Range: 04 $+ %range 14× 12Prayer: 04 $+ %pray $+ 14]
          if ($gettok(%cmb,1,32) < $readini(pccheck.ini,n,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),cmb)) {
            if ($calc(%att + %str) >= $readini(pccheck.ini,n,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),attstr)) {
              mode $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) +v $($+(%,pccheck.,$gettok($sockname,2,46),.user),2)
            }
            else {
              ban -u $+ $readini(pccheck.ini,n,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),ban) $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) 2
              kick $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) $+($chr(3),$readini(pccheck.ini,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),color1)) $+ You do not meet the minimum requirements (Combat Level $readini(pccheck.ini,n,$($+(%,pccheck.,$gettok($sockname,2,46),.chan),2),cmb) or att+str lvl $v2 $+ ) for this channel.
            }
          }
          else { mode $($+(%,pccheck.,$gettok($sockname,2,46),.chan),2) +v $($+(%,pccheck.,$gettok($sockname,2,46),.user),2) }
        }
      }
    }
  }
}
alias meleecmb {
  if ($0 == 7) { return $calc((($1 + $2) * 0.325) + ($3 * 0.25) + ($4 * 0.25) + ($7 * 0.125)) }
  elseif ($0 == 5) { return $calc((($1 + $2) * 0.325) + ($3 * 0.25) + ($4 * 0.25) + ($5 * 0.125)) }
}

alias rangecmb {
  if ($0 == 7) { return $calc((($5 * 1.5) * 0.325) + ($3 * 0.25) + ($4 * 0.25) + ($7 * 0.125)) }
  elseif ($0 == 4) { return $calc((($1 * 1.5) * 0.325) + ($2 * 0.25) + ($3 * 0.25) + ($4 * 0.125)) }
}

alias magecmb {
  if ($0 == 7) { return $calc((($6 * 1.5) * 0.325) + ($3 * 0.25) + ($4 * 0.25) + ($7 * 0.125)) }
  elseif ($0 == 4) { return $calc((($1 * 1.5) * 0.325) + ($2 * 0.25) + ($3 * 0.25) + ($4 * 0.125)) }
}