auto OP/HalfOP/Voice

By Trotils on Jan 02, 2011

cmds for op (chan):
!op nick - gives status for user but dont writen in ini file
!deop nick - gives status for user but dont writen in ini file
!hop nick - gives status for user but dont writen in ini file
!dehop nick - gives status for user but dont writen in ini file
!voice nick - gives status for user but dont writen in ini file
!devoice nick - gives status for user but dont writen in ini file

!addop nick - adds nick to OP ini list
!delop nick - delete nick from OP ini list
!addh nick - adds nick to Half-OP ini list
!delh nick - delete nick from Half-OP ini list
!addv nick - adds nick to voice ini list
!delv nick - delete nick from voice ini list

gives option to OP user to chainge status to any status (chan or prvt):
!deop
!op
!dehop
!hop
!devoice
!voice

gives option to Half-OP user to chainge status from no status to Half-OP satus (chan or prvt):
!dehop
!hop
!devoice
!voice

gives option to Voiced user to chainge status from no status to Voiced satus (chan or prvt):
!devoice
!voice

before use change any #chan to your chan name

p.s inspired by HRaZoR ( http://www.hawkee.com/snippet/1513/ )

on 1:TEXT:*:?:{
; gives option to OP user to chainge status to any status
  if ($readini(addop.ini,$nick,aop) == $address($nick,2)) {
    if ( !deop == $1- ) { 
      /mode #chan -o $nick 
    }
    if ( !op == $1- ) { 
      /mode #chan +o $nick 
    }
    if ( !dehop == $1- ) { 
      /mode #chan -h $nick 
    }
    if ( !hop == $1- ) { 
      /mode #chan +h $nick 
    }
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
; gives option to Half-OP user to chainge status from no status to Half-OP satus
  if ($readini(addh.ini,$nick,aoh) == $address($nick,2)) { 
    if ( !dehop == $1- ) { 
      /mode #chan -h $nick 
    }
    if ( !hop == $1- ) { 
      /mode #chan +h $nick 
    }
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
; gives option to Voiced user to chainge status from no status to Voiced satus
  if ($readini(addv.ini,$nick,aov) == $address($nick,2)) { 
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
}
on 1:TEXT:*:#chan:{
; gives Op/Voice/HalfOP but dont write in .ini file
  if ( $nick isop #chan ) {
    if ( !op* iswm $1- ) { /mode $chan +o $1 }
    if ( !deop* iswm $1- ) { /mode $chan -o $1 }
    if ( !hop* iswm $1- ) { /mode $chan +h $1 }
    if ( !dehop* iswm $1- ) { /mode $chan -h $1 }
    if ( !voice* iswm $1- ) { /mode $chan +v $1 }
    if ( !devoice* iswm $1- ) { /mode $chan -v $1 }
  }
; gives option to OP user to chainge status to any status
  if ($readini(addop.ini,$nick,aop) == $address($nick,2)) {
    if ( !deop == $1- ) { 
      /mode #chan -o $nick 
    }
    if ( !op == $1- ) { 
      /mode #chan +o $nick 
    }
    if ( !dehop == $1- ) { 
      /mode #chan -h $nick 
    }
    if ( !hop == $1- ) { 
      /mode #chan +h $nick 
    }
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
; gives option to Half-OP user to chainge status from no status to Half-OP satus
  if ($readini(addh.ini,$nick,aoh) == $address($nick,2)) { 
    if ( !dehop == $1- ) { 
      /mode #chan -h $nick 
    }
    if ( !hop == $1- ) { 
      /mode #chan +h $nick 
    }
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
; gives option to Voiced user to chainge status from no status to Voiced satus
  if ($readini(addv.ini,$nick,aov) == $address($nick,2)) { 
    if ( !devoice == $1- ) { 
      /mode #chan -v $nick 
    }
    if ( !voice == $1- ) { 
      /mode #chan +v $nick 
    }
  }
; adds nick to OP list
  if ( !addop* iswm $1- ) {
    if ( $nick !isop #chan ) { msg $chan Command Ignored (Must be OP) }
    else { 
      .writeini addop.ini $2 aop $address($2,2)
      msg $chan Added $2 to Auto Op List 
    }
  }
; adds nick to Voice list
  if ( !addv* iswm $1-) {
    if ( $nick !isop #chan ) { msg $chan Command Ignored (Must be OP) }
    else { 
      .writeini addv.ini $2 aov $address($2,2) 
      msg $chan Added $2 to Auto Voice List 
    }
  }
; adds nick to Half-OP list
  if ( !addh* iswm $1- ) {
    if ($nick !isop #chan ) { msg $chan Command Ignored (Must be OP) }
    else { 
      .writeini addh.ini $2 aoh $address($2,2) 
      msg $chan Added $2 to Auto Half-OP List 
    }
  }
; delete nick from OP list
  if ( !delop* iswm $1- ) {
    if ($nick !isop #chan ) { msg $chan Command ignored (Must be OP) }
    else { 
      .remini addop.ini $2 
      msg $chan Removed $2 From Auto Op List 
    }
  }
; delete nick from Voice list
  if ( !delv* iswm $1- ) {
    if ($nick !isop #chan ) { msg $chan Command ignored (Must be OP) }
    else { 
      .remini addv.ini $2 
      msg $chan Removed $2 From Auto Voice List 
    }
  }
; delete nick from Half-OP list
  if ( !delh* iswm $1- ) {
    if ($nick !isop #chan ) { msg $chan Command ignored (Must be OP) }
    else { 
      .remini addh.ini $2 
      msg $chan Removed $2 From Auto Half-OP List 
    }
  }
}

on 1:join:#chan:{
  if ( $nick == $me ) { halt }  
  if ($readini(addop.ini,$nick,aop) == $address($nick,2)) { mode $chan +o $nick }
  elseif ($readini(addv.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
  elseif ($readini(addh.ini,$nick,aoh) == $address($nick,2)) { mode $chan +h $nick }
  elseif ($readini(addop.ini,$nick,aop) != $address($nick,2)) { /msg $chan $nick msg if chan is +m and if it is needed to anounce that chan is only for +V or higher }
  elseif ($readini(addv.ini,$nick,aov) != $address($nick,2)) { /msg $chan $nick msg if chan is +m and if it is needed to anounce that chan is only for +V or higher }
  elseif ($readini(addh.ini,$nick,aoh) != $address($nick,2)) { /msg $chan $nick msg if chan is +m and if it is needed to anounce that chan is only for +V or higher }
}

Comments

Sign in to comment.
Nuker   -  Jun 21, 2013

Nice one :)

 Respond  
Trotils   -  Jan 03, 2011

if ( !op* iswm $1- ) { /mode $chan +o $1 }
is used my admin to give op for user without writting in to auto-op list...

 Respond  
Jethro   -  Jan 02, 2011

if ( !op* iswm $1- ) { /mode $chan +o $1 } Is there a reason you use iswm operator for this operation? It will result an error if someone enters !op without the nick to op. And using iswm will make the command wildcard, meaning it will trigger with anything following from behind E.g. !opabc123

You should just use:

if (!op == $1) {
 /mode # +o $2

so are the rest.

 Respond  
Trotils   -  Jan 02, 2011

oh... stupid mistake .. i am new one so i make some mistakes ... made corection ...

 Respond  
Conscious   -  Jan 02, 2011

/mode # +ooo $1 $2 $3 would work :o

 Respond  
Jethro   -  Jan 02, 2011

I'm not sure why you set three modes and mode only one person at the same time.

!op John Bob Mary

You're supposed to:

/mode # +ooo $1-3

You need to have the tokens $1 $2 and $3 to op them all simultaneously with > +ooo

 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.