All pastes #882595 Raw Edit

Someone

public text v1 · immutable
#882595 ·published 2008-01-30 03:08 UTC
rendered paste body
on *:text:?#*:#ircgods:{
  if ($nick isvoice $chan) {
    tokenize 32 $strip($1-,bcur)
    var %bot.packnum = $1
    var %bot.name = $nick
    var %bot.packname = $gettok($1-,-1,32)
    if ($3 == [) { 
      var %bot.packsize = $remove($gettok($1-,3-4,32),[,])
    }
    else {
      var %bot.packsize = $remove($gettok($1-,3,32),[,])
    }
    var %bot.entry = %bot.name $+ ~ $+ %bot.packnum
    if ($hfind(Files,%bot.entry,1,w) == $null && $hfind(Files,%bot.packname $+ *,1,w).data == $null)  {
      hadd -m Files %bot.entry %bot.packname %bot.packsize
      msg #gods 7** New Release: %bot.packname 7**
      msg #gods 7** Size: %bot.packsize 7**
      msg #gods 7** Get Command: /msg %bot.name xdcc send %bot.packnum 7**
      if ($lines(last.txt) >= 5) {
        write -dl6 last.txt
        write -il1 last.txt %bot.packname %bot.packsize $time(mm/dd/yy@h:nntt)
      }
      return
    }
    if ($hfind(Files,%bot.entry,1,w) != $null && $hfind(Files,%bot.packname $+ *,1,w).data == $null) {
      hadd -m Files %bot.entry %bot.packname %bot.packsize
      msg #gods 7** New Pack: %bot.packname 7**
      msg #gods 7** Size: %bot.packsize 7**
      msg #gods 7** Get Command: /msg %bot.name xdcc send %bot.packnum 7**      
      if ($lines(last.txt) >= 5) {
        write -dl6 last.txt
        write -il1 last.txt %bot.packname %bot.packsize $time(mm/dd/yy@h:nntt)
      }
      return
    }
    if ($hfind(Files,%bot.entry,1,w) == $null) {
      hadd -m Files %bot.entry %bot.packname %bot.packsize
      echo -a beh
    }
  }
}
on *:text:!last:#:{
  var %last $read(last.txt, 1)
  var %bot.packname $gettok(%last,1,32)
  var %bot.packsize $gettok(%last,2,32)
  var %bot.packadded $gettok(%last,3,32)
  msg $chan 7** Latest Pack: %bot.packname 7**
  msg $chan 7** Size: %bot.packsize 7**
  msg $chan 7** Added: %bot.packadded 7**
}

on *:text:!latest:#:{
  var %i = 1
  while (%i <= 5) {
    set %last $read(last.txt, %i)
    var %bot.packname $gettok(%last,1,32)
    var %bot.packsize $gettok(%last,2,32)
    var %bot.packadded $gettok(%last,3,32)
    notice $nick 7** # $+ %i $+  7- %bot.packname 7**
    notice $nick 7** Size: %bot.packsize 7**
    notice $nick 7** Added: %bot.packadded 7**
    if (%i != 5) { 
      notice $nick 
    }
    inc %i
  }
  unset %last
}
alias fhsearch { var %item = $hfind(Files,* $+ $1 $+ *,$2,w).data | return $iif($prop == item, %item, $hget(Files,%item)) }
alias bhsearch { var %item = $hfind(Bots,* $+ $1 $+ *,$2,w) | return $iif($prop == item, %item, $hget(Bots,%item)) }
on *:text:!help:#:{
  msg $chan 7** !help 7- shows this help text 7**  
  msg $chan 7** !latest 7- shows last 5 packs 7**
  msg $chan 7** !last 7- shows our latest pack 7**
  msg $chan 7** !stats 7- shows our stats info 7**
  msg $chan 7** @/!search or @/!find <pack> 7- searches for specified pack> 7**
}
on *:text:*:#gods:{
  if ($1 == !find) || ($1 == @find) || ($1 == @search) || ($1 == !search) {
    if ($2 == $null) { /msg $chan please search for something. | return }
    var %b = $ticks
    var %i = 1, %item, %item2, %r
    while (%i <= 5) {
      %item = $fhsearch($replace($2-,$chr(32),$chr(42)), %i).item
      %item2 = $fhsearch($replace($2-,$chr(32),$chr(42)), %i)
      var %bot.nick = $gettok(%item,1,126)
      if (%i == 1 && !%item) {
        msg $chan 7** Nothing found for $2- or bots are offline 7** 
        halt
      }
      if (!%item) { 
        msg $chan item is blank | break 
      } 
      else { 
        echo -a %item %item2 %i
      }
      var %bot.packnum = $gettok(%item,2,126)
      if (%bot.nick !ison #ircgods) { inc %i |  return }
      if (%i == 1) { msg $chan 7** Sending search results for $2- to $nick 7** }
      inc %r
      var %bot.packsize = $gettok($hget(Files, %item),1,32)
      var %bot.pack = $gettok($hget(Files, %item),2,32)
      var %bot.slots = $gettok($hget(Bots,$hfind(Bots,%bot.nick,1,w)),3,32)
      var %bot.que = $remove($gettok($hget(Bots,$hfind(Bots,%bot.nick,1,w)),4,32),$chr(41))
      if (%bot.que == none) { %bot.que = N/A }
      notice $nick 7** # $+ %i $+  7- %bot.pack 7**
      notice $nick 7** Size: %bot.packsize 7- Sends: %bot.slots 7- Queue: %bot.que 7**
      notice $nick 7** Get Command: /msg %bot.nick xdcc send %bot.packnum 7**
      if (%i != $hfind(Files,* $+ $replace($2-,$chr(32),$chr(42)) $+ *,0,w).data) && (%i <= 4) && (%bot.nick ison #ircgods) {
        notice $nick 
      }
      if (%bot.nick !ison #ircgods) { break } 
      inc %i
    }
    if ($hfind(Files,* $+ $replace($2-,$chr(32),$chr(42)) $+ *,0,w).data > 5) && (%bot.nick ison #ircgods) {
      notice $nick 7** Too many results 7**
      return
    }
    msg $chan Results Sent to $nick $+ . %r results in ( $+ $calc($ticks - %b) $+ ms $+ )
  }