mIRC Homepage
How to make on quit to figure out wich channel i need to hop?

Code:
on 1:part:#:{
  if ($nick($chan,0) = 2) && ($nick != $me) && ($me !isop $chan) { hop -c $chan }
}

on 1:quit:{
  if !!!($nick(#,0) = 2) && ($nick != $me) && ($me !isop #)!!! { hop -c # }
}
Code:
on !*:quit:{
  var %a = $comchan($nick,0) ,%b = $!comchan($nick,%a)
  while (%a) {
    if ($nick($(%b,2),0) == 2) && ($me !isop $(%b,2)) hop -c $v2
    dec %a
  }
}
Originally Posted By: Deep3D
on 1:quit:{
if !!!($nick(#,0) = 2) && ($nick != $me) && ($me !isop #)!!! { hop -c # }
}


What does adding the triple !!! do?

Do you think it is anything significant?

Code:
on !*:part:#: { 
  if ($nick($chan,0) > 2) { /halt }
  else {
    if (r isin $chan($chan).mode) {
      if ($me isreg $chan) { 
        /hop $chan | /mode $chan $+(+v,$iif(% isin $prefix,h $me)) $me
      } 
    }
    elseif (r !isin $chan($chan).mode) {
      if (($me isreg $chan) || ($me isvoice $chan)) && ($me !isop !chan) {
        /hop $chan | /mode $chan $+(+v,$iif(% isin $prefix,h $me)) $me
      }
    } 
  }
}

on !*:quit: { 
  var %i = 1 
  while ($comchan($nick,%i)) { 
    if ($nick($comchan($nick,%i),0) > 2) { /halt }
    else {
      if (r !isincs $chan($comchan($nick,%i)).mode) {
        if ($me !isop $comchan($nick,%i)) {
          /hop -c $comchan($nick,%i) | /mode $comchan($nick,%i) $+(+v,$iif(% isin $prefix,h $me)) $me 
        }
      } 
      elseif (r isincs $chan($comchan($nick,%i)).mode) {
        if ($me isreg $comchan($nick,%i)) {
          /hop -c $comchan($nick,%i)) | /mode $comchan($nick,%i) $+(+v,$iif(% isin $prefix,h $me)) $me
        }
      }
      inc %i 
    } 
    /unset %i 
  } 
}


What this does is for a registered (+r) channel, ChanServ will -o the 1st person who joins that is not AOp or SOp (as well as -h). But not -v.

So a +v will not /hop in a +r channel since that's technically the highest it could ever go.

And then if the channel isn't registered... like Efnet... well then, just as long as it ain't op it will /hop.

*Sigh*

-Neal.
Thanks to you both, great work. The !!! was just to mark the code that "diden't" work. smile
One more thing:

$iif(undernet.org OR quakenet.org isin $server,Channel Info):channel.info
Code:
$iif(undernet.org isin $server || quakenet.org isin $server,Channel Info):channel.info
© mIRC Discussion Forums