mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
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 # }
}

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
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.

Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
Thanks to you both, great work. The !!! was just to mark the code that "diden't" work. smile

Joined: Dec 2002
Posts: 483
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
One more thing:

$iif(undernet.org OR quakenet.org isin $server,Channel Info):channel.info

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
$iif(undernet.org isin $server || quakenet.org isin $server,Channel Info):channel.info


Link Copied to Clipboard