; 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-
}
}