All pastes #372290 Raw Edit

Untitled

public text v1 · immutable
#372290 ·published 2007-02-25 23:02 UTC
rendered paste body
on *:text:*:#:{
  if ($hget(binds) == $null) { hmake binds }
  if ($exists(binds.db) == $true) { hload binds binds.db }
  if ($mid($1-,1,$len(%trigger)) == %trigger) {
    tokenize 32 $mid($1-,$calc($len(%trigger) + 1) $+ -)
  }
  else { halt }
  if ($hget(binds,$1) != $null) {
    .msg $chan $v1
  }
  if ($ulevel >= 4) {
    if ($1 == bind) {
      if ($3 == $null) { .notice $nick Specify [command] [text] }
      else {
        hadd binds $2 $3-
        .notice $nick bound $2 to $3- $+  +  
        hsave binds binds.db
      }
    }
  }
  if ($ulevel >= 4) {
    if ($1 == unbind) {
      if ($2 == $null) { .notice $nick Specify [command]
      }
      else {
        if ($hget(binds,$2) == $null) { .notice $nick Command doesnt exist. }
        else {
          hdel binds $2
          .notice $nick Successfully unbound $22
          hsave binds binds.db
        }
      }
    }
  }
}