Auto OP and Halfop

By anthony1293 on May 30, 2009

this will give people OP or halfop everytime they log into a channel. it does it so you do not need to be registered on a channel all you need to do is type the command and they're added to the list to give them either OP or halfop
commands:
!op - gives them op
!hop - gives them halfop
!deop - take off op
!dehop - takes off halfop

edited: only uses 1 .ini and will only rank if someone isn't already ranked. and now auto voices everyone who joins.

on *:TEXT:!hop*:#: {
  if ($nick isop $chan) {
    if ($readini(rank.ini,$chan,$address($2,2)) == op) {
      notice $nick $2 is currently on the OP list, please remove $2 from the OP list before you add them to the halfop list. | halt
    }
    else writeini rank.ini $chan $address($2,2) halfop
    notice $nick $2 has been added to the Halfop list
    mode $chan +h $2
  } 
  else notice $nick access denied
}
on *:TEXT:!op*:#: {
  if ($nick isop $chan) {
    if ($readini(rank.ini,$chan,$address($2,2)) == halfop) {
      notice $nick $2 is currently on the halfop list, please remove $2 from the halfop list before you add them to the OP list. | halt
    }
    else writeini rank.ini $chan $address($2,2) op
    notice $nick $2 has been added to the OP list
    mode $chan +o $2
  } 
  else notice $nick access denied
}
on *:TEXT:!dehop*:#: {
  if ($nick isop $chan) {
    if ($readini(rank.ini,$chan,$address($2,2)) == $null) {
      notice $nick $2 is not on the OP list | halt
    }   
    else remini rank.ini $chan $address($2,2)
    notice $nick $2 has been taken off the halfop list 
    mode $chan -h $2
  }
  else notice $nick access denied
}
on *:TEXT:!deop*:#: {
  if ($nick isop $chan) {
    if ($readini(rank.ini,$chan,$address($2,2)) == $null) {
      notice $nick $2 is not on the OP list | halt
    }   
    else remini rank.ini $chan $address($2,2)
    notice $nick $2 has been taken off the OP list
    mode $chan -o $2
  }
  else notice $nick access denied
}

on !*:JOIN:#: {
  /mode $chan +v $nick
  if ($readini(rank.ini,$chan,$address($nick,2)) == op) {
    mode $chan +o $nick
  }
  if ($readini(rank.ini,$chan,$address($nick,2)) == halfop) {
    mode $chan +h $nick
  }
else mode $chan +v $nick
}

Comments

Sign in to comment.
napa182   -  Jun 12, 2009

Driedman Said:

there is no need for all of that ,just use this

on @*:join:#<channel> (
mode $chan +h $nick(or the actual nick if it is just one particular person)
}
}

well for one you miss the point of this script an two if you are going to offer help at lest make a working code =/

 Respond  
Driedman   -  Jun 12, 2009

there is no need for all of that ,just use this

on @*:join:# (
mode $chan +h $nick(or the actual nick if it is just one particular person)
}
}

 Respond  
WorldDMT   -  May 31, 2009

hi

/mode $chan +v $nick
and
else mode $chan +v $nick??????

no need for all that "halt"

for on join event $address($nick,2) = $wildsite

u can use a local alias for no repetition

your code can be shorter and with 35 lines not 54 lines
like that

alias -l wcomd {
  tokenize 32 $strip($1-)
  if ($2 isop $1) {
    if ($4) && ($4 ison $1) {
      if ($istok(!op.!hop,$3,46)) {
        var %cmd $replace($3,!op,op,!hop,halfop),%x $iif(%cmd == op,halfop,op)
        if ($readini(rank.ini,$1,$address($4,2)) == %cmd) {
          notice $2 $4 is currently on the $v1 list, please remove $4 from the $v1 list before you add them to the %x list.
        }
        else writeini rank.ini $1 $address($4,2) %x
        notice $2 $4 has been added to the %x list
      }
      elseif ($istok(!deop.!dehop,$3,46)) {
        var %cmd $replace($3,!deop,op,!dehop,halfop),%x $iif(%cmd == op,halfop,op)
        if !$readini(rank.ini,$1,$address($4,2)) {
          notice $2 $4 is not on the %cmd list
        }
        else remini rank.ini $1 $address($4,2)
        notice $2 $4 has been taken off the %x list
      }
      var %mode $replace($3,!op,+o,!deop,-o,!hop,+h,dehop,-h)
      mode $1 %mode $4
    }
    else notice $2 syntaxe: !<cmd> <nick> e.g: !op Bamboo
  }
  else notice $2 access denied
}
on *:TEXT:*:#:if ($istok(!op.!hop.!deop.!dehop,$strip($1),46)) wcomd # $nick $1-
on !*:JOIN:#:{
  if ($istok(op.halfop,$readini(rank.ini,$chan,$wildsite),46)) {
    var %mode $replace($readini(rank.ini,$chan,$wildsite),op,+o,halfop,+h)
    mode # %mode $nick
  }
  else mode # +v $nick
}
 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.