on *:INPUT:#: { 
  if (+q === $1) {
    if ($2 = $null) { /msg chanserv owner # $me }
    else { /mode $chan +q $2- }
  }
  if (+a = $1) { 
    if ($2 = $null) { /msg chanserv protect # $me }
    else { /mode $chan +a $2- }
  }
  if (+o = $1) {
    if ($2 = $null) { /msg chanserv op # $me }
    else { /mode $chan +o $2- }
  }
  if (+h = $1) { 
    if ($2 = $null) { /msg chanserv halfop # $me }
    else { /mode $chan +h $2- }
  }
  if (+v = $1) {
    if ($2 = $null) { /msg chanserv voice # $me }
    else { /mode $chan +v $2- }
  }
  if (-q === $1) {
    if ($2 = $null) { /msg chanserv deowner # $me }
    else { /mode $chan -q $2- }
  }

  if (-a === $1) {
    if ($2 = $null) { /msg chanserv deprotect # $me }
    else { /mode $chan -a $2- }
  }
  if (-o === $1) {
    if ($2 = $null) { /msg chanserv deop # $me }
    else { /mode $chan -o $2- }
  }
  if (-h === $1) {
    if ($2 = $null) { /msg chanserv dehalfop # $me }
    else { /mode $chan -h $2- }
  }
  if (-v = $1) { 
    if ($2 = $null) { /msg chanserv devoice # $me }
    else { /mode $chan -v $2- }
  }
  if (-all === $1) { 
    if ($2 = $null) { /cs deowner # $me | /cs deprotect # $me | /cs deop # $me | /cs dehalfop # $me | /cs devoice # $me }
    else { /mode $chan -qaohv $2- $2- $2- $2- $2- }
  }
  if (+e = $1) { 
    if ($2 = $null) { /mode $chan +ee $me $mask($ial($me,1),3) }
    else { /mode $chan +ee $$2 $mask($ial($$2,1),3) }
  }
  if (-e = $1) { 
    if ($2 = $null) { /mode $chan -ee $me $mask($ial($me,1),3) }
    else { /mode $chan -ee $$2 $mask($ial($$2,1),3) }
  }
  if (+I === $1) { 
    if ($2 = $null) { /mode $chan +II $me $mask($ial($me,1),3) }
    else { /mode $chan +II $$2 $mask($ial($$2,1),3) }
  }
  if (-I === $1) { 
    if ($2 = $null) { /mode $chan -II $me $mask($ial($me,1),3) }
    else { /mode $chan -II $$2 $mask($ial($$2,1),3) }
  }
  if (+eI === $1) { 
    if ($2 = $null) { mode $chan +II $me $mask($ial($me,1),3) | mode $chan +ee $me $mask($ial($me,1),3) }
    else { mode $chan +II $$2 $mask($ial($$2,1),3) | mode $chan +ee $$2 $mask($ial($$2,1),3) }
  }
  if (-eI === $1) { 
    if ($2 = $null) { mode $chan -II $me $mask($ial($me,1),3) | mode $chan -ee $me $mask($ial($me,1),3) }
    else { mode $chan -II $$2 $mask($ial($$2,1),3) | mode $chan -ee $$2 $mask($ial($$2,1),3) }
  }
  if (-b = $1) { /mode $chan -b $2- }
  if (+b = $1) { /mode $chan +b $2- }
  if (+b1 = $1 ) { /ban # $address($2,1) } 
  if (+b2 = $1 ) { /ban # $address($2,2) }
  if (+b3 = $1 ) { /ban # $address($2,3) }
  if (+b4 = $1 ) { /ban # $address($2,4) }
  if (+qb = $1) { /mode $chan +b ~q: $+ $2- }
  if (+qb1 = $1 ) { /ban # ~q: $+ $address($2,1) } 
  if (+qb2 = $1 ) { /ban # ~q: $+ $address($2,2) }
  if (+qb3 = $1 ) { /ban # ~q: $+ $address($2,3) }
  if (+qb4 = $1 ) { /ban # ~q: $+ $address($2,4) }
  if (+cb = $1 ) { /mode $chan +b ~c: $+ $2-  }
  if (+cbb = $1 ) { /mode $chan +bbbbbbbbbb ~c: $+ $2- ~c: $+ $3- ~c: $+ $4- ~c: $+ $5- ~c: $+ $6- ~c: $+ $7- ~c: $+ $8- ~c: $+ $9- ~c: $+ $10- ~c: $+ $11- }
  if (+m = $1) { /mode $chan +m }
  if (-m = $1) { /mode $chan -m }
  if (+Q === $1) { /mode $chan +Q }
  if (-Q === $1) { /mode $chan -Q }
  if (+R = $1) { /mode $chan +R }
  if (-R = $1) { /mode $chan -R }
  if (hop = $1) { /hop }
  if (hopall = $1) { /hopall }
  if (part = $1) { /part }
  if (partall = $1) { /partall }
  if (+vv = $1) { /cs set $chan secureops off | /mode # +v $$1 | /cs set $chan secureops on }
  if (+hh = $1) { /cs set $chan secureops off | /mode # +h $$2 | /cs set $chan secureops on }
  if (+oo = $1) { /cs set $chan secureops off | /mode # +o $$2 | /cs set $chan secureops on } 
  if (+aa = $1) { /cs set $chan secureops off | /mode # +a $$2 | /cs set $chan secureops on }
  if (+qq = $1) { /cs set $chan secureops off | /mode # +q $$2 | /cs set $chan secureops on }
  if (+a3 === $1) && ($2 != $null) { /msg chanserv access $chan add $2- 3 | /msg chanserv voice # $2- }
  if (+a4 === $1) && ($2 != $null) { /msg chanserv access $chan add $2- 4 | /msg chanserv halfop # $2- }
  if (+a5 === $1) && ($2 != $null) { /msg chanserv access $chan add $2- 5 | /msg chanserv op # $2- } 
  if (+a10 === $1) && ($2 != $null) { /msg chanserv access $chan add $2- 10 | /msg chanserv protect # $2- }
  if (+a9999 === $1) && ($2 != $null) { /msg chanserv access $chan add $2- 9999 | /msg chanserv protect # $2- }
  if (+del = $1) { /cs access $chan del $2- | /mode # -qaohv # $2- $2- $2- $2- $2- }
  if (+i = $1) { /invite $2- # }
  if (+akick === $1) { /cs akick $chan add $2- $3- }
  if (-akick === $1) { /cs akick $chan del $2 }
  if (akicklist === $1) { /cs akick $chan list }
  if (accesslist === $1) { /cs access $chan list }
  if (logout === $1) { /cs logout $chan $2- }
  if (levels == $1) { /cs levels $chan list }
  if (+k == $1) { //mode # -Q | //kick # $2 | //mode # -Q | }
  if (+kb2 === $1) { /mode # -ee $2 $mask($ial($$2,1),3),2) | /mode # +bb $2- $address($2-,2) | //mode # -Q | //kick # $2 }
  if (+kb3 === $1) { /mode # -ee $2 $mask($ial($$2,1),3),2) | /mode # +bb $2- $address($2-,3) | //mode # -Q | //kick # $2 }
}
