Code:
alias kb {
  if ($left($1,2) == -u) {
    if ($3 isnum 0-9) {
      if ($4 != $null) {
        ban $$1 $chan $$2 $$3
        if ($2 ison $chan) { kick $chan $$2 kb $$4- }
        halt
      }
      else {
        ban $$1 $chan $$2 $$3
        if ($2 ison $chan) { kick $chan $$2 kb $me }
        halt
      }
    }
  }
  if ($left($1,2) == -u) {
    if ($3 != $null) {
      ban $$1 $chan $$2
      if ($2 ison $chan) { kick $chan $$2 kb $$3- }
      halt
    }
    else {
      ban $$1 $chan $$2
      if ($2 ison $chan) { kick $chan $$2 kb $me }
      halt
    }
  }
  if ($2 isnum 0-9) {
    if ($3 != $null) {
      ban $chan $$1 $$2
      if ($1 ison $chan) { kick $chan $$1 kb $$3- }
      halt
    }
    else {
      ban $chan $$1 $$2
      if ($1 ison $chan) { kick $chan $$1 kb $me }
      halt
    }
  }
  if ($2 != $null) {
    ban $chan $$1
    if ($1 ison $chan) { kick $chan $$1 kb $$2- }
    halt
  }
  else {
    ban $chan $$1
    if ($1 ison $chan) { kick $chan $$1 kb $me }
    halt
  }
  halt
}



I use this because it supports all the switches that the /ban command has.

There probably is a simpler way to do it, but I cbf looking around for it.


this is how you use it:


/kb -uN nickname mN reason


the -uN and mN are completely optional, as is the reason.

-uN is the timer for the ban, useage is like this: -u60 (bans for 60 seconds, and then removes the ban).

mN is the mask number, useage is a number between 0-9. read the help file for information on $masks (this will explain the mask type for each number.


for instance if i did this:


/kb -u3600 peter 3 this client sucks


this would ban that nickname with the mask *!*user@*.host for an hour, with the reason "this client sucks"

Last edited by neophyte; 11/05/03 02:55 AM.

--------
mIRC - fun for all the family (except grandma and grandpa)