|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
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.
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Mar 2006
Posts: 47
Ameglian cow
|
Ameglian cow
Joined: Mar 2006
Posts: 47 |
Does this work? /var %chans = $readini(system\aj\autojoin.ini,$network,channel)
while ($numtok(%chans,44) > 0) {
/join $gettok(%chans,1,44)
%chans = $deltok(%chans,1,44)
}
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
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.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Jul 2007
Posts: 19
Pikka bird
|
Pikka bird
Joined: Jul 2007
Posts: 19 |
*EDIT* Or those posts work :P
Last edited by Old; 10/07/07 06:53 PM.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
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. alias autojoin {
var %chanstring = $readini(system\aj\autojoin.ini,$network,channel), %nr = 1
while ($gettok(%chanstring,%nr,44)) {
join $ifmatch
inc %nr
}
}
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
OP
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
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
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
|