All pastes #746258 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-23 02:42 UTC
rendered paste body
alias message {
  if (!$1) { /notice $me please use the proper syntax(es) ex(s): /message add (chan) /message del (chan) /message search (chan) or /emsg (message) | halt }

  if ($1 = add) && ($ini(emsgexception.ini,Exceptions,$2)) {
  /notice $me $2 I am sorry but the channel $2 is already on the Amsg Exception List. | halt }

  elseif ($1 = add) {
  /writeini emsgexception.ini Exceptions $2 $2 added to the exception list on $asctime | notice $me $readini(emsgexception.ini,exceptions,$2) | halt }

  if ($1 = search) && ($ini(emsgexception.ini,Exceptions,$2)) {
  /notice $me $2 is on the Amsg Exception List. $readini(emsgexception.ini,exceptions,$2) | halt }

  elseif ($1 = search) {
  /notice $me $2- is not on the Amsg Exception List | halt }

  if ($1 = delete) && ($ini(emsgexception.ini,Exceptions,$2)) {
  /remini emsgexception.ini Exceptions $2 | /notice $me $2 has been removed from the Amsg Exception List. | halt }

  elseif ($1 = delete) {
  /notice $me I am sorry but $2 is not on the Amsg Exception List. | halt }
  else {  /notice $me please use the proper syntax(es) ex(s): /message add (chan) /message del (chan) /message search (chan) or /emsg (message) | halt }
}
alias global {
  var %x = 0
  while (%x < $chan(0)) {
    inc %x
    if ($ini(emsgexception.ini,exceptions,$chan(%x))) { var %amsgexceptions $chan(%x) }
    if ($chan(%x) != %amsgexceptions) {
      msg $chan(%x) [-AmSg-] $1-,2)
    }
  }
}