mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
I use the following alias to join all the channels that I visited in my last session of IRC.

I use a ZNC and as IRC client (mIRC with IRcap).
Sometimes the ZNC disconnected from the IRC network and on reconnect, does not automatically join to all my channels at once, because I 'm in a lot of them and that generate lag.

The code:
Code:
/joinall {
  echo -s  Joining all channels.....
  var %counter = 1
  while (%counter <= $numtok(%recan,44)) {
    if ( $comchan($me,%counter) == $gettok(%recan,%counter,44)) { .timer 1 $calc(%counter + 3) echo -s  you already are in $comchan($me,%counter)
      inc %counter
    }
    else {
      .timer 1 $calc(%counter + 3) .msg chan invite  $gettok(%recan,%counter,44)
      inc %counter
    }
  }

}

Basically, the code works well, but when arriving in a channel that I am not, CHaN(official BoT Network also known as Chanserv) invites me and gives a "permission error". That is what I do not understand bearing in mind that I have got that level permission or even being the founder.
Look what the status window reports:
Quote:
juanam you already are in #channel1
juanam you already are in #channel2
juanam you already are in #channel3
juanam you already are in #channel4
= > CHaN invites you to #channel5 (Double click on the channel to join)
CHaN Permission denied!
= > CHaN invites you to #channel6 (Double click on the channel to join)
- CHaN Permission denied!

Once the process arrives at that point (the error) it does not work anymore. It does not continue with the rest of channels that exists in the variable.
As you see in the copy of the window I pasted, CHaN does not allow me to join in channels 5 and 6 even having the level enough to get in (otherwise the invitation would never arrive).

So the question is: If I have the level enough and the invitation from the bot also arrives why appears this permissions error?
Additional data:
IRC network: irc.chathispano.com
web: www.chathispano.com

I will be grateful if anyone knows the error or network and know how to fix it.
regards

Joined: Jan 2004
Posts: 1,360
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,360
Are you trying to join the channels before identifying to nickserv (or equivalent)?

Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Originally Posted By: Loki12583
Are you trying to join the channels before identifying to nickserv (or equivalent)?

Yes, I am identified with the BoT NiCk previously.

I think I've found the problem.
The code makes my invite channels in what I am , and perhaps to make a massive autoinvite , whatever I cause the error.
Is there another method to compare if I'm in a channel?

Perhaps the fault is here :
Quote:
if ($comchan($me,%counter) == $gettok(%recan,%counter,44))


I have tried to eliminate the "else" and replaced by another "if" but did not work , I still invites channels where I am now, and that happens after the code is that I am not in a channel, invited me to that channel and the loop ("while") continues inviting me to other channels without comparing whether or not I am in them.

Quote:
if ( $comchan($me,%counter) == $gettok(%recan,%counter,44)) { .timer 1 $calc(%counter + 3) echo -s you already are in $comchan($me,%counter)
inc %counter
}
if ( $comchan($me,%counter) != $gettok(%recan,%counter,44)) { .timer 1 $calc(%counter + 3) .msg chan invite $gettok(%recan,%counter,44)
inc %counter
}


Can it be that the fault is in this comparison ?
It does not work with "else" or with an "if" negative.

Will $comchan($me,%counter) that does not compare well ?


Link Copied to Clipboard