mIRC Home    About    Download    Register    News    Help

Print Thread
#180517 10/07/07 06:39 PM
Joined: Feb 2003
Posts: 3,412
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
I use this in my script.

join $readini(system\aj\autojoin.ini,$network,channel)

that working just fine as long as i dont add any key to the channel. the ini looks like this:

[NETWORK]
channel=#open,#keyed key

if i do: //echo -> $readini(system\aj\autojoin.ini,$network,channel)

it return:
-> #open,#keyed key

so long everything working as it should, you see the key in the echoed line, but when i try to make it join the channel with the key, then the server tells me i need the key, how ever the key is there, if i change the line so it looks like:

[NETWORK]
channel=#keyed key,#open

then it join the keyed channel, but not #open , the space in the file cosing the script to halt for some reason. I have been testing the code, been looking in debug, and what i can see the key and the other channel is sent to the server:

-> irc.server.org JOIN #keyed key,#open

but it wont join #open , i asked in a irc channel, but i didnt understand what they said so i need someone to explain to me how i can solve this.

Need to add:
if none of the channels have a key, then it working as it supposed to:

[NETWORK]
channel=#open1,#open

it joins #open1 and #open

so it must have to do with the space between the channel and the key, been trying to solve this for 3 hours now, still no luck with it. need help, and if possible a good explanation to how i can fix it.

sparta #180518 10/07/07 06:49 PM
C
CitizenKane
CitizenKane
C
Does this work?
Code:
/var %chans = $readini(system\aj\autojoin.ini,$network,channel)
while ($numtok(%chans,44) > 0) {
  /join $gettok(%chans,1,44)
  %chans = $deltok(%chans,1,44)
}

sparta #180519 10/07/07 06:50 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
The problem is that the format for joining multiple channels, some of them containing keys, is like:

/join #chan1,#chan2,#chan3,#chan4 key1,key2,key3,key4

If for example chans 3 and 4 don't have keys, the format would be:

/join #chan1,#chan2,#chan3,#chan4 key1,,,key4

So what you can do is extract the channels with their keys from $readini() and rearrange them into the above format, storing the result in a %var, then call /join %var. Alternatively, you can change the way you store channels in the .ini. Token identifiers will probably help you a lot in achieving either.

sparta #180520 10/07/07 06:52 PM
O
Old
Old
O
*EDIT* Or those posts work :P

Last edited by Old; 10/07/07 06:53 PM.
sparta #180522 10/07/07 06:59 PM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
At least on unreal ircd, "/helpop join" replies:
Syntax: JOIN <chan>,<chan2>,<chan3> <key1>,<key2>,<key3>

So the problem seems to be that you try to use a syntax
JOIN <chan1> <key1>,<chan2>
or
JOIN <chan1>,<chan2> <key1> (mean: you provide the key for chan2, but the ircd thinks you are sending the key for chan1)

You could solve this problem by loopig the parts of the $readini return.
Code:
alias autojoin {
  var %chanstring = $readini(system\aj\autojoin.ini,$network,channel), %nr = 1
  while ($gettok(%chanstring,%nr,44)) { 
    join $ifmatch
    inc %nr
  }
}


Horstl #180525 10/07/07 07:18 PM
Joined: Feb 2003
Posts: 3,412
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
thnx, CitizenKane. your code worked, same with Horstl, i will try understand what the code does and how it sends the output on /join #channel key . have been looking for a tutorial on the net that explained this, but couldent find any. maybe something to do for the one that have time and know how it works wink


Link Copied to Clipboard