napa182 commented on a Page, OP Commands  -  Jan 29, 2009

no need to check if $nick isop on every command, and you should make sure that the bot or who ever is running this code has op in the channel.

you also dont have to use $strip in every command line you can use tokenize 32 $strip($1-).

on @*:TEXT:*:#: {
  tokenize 32 $strip($1-)
  if ($nick(#,$nick,o) && !$($+(%,opc,.,Commandflood,.,$nick),2)) { 
    set -u3 $+(%,opc,.,Commandflood,.,$nick) on
    if ($1 == !opc) { .notice $nick Op commands are: !ban < username >, !unban < username >, !kick < username >, +m, -m, +i, -i, +v < username >, -v < username >, +o < username >, -o < username > and !topic. Note: These commands only work for ops and if I am oped. }
    if ($1 == !topic && $2) { topic # $2- }
    if ($1 == !kick && $2 ison # && $2 != $me) { kick # $2 $iif(!$3,No Reason,$3-) | .notice $2 You where kicked by: $nick at $time on $date for $+($iif(!$3,No Reason,$3-),.) }
    if ($regex($1,/^\!(ban|unban)$/) && $2 ison # && $2 != $me) { mode # $iif($1 == !ban,+b,-b) $address($2,2) }
    if ($regex($1,/^[+-][ov]$/)) { mode # $1 $iif(!$2,$nick,$2) }
    if ($regex($1,/^[+-][im]/)) { mode # $1 }
  }
  elseif ($istok(!ban !unban !topic !kick +o +v +m +i -i -m -v -o !opc,$1,32) && !$nick(#,$nick,o) && !$($+(%,opcflood,.,$nick),2)) { set -u3 $+(%,opcflood,.,$nick) on | .notice $nick You must be an OP to use these commands. }
}

but as ur code is 4/10

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.