I've modified this script a bit more to include flood protection and the option for public, moderator, regular, and owner only commands.

The only issue I am having right now is for the public commands.

Right now I have to include a -ul=all for public. If that is not included, the command fails

ex: !addcom !test this is a test
When using !test it doesn't work (obviously because I left out the -ul=all)

I've been trying to make it so the -ul=all is not required. So if someone forgets to add it, the command will still work. Would someone mind pointing me in the right direction?


Code:
ON *:TEXT:!*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(# $+ commands.txt, nts, $1)) {
    var %com = $v1
    var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
    if (-ul=mod == $gettok(%com,1,32)) && ($mod($nick)) {
      if ($($+(%,flood,$1),2)) || ($($+(%,flood,$1,.,$nick),2)) { return }
      set -u5 $+(%,flood,$1) On
      set -u5 $+(%,flood,$1,.,$nick)
      if ($2 ison #) {
        msg $chan $2 $+ : $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
      else {
        msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
    }
    elseif (-ul=reg == $gettok(%com,1,32)) && (($mod($nick)) || ($regular($nick))) {
      if ($($+(%,flood,$1),2)) || ($($+(%,flood,$1,.,$nick),2)) { return }
      set -u5 $+(%,flood,$1) On
      set -u5 $+(%,flood,$1,.,$nick)
      if ($2 ison #) {
        msg $chan $2 $+ : $iif(-ul=reg == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
      else {
        msg $chan $iif(-ul=reg == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
    }
    elseif (-ul=own == $gettok(%com,1,32)) && ($nick == jimieo) {
      if ($($+(%,flood,$1),2)) || ($($+(%,flood,$1,.,$nick),2)) { return }
      set -u5 $+(%,flood,$1) On
      set -u5 $+(%,flood,$1,.,$nick)
      msg $chan $iif(-ul=own == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
    }
    elseif (-ul=all == $gettok(%com,1,32)) {
      if ($($+(%,flood,$1),2)) || ($($+(%,flood,$1,.,$nick),2)) { return }
      set -u5 $+(%,flood,$1) On
      set -u5 $+(%,flood,$1,.,$nick)
      if ($2 ison ) {
        msg $chan $2 $+ : $iif(-ul=all == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
      else {
        msg $chan $iif(-ul=all == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
      }
    }        

  }
}