mIRC Homepage
Posted By: THE_ADZ Auto half-opping - 28/12/06 05:19 PM
I want to automatically half op people on my channel. How do I do this?
Is there a button for it. If not, can I create one and how?
Posted By: THE_ADZ Re: Auto half-opping - 28/12/06 05:21 PM
oh yeah, and also is there an alternative to typing /mode #channel +h Nick. It is really long and I don't really have a lot of time to type it for every single member of my channel
Posted By: Riamus2 Re: Auto half-opping - 28/12/06 05:47 PM
You can do it various ways. If you want to halfop everyone when they join, you can press Alt-R > File > New and use this:

Code:
on @*:join:#yourchannel: {
  mode $chan +h $nick
}


As long as you are opped, you will halfop everyone who joins.

You can also set it to halfop everyone in the channel (who isn't already halfop or higher) with:

Code:
menu channel {
  Half-Op Everyone:if ($me isop $chan) { halfopall $chan } | else echo -a You're not an op. }
}

alias halfopall {
  var %cnt = 1
  var %total = $nick($chan,0,rv,o)
  while (%cnt <= %total) {
    var %halfops %halfops $nick($chan,%cnt,rv,o)
    if ($gettok(%halfops,0,32) == 6) {
      mode $1 +hhhhhh %halfops
      unset %halfops
    }
    inc %cnt
  }
  if (%halfops) {
    mode $1 + $+ $str(h,$gettok(%halfops,0,32)) %halfops
  }
}

That will be in the channel's right click menu.

Also, if you want an easy command to halfop someone from the edit line, you can also add this to the script:

Code:
alias h {
  if ($chan && $1 isin $chan) {
    if ($me !isop $chan) { echo -a You're not an op in this channel. | return }
    mode $chan +h $1
  }
}


To use that, just type this in the channel:
/h nick
Posted By: THE_ADZ Re: Auto half-opping - 28/12/06 05:59 PM
THANK YOU!
It took me around 10 mins but I figured it out
smile
Thanks again for your help
Posted By: THE_ADZ Re: Auto half-opping - 28/12/06 07:46 PM
ok new problem. I made this code:

on Rock@*:join:#avatarrp: {
mode #avatarrp +h Rock
}

on sissha11@*:join:#avatarrp: {
mode #avatarrp +h sisha11
}

on Zukos_One_Love@*:join:#avatarrp: {
mode #avatarrp +h Zukos_One_Love
}

and for some reason it is not half opping anyone
Any suggestions?
Posted By: landonsandor Re: Auto half-opping - 28/12/06 10:13 PM
It has been suggested that HOP (among other modes) should be added to the address book list. I think this would be a lovely addition myself and would have made your issue go away much faster smile Perhaps you should find a thread that has it and (if you want) put your agreement on it. While we never know what options will get added or when, it's possible that our reactions can sway a decision.
Posted By: cold Re: Auto half-opping - 28/12/06 11:33 PM
To Riamus2:
You have this in /h...
Code:
if ($chan && $1 isin $chan) {


...when the correct code is below:
Code:
if ($1 ison $chan) {



To THE_ADZ:
Well, do you have Rock, sissha11 and Zukos_One_Love in your user list? In case you have, the correct syntax is this:
Code:
on @Rock:join:#avatarrp:{ ... }
on @sissha11:join:#avatarrp:{ ... }
on @Zukos_One_Love:join:#avatarrp:{ ... }


In case you thought you were dealing with their nicks instead of their entries in the user list, this is an working code:
Code:
on @*:join:#avatarrp:{
  if ($istok(Rock sissha11 Zukos_One_Love,$nick,32)) { mode # +h $nick }
}
Posted By: Riamus2 Re: Auto half-opping - 29/12/06 04:57 AM
Originally Posted By: cold
To Riamus2:
You have this in /h...
Code:
if ($chan && $1 isin $chan) {


...when the correct code is below:
Code:
if ($1 ison $chan) {



Thanks. I always mix up ison and isin. I always think of being IN a channel rather than ON a channel. smile
Posted By: cold Re: Auto half-opping - 29/12/06 06:24 AM
Quote:
Thanks. I always mix up ison and isin. I always think of being IN a channel rather than ON a channel. smile


Which makes sense to me, hehe. I always mix them up as well...
© mIRC Discussion Forums