All pastes #623843 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-07-17 21:37 UTC
rendered paste body
on $*:NOTICE:/^[!@]set(pcw|world)*/Si:?:{
  set %Worldinfo. [ $+ [ $2 ] ] $nick $date $3
  msg $2 A new world has been set! Type !world or !pcw to see it!}
  on $*:TEXT:/^[!@]pcw/Si:#:{
    .notice $nick The pc world for $chan is: $gettok(%Worldinfo. [ $+ [ $chan ] ],3,32) set by: $gettok(%Worldinfo. [ $+ [ $chan ] ],1,32) on: $gettok(%Worldinfo. [ $+ [ $chan ] ],2,32)

    if ($eval($+(%,Zezima,$nick),2) == $null) { 
      notice $nick DOT MENTION ZEZIMA HERE, SAY IT ONCE MORE AND U WILL BE MUTED KAY? 
      set $+(%,Zezima,$nick) 1 
    } 
    if ($eval($+(%,Zezima,$nick),2) == 1) { 
      inc $+(%,Zezima,$nick) 
      mode $chan +b ~q: $+ $address($nick,2) 
      .timer 1 300 mode $chan -b ~q: $+ $address($nick,2) 
      notice $nick Stop saying "Zezima". Muted for 5 minutes. One more time, and you will be kb'd. 
    } 
    elseif ($eval($+(%,Zezima,$nick),2) == 2) { 
      mode $chan +b $address($nick,2) 
      kick $chan $nick We warned you. Banned. 
    } 

  }
  on *:TEXT:!pkw*:#:{ 
    if %Peoplekilling { 
      notice $nick The pkw is ~~ %Peoplekilling ~~ and the suggested pkw is ~~ %spkw ~~ 
    } 
  } 
  on *:TEXT:!pk-suggest*:#:{ 
    set %spkw $2- { 
      describe $chan $nick has suggested a pk world, please type !pkw to see it! 
    } 
  } 
  on *:TEXT:!delpkw:#:{ 
    if (($nick isop $chan) || ($nick ishop $chan)) { 
      unset %peoplekilling 
      unset %spkw 
      Notice $chan $nick has deleted the pkw. 
    } 
  }
  on *:TEXT:!op*:#: { 
    if ($nick isop $chan) { 
      set %nick4 $2- 
      /mode $chan +o %nick4 
    } 
  } 
  on *:TEXT:!deop*:#: { 
    if ($nick isop $chan) { 
      set %nick5 $2- 
      /mode $chan -o %nick5 
    } 
  } 
  on *:TEXT:!hop*:#: { 
    if ($nick isop $chan) { 
      set %nick6 $2- 
      /mode $chan +h %nick6 
    } 
  } 
  on *:TEXT:!dehop*:#: { 
    if ($nick isop $chan) { 
      set %nick7 $2- 
      /mode $chan -h %nick7 
    } 
  } 
  on *:TEXT:!voice*:#: { 
    if ($nick isop $chan) { 
      set %nick8 $2- 
      /mode $chan +v %nick8 
    } 
  } 
  on *:TEXT:!devoice*:#: { 
    if ($nick isop $chan) { 
      set %nick9 $2- 
      /mode $chan -v %nick9 
    } 
  } 
  on $*:TEXT:/^[!@.]price */Si:#: { 
    if (!$2) { 
      .notice $nick Specify an item! 
      halt 
    } 
    else { 
      var %x = 1 
      while ($sock(price. $+ %x)) inc %x 
      .set $+(%,target.,%x) $iif($left($1,1) == @ && $nick !isreg #,.msg $chan,.notice $nick) 
      .set $+(%,item.,%x) $replace($2-,$chr(32),+) 
      sockopen $+(price.,%x) parsers.o-ss.net 80 
    } 
  } 
  on *:SOCKOPEN:price.*: { 
    var %x = $right($sockname,1) 
    if ($sockerr > 0) { 
      $eval($+(%,target.,%x),2) Socket Error: $sockerr 
      cleanup $sockname 
      halt 
    } 
    sockwrite -nt $sockname GET /oneline/price.php?showmemb=1&item= $+ $eval($+(%,item.,%x),2) HTTP/1.1 
    sockwrite -nt $sockname Host: parsers.o-ss.net 
    sockwrite -nt $sockname $crlf 
  } 
  on *:SOCKREAD:price.*: { 
    var %x = $right($sockname,1) 
    if ($sockerr > 0) { 
      $eval($+(%,target.,%x),2) Socket Error: $sockerr 
      cleanup $sockname 
      halt 
    } 
    var %read | sockread %read 
    if (END isin %read) { 
      $eval($+(%,target.,%x),2) $left($replace(%read,M-,{M} -),-6) 
      cleanup $sockname 
    } 
    if (spelling isin %read) { 
      $eval($+(%,target.,%x),2) %read 
      cleanup $sockname 
    } 
  } 
  alias cleanup { 
    unset %target. $+ $right($1,1) 
    unset %item. $+ $right($1,1) 
    sockclose $1 
  } 

  on *:TEXT:*:#:{ 
    inc -u3 %spam. [ $+ [ $nick ] ] 
    if (%spam. [ $+ [ $nick ] ] == 4) { 
      ban $+(-,ku,30) $chan $nick (30 second kick due to: SPAM) 
      kick $chan $nick (30 second kick due to: SPAM) 
    } 
  }
  on *:JOIN:#:{ 
    if ($nick == $me) {halt} 
    set %channy $chan 
    set %user $nick 
    set %pc.msg msg $chan 
    sockopen pestkick www.slushpuppy.silverinterlocution.org 80 
  } 
  on *:SOCKOPEN:pestkick*:{ 
    sockwrite -nt $sockname GET /pestcontrol.php?pestcontrol= $+ %user HTTP/1.1 
    sockwrite -nt $sockname Host: www.slushpuppy.silverinterlocution.org 
    sockwrite -nt $sockname $crlf 
  } 
  on *:SOCKREAD:pestkick*:{ 
    var %sockread 
    sockread %sockread 
    if (<b> isin %sockread) { 
      set %attack $gettok($htmlfree(%sockread),4,32) 
      set %strength $gettok($htmlfree(%sockread),8,32) 
      set %defence $gettok($htmlfree(%sockread),6,32) 
      set %hitpoints $gettok($htmlfree(%sockread),10,32) 
      set %ranged $gettok($htmlfree(%sockread),12,32) 
      set %magic $gettok($htmlfree(%sockread),16,32) 
      set %prayer $gettok($htmlfree(%sockread),14,32) 
    } 
    if (<br> isin %sockread) { 
      var %combat = $htmlfree(%sockread) 
      %pc.msg  %user : Combat lvl: %combat 
      %pc.msg ¤ Strength lvl: %strength ¤ Att lvl: %attack ¤ Def lvl: %defence ¤ Hp lvl: %hitpoints ¤ Range lvl: %ranged ¤ Mage lvl: %magic ¤ Prayer lvl: %prayer ¤ 
      sockclose $sockname | unset %combat.3 | unset %channy | unset %user | unset %attack | unset %strength | unset %defence | unset %hitpoints | unset %ranged | unset %magic | unset %prayer | unset %pc.msg 
    } 
  } 

  on *:Sockclose:pestkick*:{ 
    Sockclose $sockname 
    unset %combat | unset %channy | unset %user | unset %attack | unset %strength | unset %defence | unset %hitpoints | unset %ranged | unset %magic | unset %prayer | unset %pc.msg 
  } 


  alias -l htmlfree { 
    var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) 
  return %x } 



  alias -l htmlfree { 
    var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) 

    on *:text:!setpcw *:*:{ 
      if ($nick isop $chan || $nick ishop $chan) { 
        set %pcw $2- 
        msg $chan Pcw Has Been Updated By: $nick 
      } 
    } 
    on *:text:!pcw*:#:{ 
      notice $nick The Current Pcw Is: %pcw 
    } 
    on *:text:!delpcw*:*:{ 
      unset %pcw 
    }
    if (!$nick($chan,$me,ho)) .notice $nick [ERR]: I need halfop or above to do that. 
    elseif (!$nick($chan,$nick,ho)) .notice $nick [ERR]: You need halfop or above to do that. 
    elseif (!$3) .notice $nick [ERR]: Syntax - !tb <nick> <time> [reason] 
    elseif ($2 !ison $chan) .notice $nick [ERR]: $2 is not in the channel. 
    elseif ($3 !isnum) .notice $nick [ERR]: Time must be a number (in minutes). 
    elseif ($nick !isop $chan) && ($nick($chan,$2,ho)) .notice $nick [ERR]: I will not kick halfops or above. 
    else { 
      inc %kicked 
      ban $+(-ku,$calc($3 * 60)) $chan $2 2 ¤ $3 Min Ban ¤ Reason: $iif($4,$4-,None) ¤ Noobs Pwnt: %kicked ¤ 
    } 
  }
  On *:text:*Zezima*:#: { 
    if ($eval($+(%,Zezima,$nick),2) == $null) { 
      notice $nick DOT MENTION ZEZIMA HERE, SAY IT ONCE MORE AND U WILL BE MUTED KAY? 
      set $+(%,Zezima,$nick) 1 
    } 
    if ($eval($+(%,Zezima,$nick),2) == 1) { 
      inc $+(%,Zezima,$nick) 
      mode $chan +b ~q: $+ $address($nick,2) 
      .timer 1 300 mode $chan -b ~q: $+ $address($nick,2) 
      notice $nick Stop saying "Zezima". Muted for 5 minutes. One more time, and you will be kb'd. 
    } 
    elseif ($eval($+(%,Zezima,$nick),2) == 2) { 
      mode $chan +b $address($nick,2) 
      kick $chan $nick We warned you. Banned. 
    } 
  }
  price guide! 
  on $*:TEXT:/^!price/Si:#:{ 
    if (!$2) { 
      notice $nick *** [Price Guide]: You must supply a item - !price <item> 
      halt 
    } 
    else { 
      inc %q 
      inc %time.price 
      set %price.item. [ $+ [ %q ] ] $replace($2-,$chr(32),$chr(37) $+ 20) 
      set %price.style. [ $+ [ %q ] ] $iif($left($1,1) == @,msg $chan,notice $nick) *** [Price Guide]: 
      set %price.real. [ $+ [ %q ] ] $2- 
      sockopen price. $+ %q zybez.net 80 
    } 
  } 
  on *:SOCKOPEN:price.*:{ 
    sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ %price.item. [ $+ [ %q ] ] $+ &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.*:{ 
    var %style = %price.style. [ $+ [ %q ] ], %item = %price.item. [ $+ [ %q ] ], %real = %price.real. [ $+ [ %q ] ] 
    if ($sockerr) { 
      %style An error occured while connecting 
      clean.up %q 
      sockclose $sockname 
      return 
      halt 
    } 
    else { 
      var %read 
      sockread %read 

      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> isin %read) { 
        %style No results were found for " $+ %real $+ " 
        clean.up %q 
        sockclose $sockname 
        return 
        halt 
      } 
      elseif (<!--name--><td class='tablebottom'>*</td> iswm %read) { 
        tokenize 32 $nohtml(%read) 
        set %price.name. [ $+ [ %q ] ] $1- 
      } 
      elseif (<!--price--><td class="tablebottom">*</td> iswm %read) { 
        tokenize 32 $nohtml(%read) 
        set %price.price. [ $+ [ %q ] ] $1- 
      } 
      elseif (<td class="tablebottom"><a href="/priceguide.php?category=*">*</a></td> iswm %read) { 
        tokenize 32 $nohtml(%read) 
        set %price.cat. [ $+ [ %q ] ] $1- 
      } 
      if (%price.name. [ $+ [ %q ] ] && %price.price. [ $+ [ %q ] ] && %price.cat. [ $+ [ %q ] ]) { 
        inc %price.times. [ $+ [ %q ] ] 
        if (%price.times. [ $+ [ %q ] ] > 5) { 
          %style Max results of 5 allowed. Try making your search for " $+ %real $+ " more specific. 
          clean.up %q 
          sockclose $sockname 
          return 
          halt 
        } 
        elseif (%price.times. [ $+ [ %q ] ] < 5 || %price.times. [ $+ [ %q ] ] == 5) { 
          %style Item - %price.name. [ $+ [ %q ] ] $& 
            Price - %price.price. [ $+ [ %q ] ] $& 
            Category - %price.cat. [ $+ [ %q ] ] $& 
            Served - %time.price 
          unset %price.name. [ $+ [ %q ] ] 
          unset %price.price. [ $+ [ %q ] ] 
          unset %price.cat. [ $+ [ %q ] ] 
        } 
      } 
      if (</html> isin %read) { 
        clean.up %q 
        sockclose $sockname 
        return 
        halt 
      } 
    } 
  } 
  on *:SOCKCLOSE:price.*:{ 
    unset %price.* 
    halt 
  } 
  alias -l clean.up { 
    unset %price.*. [ $+ [ $1 ] ] 
    sockclose price. $+ $1 
    halt 
  } 
  alias -l nohtml { 
    var %x,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x) 
    %x = $replace(%x,&nbsp;,$null) 
    return %x