mIRC Homepage
Posted By: piertiong Hop when channel empty - 07/01/03 09:32 AM
on *:part:#:{
if ($nick(#,0) = 2) && ($nick != $me) && ($me !isop $chan) {
set %rejoin.topic $chan($chan).topic
hop -cn #
mode # +nt
topic $chan %rejoin.topic
unset %rejoin.topic
}
}

That worked for one time, but now it doesn't work when the last person other than me got disconnected due to ping timeout and the channel did not have any topic. confused
Posted By: Dingo Re: Hop when channel empty - 07/01/03 10:08 AM
your script checks to see if you are not oped, and hops. if you are an op, it wont hop.

if you want to hop regardless of if you are oped or not, remove the
&& ($me !isop $chan)
Code:
on *:part:#:{ 
if ($nick(#,0) = 2) && ($nick != $me)  { 

then it should do what you want
Posted By: Nimue Re: Hop when channel empty - 07/01/03 10:24 AM
That script triggers 'on part', not 'on quit'.
Code:
on *!:part:#:{
  if ($nick(#,0) == 2) && ($me !isop #) {
    var %topic = $chan(#).topic
    hop -cn #
    mode # +nt
    if (%topic) topic # %topic
  }
}
on *!:quit:{
  var %i = 1
  while ($chan(%i)) {
    var %c = $ifmatch
    if ($nick(%c,0) == 2) && ($me !isop %c) {
      var %topic = $chan(%c).topic
      hop -cn %c
      mode %c +nt
      if (%topic) topic %c %topic
    }
    inc %i
  }
}
"on *!:..." means NOT me, so there is no need for an "if ($nick != $me) check smile
Posted By: piertiong Re: Hop when channel empty - 07/01/03 11:06 AM
when only 2 persons are in a channel, and i'm one of them, and the other guy has got operator status.

he voices me, and the script keeps making me hop the channel. confused
Posted By: piertiong Re: Hop when channel empty - 07/01/03 01:40 PM
up
Posted By: Collective Re: Hop when channel empty - 07/01/03 01:43 PM
Please don't spam, it just annoys people.
Posted By: Nimue Re: Hop when channel empty - 07/01/03 02:02 PM
OK Sorry, I used a wrong identifier, try it this way
Code:
on *!:quit:{
  updatenl
  var %i = 1
  while ($comchan($nick,%i)) {
    var %c = $ifmatch
    if ($nick(%c,0) == 1) && ($me !isop %c) {
      var %topic = $chan(%c).topic
      hop -cn %c
      mode %c +nt
      if (%topic) topic %c %topic
    }
    inc %i
  }
}
BTW. It isn't good to edit your posts like that, I had already read that post (where you said it worked), if Collective didn't post I would not have seen the changes at all :tongue:
Posted By: piertiong Re: Hop when channel empty - 08/01/03 12:03 PM
sorry dude. smile
© mIRC Discussion Forums