All pastes #804892 Raw Edit

script 1

public text v1 · immutable
·published 2007-12-03 21:30 UTC
rendered paste body
on *:text:!calc*:#: { notice $Nick $2- = $calc($2-) }

alias !nick {
  if ($1 == $null) { echo -a You need to provide a nickname to change to. }
  else {
    set -e %totalnets $scon(0)
    while (%totalnets > 0) {
      scon %totalnets nick $1
      dec %totalnets
    }
  }
}


new script:

On *:START: {
  if ( !$hget($wc.table) ) hmake $wc.table 100
  if ( $isfile($wc.data) ) hload $wc.table $wc.data
}

On *:EXIT: if ( $hget($wc.table) ) hsave -o $wc.table $wc.data
On *:DISCONNECT:  if ( $hget($wc.table) ) hsave -o $wc.table $wc.data

alias wc.table return wordcount
alias wc.data return $qt($scriptdirwordcount.dat)
alias wc.count {
  tokenize 32 $1-
  if ( $hfind($wc.table,$1-,1,W) ) {
    var %t = $v1
    if ( $wildtok($1-,%t,0,32) ) hinc -m $wc.table %t $v1
  }
}

On *:TEXT:!*word &:#: {
  if ( $1 == !addword ) {
    if ( !$hget($wc.table,$+(*,$2,*)) ) {
      hadd -m $wc.table $+(*,$2,*)
      msg $chan Added $2 in my database.
    }
    else msg $chan $2 is already in my database.
  }
  elseif ( $1 == !countword ) {
    if ( $hget($wc.table,$+(*,$2,*)) ) msg $chan $2 has been said: $v1 times.
    else msg $chan That word is not in my database.
  }
  elseif ( $1 == !delword ) {
    if ( $hget($wc.table,$+(*,$2,*)) ) {
      hdel $wc.table $+(*,$2,*)
      msg $chan Deleted $2 from my database.
    }
    else msg $chan That word is not in my database.
  }
}

on *:TEXT:*:#: wc.count $strip($1-)
On *:ACTION:*:#: wc.count $strip($1-)

new script:

on *:text:!time*:#: { notice $nick 3 the time is currently 4 $asctime }