Code:
; You can add comments to a code - all lines prefixed with a ; will be ignored while processing your code.
; Of course you can remove all these comments if you like

; kickban per editbox command (example)
alias kb {

  ; the window where you entered the command is not a active channel 
  ; [note how the operator "ison" has been negated with an exclamation mark]

  if ($me !ison $acitve) { echo -a kickban: $active is not a channel! }

  ; no first parameter (no nick given)
  ; [using the 'negation-prefix' again, this time to check whether there was a parameter entered]

  elseif (!$1) { echo -a kickban: no nick specified. Syntax: /kb <nick> <optional kick-reason> }

  ; first paramter given is not a nick on that chan

  elseif ($1 !ison $chan) { echo -a kickban: $1 is not a nick on $active }

  ; no sufficient channel rights (only ops, halfops etc can kick or ban a user)
  ; [this line combines two "if" comparisons with "or"]

  elseif (($me isreg $active) || ($me isvoice $active)) { echo -a kickban: Your have no sufficient channel rights on active to kick or ban }

  ; none of the possible errors above occured: perform the ban with "mode" as you liked, followed by a kick. 
  ; [desired banmask "4" via $address(nick,4). "$2-" refers to the 2nd parameter onwards, in this case the kick reason]

  else { 
    mode $active +b $address($1,4)
    kick $active $1 $2-
  }

}


Well. I was doing /kb nick and it gives me " kickban: #mpot is not a channel! "

But it is a channel because I was typing it in that channel window.

And then I tried /kb #channel nick from a different channel and it gave me the same error as above, except for the channel that I typed it in. It didn't error for the channel specified.