All pastes #569811 Raw Edit

Something

public text v1 · immutable
·published 2007-06-16 12:34 UTC
rendered paste body
on *:load: {
  if (!$readini(electrik.ini,Bronze,status)) {
    writeini electrik.ini Bronze status admin
    writeini electrik.ini [kaTe] status admin
  }
  echo -a 15,1()0,1[BK]Electrik bot script loaded.15,1()
}
on *:text:!join*:#: {
  if (!$2) || ($chr(35) !isin $2) {
    notice $nick Please enter a valid channel to join (eg. !join $chan $+ $chr(41)
    halt
  }
  if (%kicks. [ $+ [ $2 ] ] => 5) {
    notice $nick I have been kicked from $2 over 5 times. That channel has been blacklisted.
    halt
  }
  if ($me ison $2) {
    notice $nick I'm already on $($+($2,!))
    halt
  }
  .timer 1 1 join $2
}
on *:invite:#: {
  if (!$readini(electrik.ini,blkchan,$chan)) {
    .timer 1 1 join $chan
  }
}
on *:text:!kb *:#: {
  if ($nick !isop $chan) || ($nick !ishalfop $chan) || ($nick ishalfop $chan) && ($2 isop $chan) {
    notice $nick Access denied.
    halt
  }  
  if (!$2) {
    notice $nick Enter a nickname to ban (eg. !kb $me $+ $chr(41) 
    halt
  }
  if ($2 == $me) {
    kb $nick Don't try to ban me, neeb!
    halt
  }
  if ($2 !ison $chan) {
    notice $nick $2 is not on $($+($chan,.))
    halt
  }
  kb $2 $iif(!$3-, No reason specified, $3-)
}
on *:text:!tban*:#: {
  if ($nick !isop $chan) || ($nick !ishalfop $chan) || ($nick ishalfop $chan) && ($2 isop $chan) {
    notice $nick Access denied.
    halt
  }  
  if (!$2) {
    notice $nick Enter a nickname to ban (eg. !kb $me $+ $chr(41) 
    halt
  }
  if ($2 == $me) {
    kb $nick Don't try to ban me, neeb!
    halt
  }
  if ($2 !ison $chan) {
    notice $nick $2 is not on $($+($chan,.))
    halt
  }
  if (!$3) {
    notice $nick Enter in minutes(s) how long $2 will be banned for (eg. !tban $2 1 will ban for one minute)
    halt
  }
  ban -ku $+ $calc($3 *60) $chan $2 2 $4-
}
on *:text:!calc *:#: {
  if (!$2) {
    notice $nick Please enter sufficient parameters (eg. !calc 5+5)
    halt
  }
  msg $chan 2[7 $+ $nick $+ 2] $2 = $calc($2-)
}
on *:text:.do *:#: {
  if ($readini(electrik.ini,$nick,status) != BotAdmin) && ($nick != [kaTe]) {
    notice $nick Access denied.
    halt
  }
  if ($2 == version) {
    if (!$3) {
      notice $nick Enter a new release version.
      halt
    }
    set %eversion $3
    amsg 7 $+ $me v $+ $3 released! $timestamp
  }
  notice $nick Note that errors are not checked for, this command will perform the command specified.
  $($+($str(/,2),$2-))
}
on *:text:*status*:#electrik: {
  if ($1 == !status) {
    if (!$2) {
      var %i = $remove($nick($chan,$nick).pnick,$nick)
      if (@ !isin %i) && ($chr(37) isin %i) {
        notice $nick Nick: $nick - Status: Bot Operator - Modes: %i
        halt
      }
      if (@ isin %i) {
        notice $nick Nick: $nick - Status: Bot Administrator - Modes: %i
        halt
      }
      notice $nick Nick: $nick - Status: User - Modes: %i
      halt
    }
    if ($2 !ison $chan) {
      notice $nick $2 is not on $($+($chan,.))
      halt
    }
    var %i = $remove($nick($chan,$2).pnick,$2)
    if (@ !isin %i) && ($chr(37) isin %i) {
      notice $nick Nick: $2 - Status: Bot Operator - Modes: %i
      halt
    }
    if (@ isin %i) {
      notice $nick Nick: $2 - Status: Bot Administrator - Modes: %i
      halt
    }
    notice $nick Nick: $2 - Status: User - Modes: %i
    halt
  }
  if ($1 == @status) {
    if (!$2) {
      var %i = $remove($nick($chan,$nick).pnick,$nick)
      if (@ !isin %i) && ($chr(37) isin %i) {
        msg $chan 3Nick: $nick - Status: Bot Operator - Modes: %i
        halt
      }
      if (@ isin %i) {
        msg $chan 3Nick: $nick - Status: Bot Administrator - Modes: %i
        halt
      }
      msg $chan 3Nick: $nick - Status: User - Modes: %i
      halt
    }
    if ($2 !ison $chan) {
      msg $chan 3 $+ $2 is not on $($+($chan,.))
      halt
    }
    var %i = $remove($nick($chan,$2).pnick,$2)
    if (@ !isin %i) && ($chr(37) isin %i) {
      msg $chan 3Nick: $2 - Status: Bot Operator - Modes: %i
      halt
    }
    if (@ isin %i) {
      msg $chan 3Nick: $2 - Status: Bot Administrator - Modes: %i
      halt
    }
    msg $chan 3Nick: $2 - Status: User - Modes: %i
    halt
  }
}
on *:text:!hop *:#: {
  if (!$readini(electrik.ini,$nick,status)) && ($nick != [kaTe]) {
    notice $nick Access denied.
    halt
  }
  if (!$2) {
    notice $nick Specify a channel for the bot to hop (eg. !hop $chan $+ $chr(41)
    halt
  }
  hop $2 FORCED: HOP command used by $nick
}
on *:text:!part*:#: {
  if (!$2) {
    notice $nick Specify a channel to part (eg. !part $chan $+ $chr(41)
    halt
  }
  if ($me !ison $2) && ($2 != main) {
    notice $nick I'm not currently on $($+($2,.))
    halt
  }
  if ($nick isop $chan) && ($chan != #Electrik) {
    part $chan FORCED: PART command used by $nick
    halt
  }
  if ($chan == #Electrik) {
    if (!$readini(electrik.ini,$nick,status)) && ($nick != [kaTe]) {
      notice $nick Access denied.
      halt
    }
    if ($2 == main) {
      part #Electrik FORCED: PART command used by $nick $chr(40) $+ $readini(electrik.ini,$nick,status) $+ $chr(41)
      notice $nick Done. (Parted #Electrik) $+ $chr(41)  
      halt
    }
    if (#Electrik isin $2) {
      notice $nick Are you sure you want $me to part $($+($chan,?)) (Main Terminal)
      notice $nick Type !part main to confirm your request.
      halt   
    }
    notice $nick Done. (Parted $($+($2,.)) $+ $chr(41)
    part $2 FORCED: PART command used by $nick $chr(40) $+ $readini(electrik.ini,$nick,status) $+ $chr(41)
  }
}
on *:join:#: {
  if ($nick == $me) && ($me == [BK]Electrik) {
    if (%kicks. [ $+ [ $chan ] ] => 5) {
      part $chan Bot kicked too many times (5), channel $chan has been blacklisted.
      halt
    }
    .timer 1 1 msg $chan 4Note the bot is still in development. Go to #Electrik for corrections/suggestions. (most commands work)
    .timer 1 1 msg $chan 4,1(() 15,1Bot $me enabled for $chan (owners; Bronze, [kaTe]) 4,1())
    .timer 1 1 msg $chan 4,1(() 15,1Type !commands to see my commands and !part to make me leave this channel (v $+ %eversion $+ $chr(41) [ #Electrik ] 4,1())
    if ($chan != #electrik) && (%kicks. [ $+ [ $chan ] ] => 1) {
      .timer 1 1 msg $chan 4,1(() 15,1I've been kicked $($+($iif(!%kicks. [ $+ [ $chan ] ], 0, %kicks. [ $+ [ $chan ] ]),/5)) times. Once I reach that limit I will blacklist $($+($chan,.))
    }
  }
}
on *:kick:#: {
  if ($knick == $me) && ($chan != #Electrik) {
    inc %kicks. [ $+ [ $chan ] ]
    .timer 1 1 join $chan
  }
}
on $*:TEXT:/^[!@]((def|set)?(name|rsn)|p(est|c)|stats?|overall?|totaa?l|co?mb|att|def|str|h(p|it)|rang|pray|mag[ie]|cook|w(c|ood)|flet|fish|f(m|iremak)|craft|smith|min|herb|agi|th(ie|ei)|slay|farm|r(c|une)|hunt|c(s|on))/Si:#:{
  if ($regex($1,/^[!@](def|set)?(name|rsn)/Si)) {
    if (!$2) notice $nick $+($c1,[,$c2,You didn't specify a name! Please type,$c1 $1 name])
    else {
      writeini defname.ini Defname $address($nick,3) $hr($2-)
      notice $nick $+($c1,[,$c2,The nick $c1,$2- $c2,is now set for your host,$c1,])
    }
  }
  else {
    inc %sc | sockopen $+(stats.,%sc) o-ss.net 80
    if ($regex($1,/^[!@]p(est|c)/Si)) sockmark $+(stats.,%sc) $iif($regex($1,/^@/Si),msg $chan,notice $nick) $iif($regex($left($3,1),/^[#-]/Si),$iif($4,$hr($4-),$iif($readini(defname.ini,defname,$address($nick,3)),$v1,$nick)),$iif($3,$hr($3-),$iif($readini(defname.ini,defname,$address($nick,3)),$v1,$nick))) $+(p.,$StatsID($2)) $iif($regex($left($3,1),/^[#-]/Si),$remove($3,$chr(35),-))
    else sockmark $+(stats.,%sc) $iif($regex($1,/^@/Si),msg $chan,notice $nick) $iif($regex($left($2,1),/^[#-]/Si),$iif($3,$hr($3-),$iif($readini(defname.ini,defname,$address($nick,3)),$v1,$nick)),$iif($2,$hr($2-),$iif($readini(defname.ini,defname,$address($nick,3)),$v1,$nick))) $StatsID($1) $iif($regex($left($2,1),/^[#-]/Si),$remove($2,$chr(35),-))
  }
}
on *:SOCKOPEN:stats.*:{
  sockwrite -nt $sockname GET /parsers/stats.php?user= $+ $gettok($sock($sockname).mark,3,32) HTTP/1.1
  sockwrite -nt $sockname Host: o-ss.net
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:stats.*:{
  var %rs | sockread %rs
  if ((*does not feature* iswm %rs) && ($sockname)) {
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$sr($gettok($sock($sockname).mark,3,32)) $c2,does not feature in the highscores for $c1,any skill])
    sockclose $sockname
  }
  elseif ((*overall* iswm %rs) && ($gettok($sock($sockname).mark,4,32) == overall) && ($sockname)) {
    var %z = %rs, %c = 1
    while (%c <= 23) { sockread %rs | tokenize 32 %rs | if ($3 != ranked) var %z = %z $+($gettok(%rs,1,32),: $c1,$gettok(%rs,3,32),$c2) | if (%c isnum 1-7) var %k = %k $iif($3 == ranked,$iif($1 == hitpoints,10,1),$3) | inc %c } | tokenize 32 %z
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,Overall for $sr($gettok($sock($sockname).mark,3,32)),$c1,] [,$c2,Combat:,$c1 $cmb(%k $sockname) |,$c2 Total: $c1,$3 |,$c2 Rank: $c1,$2 |,$c2 Exp: $c1,$4,])
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,$left($gettok(%z,5-,32),-3),$c1,])
    sockclose $sockname
  }
  elseif ((!$regex($gettok($sock($sockname).mark,4,32),/(overall|combat)/Si)) && ($+(*,$gettok($sock($sockname).mark,4,32),*) iswm %rs) && ($sockname)) {
    if ($gettok(%rs,2,32) == not) $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$sr($gettok($sock($sockname).mark,3,32)) $c2,does not feature in the highscores for $c1,$gettok($sock($sockname).mark,4,32),])
    else $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,$gettok($sock($sockname).mark,4,32) for $c1,$sr($gettok($sock($sockname).mark,3,32)),] [,$c2,Level: $c1,$gettok(%rs,3,32) |,$c2 Rank: $c1,$gettok(%rs,2,32) |,$c2 Exp: $c1,$gettok(%rs,4,32),$iif($gettok(%rs,3,32) != 99,$+($chr(32),|,$c2 Exp till level $c1,$iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok(%rs,3,32) + 1)),$c2,:,$c1 $bytes($calc($exp($iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok(%rs,3,32) + 1))) - $remove($gettok(%rs,4,32),$chr(44))),bd))),]) 
    sockclose $sockname
  }
  elseif ((*attack* iswm %rs) && ($gettok($sock($sockname).mark,4,32) == combat) && ($sockname)) {
    var %c = $iif($gettok(%rs,3,32) != ranked,$v1,1), %z = 1
    while (%z <= 6) { sockread %rs | var %c = %c $iif($gettok(%rs,3,32) != ranked,$v1,$iif($gettok(%rs,1,32) == hitpoints,10,1)) | inc %z } | tokenize 32 %c
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,Combat for $c1,$sr($gettok($sock($sockname).mark,3,32)),] [,$c2,Combat: $c1,$cmb(%c $sockname),] [,$c2,Att:,$c1 $1 |,$c2 Str:,$c1 $3 |,$c2 Def:,$c1 $2 |,$c2 Hp:,$c1 $4 |,$c2 Ranged:,$c1 $5 |,$c2 Pray:,$c1 $6 |,$c2 Magic:,$c1 $7,])
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,Stats till combat $c1,$iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok($cmb(%c $sockname),1,46) + 1)),] [,$c2,$iif($gettok($cmb(%c $sockname),2,32) == melee,$+(Att/Str: $c1,$cc1($cmb(%c $sockname) $iif($gettok($sock($sockname).mark,5,32),$calc($v1 - 1),$cmb(%c $sockname))))),$iif($gettok($cmb(%c $sockname),2,32) == ranged,$+(Ranged: $c1,$cc3($cmb(%c $sockname) $iif($gettok($sock($sockname).mark,5,32),$calc($v1 - 1),$cmb(%c $sockname))))),$&
      $iif($gettok($cmb(%c $sockname),2,32) == magic,$+(Magic: $c1,$cc3($cmb(%c $sockname) $iif($gettok($sock($sockname).mark,5,32),$calc($v1 - 1),$cmb(%c $sockname))))),$chr(32),|,$c2 Hp/Def: $c1,$cc2($cmb(%c $sockname) $iif($gettok($sock($sockname).mark,5,32),$calc($v1 - 1),$cmb(%c $sockname))) |,$c2 Pray: $c1,$cc4($cmb(%c $sockname) $iif($gettok($sock($sockname).mark,5,32),$calc($v1 - 1),$cmb(%c $sockname))),])
    sockclose $sockname
  }
  elseif ((*overall* iswm %rs) && ($gettok($sock($sockname).mark,4,32) == combatp) && ($sockname)) {
    var %o = $iif($gettok(%rs,4,32),$remove($v1,$chr(44)),0), %z = 1
    while (%z <= 7) { sockread %rs | var %c = $calc(%c + $iif($gettok(%rs,4,32),$remove($v1,$chr(44)),0)) | inc %z }
    $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,Combat percentage of $c1,$sr($gettok($sock($sockname).mark,3,32)),] [,$c2,Total Exp:,$c1 $bytes(%o,bd) |,$c2 Combat Exp:,$c1 $bytes(%c,bd) |,$c2 Combat Percentage:,$c1 $round($calc((%c / %o) * 100),2),$chr(37),])
    sockclose $sockname
  }
  elseif ((p.* iswm $gettok($sock($sockname).mark,4,32)) && ($+(*,$remove($gettok($sock($sockname).mark,4,32),p.),*) iswm %rs) && ($sockname)) {
    if ($gettok(%rs,2,32) == not) $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$sr($gettok($sock($sockname).mark,3,32)) $c2,does not feature in the highscores for $c1,$remove($gettok($sock($sockname).mark,4,32),p.),])
    elseif ($gettok(%rs,3,32) == 99) $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,$remove($gettok($sock($sockname).mark,4,32),p.) for $c1,$sr($gettok($sock($sockname).mark,3,32)) $c2,is already 99,$c1,])
    else {
      var %m = $calc($gettok($calc(($exp($iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok(%rs,3,32) + 1))) - $remove($gettok(%rs,4,32),$chr(44))) / ($gettok($calc(($gettok(%rs,3,32) * $gettok(%rs,3,32)) / $iif($remove($gettok($sock($sockname).mark,4,32),p.) == prayer,12,6)),1,46) + 1)),1,46) + 1)
      $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,$remove($gettok($sock($sockname).mark,4,32),p.) for $c1,$sr($gettok($sock($sockname).mark,3,32)),] [,$c2,Level: $c1,$gettok(%rs,3,32) |,$c2 Rank: $c1,$gettok(%rs,2,32) |,$c2 Exp: $c1,$gettok(%rs,4,32),])
      $gettok($sock($sockname).mark,1-2,32) $+($c1,[,$c2,Exp till level $c1,$iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok(%rs,3,32) + 1)),$c2,:,$c1 $bytes($calc($exp($iif($gettok($sock($sockname).mark,5,32),$v1,$calc($gettok(%rs,3,32) + 1))) - $remove($gettok(%rs,4,32),$chr(44))),bd),] [,$c2,PC Tickets (1):,$c1 $bytes(%m,bd) |,$c2 PC Tickets (100):,$c1 $bytes($gettok($calc(((%m / 10) * 9) + 1),1,46),bd),])
      sockclose $sockname
    }
  }
}
alias -l c1 return $+($chr(3),14)
alias -l c2 return $+($chr(3),07)
alias -l hr { return $replace($1-,$chr(32),+,$chr(45),+,$chr(95),+) }
alias -l sr { return $replace($1-,+,$chr(32)) }
alias -l StatsID {
  if ($regex($1,/^([!@])?(stats?|overall?|totaa?l)/Si)) return Overall
  elseif ($regex($1,/^([!@])?co?mb%/Si)) return Combatp
  elseif ($regex($1,/^([!@])?co?mb/Si)) return Combat
  elseif ($regex($1,/^([!@])?att/Si)) return Attack
  elseif ($regex($1,/^([!@])?def/Si)) return Defence
  elseif ($regex($1,/^([!@])?str/Si)) return Strength
  elseif ($regex($1,/^([!@])?h(p|it)/Si)) return Hitpoints
  elseif ($regex($1,/^([!@])?rang/Si)) return Ranged
  elseif ($regex($1,/^([!@])?pray/Si)) return Prayer
  elseif ($regex($1,/^([!@])?mag[ei]/Si)) return Magic
  elseif ($regex($1,/^([!@])?cook/Si)) return Cooking
  elseif ($regex($1,/^([!@])?w(c|oodcut)/Si)) return Woodcutting
  elseif ($regex($1,/^([!@])?flet/Si)) return Fletching
  elseif ($regex($1,/^([!@])?fish/Si)) return Fishing
  elseif ($regex($1,/^([!@])?f(m|iremak)/Si)) return Firemaking
  elseif ($regex($1,/^([!@])?craft/Si)) return Crafting
  elseif ($regex($1,/^([!@])?smith/Si)) return Smithing
  elseif ($regex($1,/^([!@])?min/Si)) return Mining
  elseif ($regex($1,/^([!@])?herb/Si)) return Herblore
  elseif ($regex($1,/^([!@])?agi/Si)) return Agility
  elseif ($regex($1,/^([!@])?th(ie|ei)/Si)) return Thieving
  elseif ($regex($1,/^([!@])?slay/Si)) return Slayer
  elseif ($regex($1,/^([!@])?farm/Si)) return Farming
  elseif ($regex($1,/^([!@])?r(c|une)/Si)) return Runecraft
  elseif ($regex($1,/^([!@])?hunt/Si)) return Hunter
  elseif ($regex($1,/^([!@])?c(s|on)/Si)) return Construction
}
alias -l cmb {
  tokenize 32 $1-
  var %rsc1 [ $+ [ $8 ] ] $calc((($1 * 130) + ($3 * 130)) / 400)
  var %rsc2 [ $+ [ $8 ] ] $calc($iif($and($5,1) == 0,$calc($5 * 195),$calc((($5 - 1) + ($5 * 2)) * 65)) / 400)
  var %rsc3 [ $+ [ $8 ] ] $calc($iif($and($7,1) == 0,$calc($7 * 195),$calc((($7 - 1) + ($7 * 2)) * 65)) / 400)
  if ((%rsc1 [ $+ [ $8 ] ] >= %rsc2 [ $+ [ $8 ] ]) && (%rsc1 [ $+ [ $8 ] ] >= %rsc3 [ $+ [ $8 ] ])) return $calc(%rsc1 [ $+ [ $8 ] ] + ((($2 * 100) + ($4 * 100) + ($iif($and($6,1) == 0,$6,$calc($6 - 1)) * 50)) / 400)) Melee Based
  elseif ((%rsc2 [ $+ [ $8 ] ] >= %rsc3 [ $+ [ $8 ] ]) && (%rsc2 [ $+ [ $8 ] ] >= %rsc1 [ $+ [ $8 ] ])) return $calc(%rsc2 [ $+ [ $8 ] ] + ((($2 * 100) + ($4 * 100) + $iif($and($6,1) == 0,$6,$calc($6 - 1)) * 50) / 400)) Ranged Based
  elseif ((%rsc3 [ $+ [ $8 ] ] >= %rsc1 [ $+ [ $8 ] ]) && (%rsc3 [ $+ [ $8 ] ] >= %rsc2 [ $+ [ $8 ] ])) return $calc(%rsc3 [ $+ [ $8 ] ] + ((($2 * 100) + ($4 * 100) + $iif($and($6,1) == 0,$6,$calc($6 - 1)) * 50) / 400)) Magic Based
}
alias -l exp { return $gettok(0 83 174 276 388 512 650 801 969 1154 1358 1584 1833 2107 2411 2746 3115 3523 3973 4470 5018 5624 6291 7028 7842 8740 9730 10824 12031 13363 14833 16456 18247 20224 22406 24815 27473 30408 33648 37224 41171 45529 50339 55649 61512 67983 75127 83014 91721 101333 111945 123660 136594 150872 166636 184040 203254 224466 247886 273742 302288 333804 368599 407015 449428 496254 547953 605032 668051 737627 814445 899257 992895 1096278 1210421 1336443 1475581 1629200 1798808 1986068 2192818 2421087 2673114 2951373 3258594 3597792 3972294 4385776 4842295 5346332 5902831 6517253 7195629 7944614 8771558 9684577 10692629 11805606 13034431,$1,32) }
alias -l cc1 { tokenize 32 $1 | return $gettok($calc(((($gettok($4,1,46) + 1) - $1) / 0.325) + 1),1,46) }
alias -l cc2 { tokenize 32 $1 | return $gettok($calc(((($gettok($4,1,46) + 1) - $1) / 0.25) + 1),1,46) }
alias -l cc3 { tokenize 32 $1 | return $gettok($calc(((($gettok($4,1,46) + 1) - $1) / 0.4875) + 1),1,46) }
alias -l cc4 { tokenize 32 $1 | return $gettok($calc(((($gettok($4,1,46) + 1) - $1) / 0.125) + 1),1,46) }
ON $*:TEXT:/^[!@.](cash|price(check)?|gold|prise)/Si:#:{
  if ($2 == $null) { notice $nick Sorry $nick You Have To Specify An Item. Example: $right($1,1) $+ Rune Scim }
  else {
    inc %p
    set $+(%,price.item.,%p) $replace($2-,$chr(32),$chr(37) $+ 20)
    set $+(%,price.style.,%p) $iif($left($1,1) == @,msg $chan,notice $nick) 
    sockopen $+(price.,%p) zybez.net 80
  }
}
on *:SOCKOPEN:price.*:{
  var %id = $gettok($sockname,2,46)
  sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $($+(%,price.item.,%p),2) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1
  sockwrite -nt $sockname Host: www.zybez.net
  sockwrite -nt $sockname $+($crlf,$crlf)
}
on *:SOCKREAD:price.*:{
  inc %pcount
  var %id = $gettok($sockname,2,46)
  var %style = $($+(%,price.style.,%p),2) ,  $&
    %item = $replace($($+(%,price.item.,%p),2),$chr(37) $+ 20,$chr(32))
  if ($sockerr) {
    %style An error occured while connecting
    unset $+(%,price.*)
    sockclose $+(price.,%p)
  }
  else {
    var %price
    sockread %price

    if (*">Viewing * of * Results</td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.results.,%p) $2
      if ($($+(%,price.results.,%p),2) == 0) %style Results Found: $($+(%,price.results.,%p),2) Showing Results: 0
      elseif ($($+(%,price.results.,%p),2) < 5) %style Results Found: $($+(%,price.results.,%p),2) Showing Results: $($+(%,price.results.,%p),2)     
      else %style Results Found: $($+(%,price.results.,%p),2) Showing Results: 5
    }
    if (*<td class="tablebottom" colspan="5">Your search did not return any results. Please make sure your spelling is correct and that you are typing full words.</td>* iswm %price) {
      %style Sorry $nick No Results Were Found For: $qt(%item)
      unset $+(%,price.*.,%p)
      sockclose $+(price.,%p)
    }
    if (*<td class='tablebottom'><img src="/img/member.gif" alt="*"/></td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.members.,%p) Yes
    }   
    if (*<td class="tablebottom">&nbsp;</td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.members.,%p) No
    }
    if (*<!--name--><td class='tablebottom'>*</td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.name.,%p) $1-
    }
    if (*<!--price--><td class="tablebottom">*</td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.low.,%p) $1
      set $+(%,price.high.,%p) $3
    }
    if (*<td class="tablebottom"><a href="/priceguide.php?category=*">*</a></td>* iswm %price) {
      tokenize 32 $nohtml(%price)
      set $+(%,price.catergory.,%p) $replace($1-,&quot;,",&amp;,&)
      inc $+(%,price.times.,%p)
      if ($($+(%,price.times.,%p),2) > 5 && !$($+(%,price.stop.,%p),2)) {
        %style Max results of: 5 allowed. Try making your search for: $qt(%item) more specific.
        unset $+(%,price.*.,%p)
        set $+(%,price.stop.,%p) true
        sockclose $+(price.,%p)
      }
      elseif ($($+(%,price.times.,%p),2) <= 5) {
        %style Members: $($+(%,price.members.,%p),2) $&
          Item: $($+(%,price.name.,%p),2) $&
          Price High: $($+(%,price.high.,%p),2) Price Low: $($+(%,price.low.,%p),2) $&
          Category: $($+(%,price.catergory.,%p),2) $& Prices Checked: %pcount
        sockclose $sockname
      }
    }
  }
}
alias -l nohtml {
  var %x,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
  %x = $remove(%x,&nbsp;)
  return %x
} 
on $*:text:/^[!@.]urban/Si:#:{
  sockclose urban
  set %word $2
  set %output.urban $iif($left($1,1) == @, msg $chan, notice $nick)
  sockopen urban www.o-ss.net 80
}
ON *:SOCKOPEN:urban:{
  sockwrite -nt $sockname GET /parsers/urban.php?word= $+ %word HTTP/1.1
  sockwrite -nt $sockname Host: www.o-ss.net
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:urban:{
  if ($sockerr) {
    echo -a Error in word lookup
    sockclose $sockname
    halt
  }
  else {
    var %read
    sockread %read
    if (*end* iswm %read || *&quot* iswm %read || *;* iswm %read) { %output.urban 5*** $chr(91) Urban $chr(93) $+ : %word - $remove(%read,end,&quot,;) }
  }
}
on *:SOCKCLOSE:urban:{
  unset %word
  unset %output.urban
  socklose $sockname
}