All pastes #1858400 Raw Edit

Mine

public text v1 · immutable
#1858400 ·published 2010-04-08 01:34 UTC
rendered paste body
alias addblacklist {
  if (!$1) {
    /echo -a Add a nick and/or reason; /addblacklist <nick> <reason> | halt
  }
  if (!$readini(pmblist.ini,nick,$1)) {
    if (!$2) {
      /writeini pmblist.ini nick $1 $1
      /writeini pmblist.ini reason $1 No reason given.
      /echo -a $1 added to the blacklist, reason; None.
    }
    else {
      /writeini pmblist.ini nick $1 $1
      /writeini pmblist.ini reason $1 $2-
      /echo -a $1 added to the blacklist, reason; $2-
    }
  }
  else {
    echo -a $1 is already on it! | halt
  }
}
alias remblacklist {
  if (!$1) {
    /echo -a Remove a nick ; /remblacklist <nick> | halt
  }
  if ($1 == all) {
    /remini pmblist.ini nick
    /remini pmblist.ini reason
    echo -a The blacklist has been cleared. | halt
  }
  if ($readini(pmblist.ini,nick,$1)) {
    if (!$2) {
      /remini pmblist.ini nick $1
      /remini pmblist.ini reason $1
      /echo -a $1 removed from the blacklist
    }
    else {
      /remini pmblist.ini nick $1
      /remini pmblist.ini reason $1
      /echo -a $1 removed from the blacklist
    }
  }
  else {
    echo -a They're not on it! | halt
  }
}
on *:TEXT:*:?:{
  if (!$readini(pmblist.ini,nick,$nick)) { halt }
  else {
    msg $nick 13[14PM BLOCKED13]14 You are currently on my blacklist. Reason; $+(13,$readini(pmblist.ini,reason,$nick),.)
    msg $nick 13[14PM BLOCKED13]14 If you require my needs, ask me on a channel we're both in (if any); $+(13,$samechans($nick),14.)
    .close -m $nick
    /ignore -pntu600 $nick
    echo -a $nick tried to pm me, sentence; $1-
  }
}
Alias samechans {
  if (!$1) { halt }
  if (!$comchan($1,0)) halt
  else {
    var %c 1, %l
    while (%c <= $comchan($1,0)) {
      var %l %l $comchan($1,%c)
      inc %c
    }
    return %l
  }
}
alias blists {
  //say 13[14PM BLACKLIST13]14 I have a total of13 $ini(pmblist.ini,nick,0) 14people on my blacklist.
}