mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2004
Posts: 8
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Apr 2004
Posts: 8
Hello, when I launch mIRC I want it to automatically join three different servers and some channels on those server. I wrote the following simple testscript:
[script]
n0=
n1=on *:start:
n2={
n3= server irc.efnet.nl
n4=}
n5=on *:connect:
n6={
n7= if( $network == EFNet )
n8= {
n9= join #duh
n10= }
n11=}

I've installed mIRC 6.17 with default settings so that none of my old settings/scripts interfere. The [rfiles]-section of my mirc.ini looks like this:
[rfiles]
n0=remote.ini
n1=remote.ini
n2=mirc.ini
n3=testscript.ini

But on launch, mIRC doesn't try to connect to the EFNet-server. And if I connect to an EFNet-server manually it doesn't join the channel it's supposed to. What do I need to do to fix this?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You need to fix your spacing and { }:

n1=on *:start:{
n2= server irc.efnet.nl
n3=}
n4=on *:connect:{
n5= if ( $network == EFNet ) {
n6= join #duh
n7= }
n8=}

The { should be on the same line as the on connect. Same for the if statement.

As for spacing, the ( shouldn't be touching the if. if ( if(

Hope this helps.

Joined: Apr 2004
Posts: 8
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Apr 2004
Posts: 8
Thanks for your quick reply. I'm a C++ programmer by trade and I mindlessly used the rules C++ for placing (, ), {, and }. Now it works fine. But I have one more question. If I join a particular network, I need to identify myself by messaging a nickserv before I can join a specific channel. The problem is that I need some sort of delay before I try to join the channel so the identification part has had a chance to complete. How do I do that?

Joined: Apr 2004
Posts: 8
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Apr 2004
Posts: 8
I solved it by using a timer that runs once:
timer1 1 1 join #desiredchannel
This way there is a slight delay before an attempt to join is made and that's enough for nick identification to complete and the join to be successful. Other ways to solve it are welcome, I like to see different approaches.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You should be able to use the timer for that. On a side note, in your example, you're using a named timer called 1. I, personally, don't like using numbers for timers, as the timer command, used without a name, defaults to a number the increases by a count of 1 until a timer that has already been set ends.
Eg. /timer 1 3 echo Hi -> starts timer number 1
/timer 1 6 echo Bye -> starts timer number 2

Now, if at 4 seconds you start another timer, then that 3rd timer will be called timer number 1, rather than timer number 3, since timer number 1 has already expired.

In regards to your delay, just change the second number in the timer command (which is the delay period) to the number of seconds that you want the command to delay. If you're not sure as to how long a delay you'll need, there might be a way to measure it, but I'm thinking that you'll just have to experiment until you find a setting that works well.


Link Copied to Clipboard