All pastes #556369 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-10 15:23 UTC
rendered paste body
exp { 
  var %x = 1
  %level = $calc($1 - 1)
  %xp = 0 
  while (%x <= %level) { 
    var %TempXp = $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4) 
    inc %xp %TempXp 
    inc %x 
  } 
  if ($1 > 127) { return $1 } 
  else { return $int(%xp) } 
} 

on *:TEXT:!level *:#:{ 
  if ((%level.timer != $null) && ($network == SwiftIRC)) { 
    notice $nick Try Again In A Minute. 
    halt 
  } 
  if ((%level.timer == $null) && ($network == SwiftIRC)) { 
    set %level.timer hai 
    timer60 1 15 unset %level.timer 
  } 
  set %level.chan $chan 
  set %current $docalc($2) 
  set %next $calc($2 + 1) 
  set %nextexp $exp(%next) 
  set %diff $calc(%nextexp - %current) 
  msg $chan Way To Go d00d on getting $2 $3 $+ . About $bytes(%diff,b) $+ xp Until Level %next $3 
  unset %current 
  unset %next 
  unset %nextexp 
  unset %diff 
} 
alias chanscript { 
  set %topic $strip($chan(#).topic,c) 
  set %topic $replace(%topic,',<b>',C,<b>C,,</b>,,<u>) 
  set %users $nick(#,0) 
  write -c site.txt Current Info about our irc channel $1 on $network 
  write site.txt Last Updated: $asctime(mm/dd/yyyy) at $asctime(hh:nntt) EST 
  write site.txt Current Topic: %topic 
  write site.txt Total Users: %users 
  set %a 1 
  set %users $calc(%users + 1) 
  while (%a < %users) { 
    write site.txt $nick(#,%a).pnick $+ $crlf 
    inc %a 1 
  } 
} 
on *:TEXT:!pk*:#:{ 
 if ($len($2-) >= 12) { msg $chan  $+ $rand(1,15) $+ ,00Choose a username shorter then 12 characters!  | halt } 
 if ($len($2-) <= 12) { msg $chan  $+ $rand(1,15) $+ ,00Well Bite Me, Chew Me, Spit Me Out, Pick Me Up And Bite Me Again, You Pk'd a ch00b named $2- $+ ...Dont You Just Feel So Fucking Special Now $nick $+ ? } 
}
on *:TEXT:!bs*:#:{
    set %bspercent $rand(0,100) | if (%bspercent <= 30) { msg $chan I have Determined That The Statement $2- contains %bspercent $+ $chr(55) Bullshit (very little Bullshit) } 
    elseif (%bspercent > 30 <= 59) { msg $chan I have Determined That The Statement $2- Contains %bspercent $+ $chr(55) Bullshit (Moderate Percentage of Bullshit) } 
    elseif (%bspercent > 60 <= 89) { msg $chan I have Determined That The Statement $2- Contains %bspercent $+ $chr(55) Bullshit (Large Content of Bullshit) } 
    elseif (%bspercent > 90 <= 99) { msg $chan I have Determined That The Statement $2- Contains %bspercent $+ $chr(55) Bullshit (Almost Full of Bullshit) } 
    elseif (%bspercent == 100) { msg $chan I Have Determined That The Statement $2- Contains %bspercent $+ $chr(55) Bullshit (Full of Bullshit!!!) } 
  } 


on *:TEXT:!leet*:#:{ msg $chan $replacecs($2-,a,4,A,4,e,3,E,3,L,|,l,|,I,1,i,1,f,ph,F,ph,s,5,S,5,you,j00,YOU,j00,o,0,O,0,t,7) } 
on *:TEXT:!1337*:#:{ msg $chan $replacecs($2-,4,a,4,A,3,e,3,E,|,L,|,l,1,i,1,I,ph,f,ph,F,5,s,5,S,j00,you,j00,YOU,0,o,0,O,7,t) } 

on $*:TEXT:/^(brb|bbs|bbl|afk|bbiab)/Si:#:{  
  set %brb. [ $+ [ $address [ $+ [ . [ $+ [ $chan ] ] ] ] ] ] True
  set %awaytime. [ $+ [ $address [ $+ [ . [ $+ [ $chan ] ] ] ] ] ] $ctime
  set %awayreason. [ $+ [ $address [ $+ [ . [ $+ [ $chan ] ] ] ] ] ]$1-
}
 
on 1:TEXT:*:*:{
  if (%brb. [ $+ [ $address ] $+ ] . [ $+ [ $chan ] ] == True) { 
    msg $chan 4 $+ $nick 2Is back from:1 %awayreason. [ $+ [ $address ] $+ ] . [ $+ [ $chan ] ] 2(Time Away: $duration($calc($ctime - %awaytime. [ $+ [ $address ] $+ ] . [ $+ [ $chan ] ] )) $+ ) 
    unset %brb. $+ $address $+ . $+ $chan
    unset %awaytime. $+ $address $+ . $+ $chan
    unset %awayreason. $+ $address $+ . $+ $chan
}
}
on *:TEXT:!change *:#:{ 
  if ($nick isvoice #) notice $nick You cannot change the world! 
  if ($nick isreg #) notice $nick You cannot change the world! 
  if ($nick ishop #) notice $nick You cannot change the world! 
  if ($nick isop #) set %pctime $ctime 
  if ($nick isop #) set %pcnick $nick 
  if ($nick isop #) set %pcworld $2- 
  if ($nick isop #) amsg |'|'|'|'|'|PC World is changed to %pcworld by %pcnick |'|'|'|'|'| 
} 

on *:TEXT:/^[!@](world)/Si:#:{
set %display $iif($left($1,1) == @,msg $chan,notice $nick) 
  %display Current PC World: %pcworld --Last Update: $+($duration($calc($ctime - %pctime)),) ago 
  %display This world was set by: %pcnick 
} 
on $*:TEXT:/^[!@]clan */Si:#:{
  if ($sock(clan)) halt
  set %clan.out $iif($left($1,1) == @,msg $chan,notice $nick)
  set %clan.user $replace($2-,$chr(32),$chr(43))
  sockopen clan parsers.o-ss.net 80
}
ON *:SOCKOPEN:clan:{ 
  sockwrite -nt $sockname GET /oneline/clans.php?user= $+ %clan.user HTTP/1.1 
  sockwrite -nt $sockname Host: parsers.o-ss.net $+ $+($crlf,$crlf) 
} 
on *:SOCKREAD:clan:{ 
  if ($sockerr) { 
    echo -a Error in clan lookup 
    sockclose $sockname 
    halt 
  } 
  else { 
    var %clan.read 
    sockread %clan.read 
    if (*end* iswm %clan.read ) { 
      %clan.out %clan.user Is In Clans: - $remove(%clan.read,end) 
      sockclose $sockname 
      unset %clan.user 
      unset %clan.out 
    } 
  } 
} 
on $*:TEXT:/^['?]price */Si:#: { 
  inc %zybez.use 
  if (%zybez.use >= 3) { 
    $iif($left($1,1) == ?,msg $chan,notice $nick) Price Guide made possibly by Zybez's Price Guide: http://zybez.com 
    .unset %zybez.use 
  } 
  var %rstr = $+($r(0,9),$r(0,9),$r(0,9),$r(0,9),$r(0,9)) 
  .set %price. $+ $(%rstr,2) $+ .rn $numtok($2-,44) 
  .set %price. $+ $(%rstr,2) $+ .rc 1 
  .set %price. $+ $(%rstr,2) $+ .rvmi 0 
  .set %price. $+ $(%rstr,2) $+ .rvma 0 
  .set %price. $+ $(%rstr,2) $+ .nick $nick 
  .set %price. $+ $(%rstr,2) $+ .type $iif($2 == -e,strict,$iif(-s* iswm $2,spend $dcon($remove($2,-s)),free)) 
  .set %price. $+ $(%rstr,2) $+ .item $iif($2 == -e || -s* iswm $2,$3-,$2-) 
  .set %price. $+ $(%rstr,2) $+ .ret $iif($left($1,1) == ?,msg $chan,notice $nick) 
  .sockopen price. $+ $(%rstr,2) zybez.com 80 
} 
alias mcol { return $+($chr(3),02,$1,$chr(3),) } 
alias pcol { return $+($chr(3),07,$1,$chr(3),) } 
alias icol { return $+($chr(3),04,$1,$chr(3),) } 
alias dcon { 
  if (*.* !iswm $1) { 
    return $replace($1-,K,000,M,000000,B,000000000) 
  } 
  if (*.* iswm $1) && (($right($1,1) == K) || ($right($1,1) == M) || ($right($1,1) == B)) { 
    var %rdat = $1, %nums = $len($gettok($remove($1,K,M),2,46)) 
    %rdat = $calc($remove($1,.,K,M,B) * $iif($right($1,1) == K,$+(1,$str(0,$calc(3 - %nums))),$iif($right($1,1) == M,$+(1,$str(0,$calc(6 - %nums))),$+(1,$str(0,$calc(9 - %nums)))))) 
    return %rdat 
  } 
  else { 
    return $1 
  } 
} 
on *:SOCKOPEN:price.*: { 
  if ($sockerr) { 
    $($+(%,price.,$right($sockname,5),.ret),2) SockOpen Error: $sock($sockname).wsmsg 
    return 
  } 
  var %rid = $right($sockname,5) 
  .unset $($+(%,price.calc.,%rid),1) 
  tokenize 32 $gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44) 
  if ($remove($1,k,m,.) !isnum) { var %price.tmp.sendname = $replace($1-,$chr(32),+) } 
  else { var %price.tmp.sendname = $replace($remove($2-,$1),$chr(32),+) | .set %price.calc. $+ %rid $dcon($1) } 
  ;if ($right(%price.tmp.sendname,1) == s) { %price.tmp.sendname = $left(%price.tmp.sendname,-1) } 
  .sockwrite -n $sockname GET /priceguide.php?search_terms= $+ %price.tmp.sendname $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1 
  .sockwrite -n $sockname Host: zybez.com $+ $crlf $+ $crlf 
} 
on *:SOCKREAD:price.*: { 
  if ($sockerr) { 
    $($+(%,price.,$right($sockname,5),.ret),2) SockRead Error: $sock($sockname).wsmsg 
    return 
  } 
  var %rid = $right($sockname,5) 
  tokenize 32 $gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44) 
  if ($remove($1,k,m,.) !isnum) { var %price.tmp.sendname = $replace($1-,$chr(32),+) } 
  else { var %price.tmp.sendname = $replace($2-,$chr(32),+) | .set %price.calc. $+ %rid $dcon($1) } 
  .sockread %sr 
  if (*<!-- * iswm %sr || * -->* iswm %sr) && (*<!-- Search Results: End -->* !iswm %sr) && (*<!-- Search Results: Start -->* !iswm %sr) { halt } 
  if (*<!-- Search Results: End -->* iswm %sr) { .unset %price.read. $+ %rid } 
  if ($($+(%,price.read.,%rid),2) != $null) && (%sr != $null) { 
    if (*search did not return any* iswm %sr) { 
      .set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $pcol(No price found for) $icol($gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44))) 
      if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) { 
        .next_price %rid 
        halt 
      } 
    } 
    else { 
      if ($($+(%,price.read.,%rid),2) == 4) { 
        if ($+(*,$($+(%,price.tmp.name.,%rid),2),*) !iswm $($+(%,price.,%rid,.rs),2)) { 
          if ($gettok($($+(%,price.,%rid,.type),2),1,32) == spend) { 
            .set %price.calc. $+ %rid $floor($calc($gettok($($+(%,price.,%rid,.type),2),2,32) / $gettok($remove($($+(%,price.tmp.price.,%rid),2),gp,$chr(44)),2,45))) 
            if ($($+(%,price.calc.,%rid),2) == 0) { .unset $($+(%,price.calc.,%rid),1) } 
          } 
          .set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $+($iif($($+(%,price.calc.,%rid),2) != $null,$+($icol($bytes($ifmatch,b)),$chr(32)),),$mcol($($+(%,price.tmp.type.,%rid),2)),$icol($($+(%,price.tmp.name.,%rid),2)),$chr(32)) $& 
            $+ $iif($($+(%,price.calc.,%rid),2) != $null, $pcol($+($bytes($calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44)) * $ifmatch),b),gp)) - $pcol($+($bytes($calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44)) * $ifmatch),b),gp)) $+($chr(40),$pcol($($+(%,price.tmp.price.,%rid),2)),$chr(41)), $pcol($($+(%,price.tmp.price.,%rid),2))) 

          .inc $($+(%,price.,%rid,.rvmi),1) $iif($($+(%,price.calc.,%rid),2) != $null,$calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44)) * $ifmatch),$remove($gettok($($+(%,price.tmp.price.,%rid),2),1,45),gp,$chr(44))) 
          .inc $($+(%,price.,%rid,.rvma),1) $iif($($+(%,price.calc.,%rid),2) != $null,$calc($remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44)) * $ifmatch),$remove($gettok($($+(%,price.tmp.price.,%rid),2),2,45),gp,$chr(44))) 
        } 
        if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) { 
          .next_price %rid 
          halt 
        } 
      } 
      if ($($+(%,price.read.,%rid),2) == 3) { .set %price.tmp.price. $+ %rid $nohtml(%sr) | inc $($+(%,price.read.,%rid),1) 1 } 
      if ($($+(%,price.read.,%rid),2) == 2) { 
        if ($($+(%,price.,%rid,.type),2) == strict) && ($replace($nohtml(%sr),$chr(32),+) != %price.tmp.sendname) { 
          .set $($+(%,price.read.,%rid),1) -5 
        } 
        else { 
          .set %price.tmp.name. $+ %rid $nohtml(%sr) 
          inc $($+(%,price.read.,%rid),1) 1 
        } 
      } 
      if ($($+(%,price.read.,%rid),2) == 1) { .set %price.tmp.type. $+ %rid $iif(*&nbsp;* iswm %sr,,(M)) | .inc $($+(%,price.read.,%rid),1) 1 } 
      if ($($+(%,price.read.,%rid),2) <= 0) { .inc $($+(%,price.read.,%rid),1) 1 } 
    } 
  } 
  if (*<!-- Search Results: Start -->* iswm %sr) { .set %price.read. $+ %rid 0 } 
} 
on *:SOCKCLOSE:price.*: { 
  var %rid = $right($sockname,5) 
  if ($($+(%,price.,%rid,.rc),2) < $($+(%,price.,%rid,.rn),2)) { 
    .next_price %rid 
    halt 
  } 
  if ($numtok($right($($+(%,price.,%rid,.rs),2),-1),44) < $($+(%,price.,%rid,.rc),2)) { 
    .set %price. $+ %rid $+ .rs $($+(%,price.,%rid,.rs),2) $+ , $pcol(No price found for) $icol($+($chr(2),$gettok($($+(%,price.,%rid,.item),2),$($+(%,price.,%rid,.rc),2),44),$chr(2))) 
  } 
  $($+(%,price.,%rid,.ret),2) $right($($+(%,price.,%rid,.rs),2),-2) 
  if ($($+(%,price.,%rid,.rn),2) > 1) { $($+(%,price.,%rid,.ret),2) $pcol(Total Value: $+($bytes($($+(%,price.,%rid,.rvmi),2),b),gp) - $+($bytes($($+(%,price.,%rid,.rvma),2),b),gp)) } 
  .unset $($+(%,price.*,%rid,*),1) 
} 
alias -l next_price { 
  .unset $($+(%,price.read.,$1),1) 
  var %sn = price. $+ $1 
  .sockclose %sn 
  .inc $($+(%,price.,$1,.rc),1) 1 
  .sockopen %sn zybez.com 80 
} 
alias nohtml { 
  var %x,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x) 
  return %x 
}