mIRC Home    About    Download    Register    News    Help

Print Thread
Auto connect to multiple servers and perform... #211648 27/04/09 08:06 AM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Hi everyone, can anyone please help me make mirc auto connect to multiple servers when it starts? Over 10 servers frown

And then I need to perform various commands, the problem is the timing, there has to be some waiting time before each command, for example:

/nickserv identify "password"
/msg "nickname" enter #channel", #"channel", #"channel"
/join #"channel", #"channel", #"channel"...

The problem here is that I need mirc to wait between each command. The server only allows me to send a message to the invite bot after I identify my nickname. And I also need to wait for the bot to allow me to enter before I /join

Hope I was clear about what I need

Thanks for reading this and for the help.

Last edited by I_Love_Mirc; 27/04/09 08:44 AM.
Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211650 27/04/09 10:19 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
A quick search on the forum gave me this


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Auto connect to multiple servers and perform... [Re: sparta] #211651 27/04/09 11:51 AM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Thanks. I still need mirc to identify my nicname, WAIT, send message to invite bot, WAIT, join channels

lot's of stuff, in lot's of servers eheh

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211674 28/04/09 10:00 AM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
How do I make mirc wait in the perform on connect option?

/nickserv identify "password"
*WAITING TIME*
/msg "nickname" enter #channel", #"channel", #"channel"
*WAITING TIME*
/join #"channel", #"channel", #"channel"...

Thanks!

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211675 28/04/09 10:26 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can use timers (/help /timer) if you want to wait a specified amount of time, but it's usually better to use remote events (such as on NOTICE and on INVITE) to decide when to perform actions.

Re: Auto connect to multiple servers and perform... [Re: Collective] #211676 28/04/09 12:29 PM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Hi collective, thanks for the reply.

I use mirc "perform on connect options"

one of the server has:

/nickserv identify
/msg drone enter #...
/join #...

So what do I need to add in mirc "perform on connect"? Sorry I don't know anything about scripts and programming.

Just need mirc to wait a little before sending the next command, thanks!

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211677 28/04/09 12:40 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/nickserv identify
/.timer 1 5 /msg drone enter #...
/.timer 1 10 /join #...

Re: Auto connect to multiple servers and perform... [Re: Collective] #211678 28/04/09 12:53 PM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Thanks again collective

/.timer with the "."?

And what's the "1", "5" and "10" please?

Thanks

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211679 28/04/09 01:53 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
The . hides the default output of the /timer command which informs you when a timer starts and ends. The numbers are explained in the help file entry I pointed you to earlier: 1 is the number of repetitions (how many times the command should be executed) and 5 and 10 are delays in seconds.

Re: Auto connect to multiple servers and perform... [Re: Collective] #211680 28/04/09 03:07 PM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Thank you! smile

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211682 28/04/09 04:54 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I do all of this manually. I dont use mirc features. Here is an idea I developed to connect to many different servers on start.

Basically I set a variable with a value of the server's name IM connecting to. Then it connects. No server will connect unless the variable is the server name. Instead. it sets a short timer to perform the connect alias for that specific server. It will keep doing this until the variable is unset meaning it is clear to connect to a server.

I didnt do this for the flood as much as for the validity of data per connection.

Lets say I have 3 servers.

1. server1
2. server2
3. server3

On start I send a signal that tells all servers to connect.

In the connect alias for each server it then checks for a variable. If it doesn't exist it sets it to be the server name. Now, any of the other connections wont connect until this one is finished. Once I am successfully connected to the server, it will unset the variable.

Now server2 or server3 is checking every second or two to see if the variable is unset. Once it is they will connect to their server the same way as above.

As for auth and such, I just have a regular event with a network or server halt. No worries about flooding out. It will only get its information from its server (or network) and auth with the info you provided.

Here is the basic idea. And for the mirc forum hater, I dont care if you think your code or style is better and you think mine is crap. Get a life. smile

Code:
on *:start:{
;on start, if master autoconnrct is on 
;send signal to all networks to connect.

if ($hget(master,autoconnect)) .timerac_ 1 1 .signal ac connect

}


;each network has this in their own file.

on *:signal:ac:{
;if 1 is connect and network is in auto connect list...
  if ($1 = connect) && (network_id isin $hget(master,ac)) {
;if variable doesnt exist, name it after the network_id.
    if (!%con_c) { set -u5 %nXs_c network_id }
    net_c
  }

alias net_c {
  if (%con_c) && (%con_c != network_id) { .timernXs_c_net_id 1 1 /net_c $1- | return }
  else { set -u5 %nXs_c network_id }
  
;;This is where i set up my auth info and connect to the server.

}


Now you can use a raw event or the on connect event to unset the variable. All mirc needs to know is that THAT server has concluded the process of connecting so the next one can begin. While server2 is connecting you will be receiving information from any other server that is connected which is why you will need to use network halts to direct information.

Good luck!

Re: Auto connect to multiple servers and perform... [Re: DJ_Sol] #211684 28/04/09 05:31 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
/me mutters "exceptionally useful for the OP, regarding the fact he's obviously using the /timer command his very first time..." whistle

Re: Auto connect to multiple servers and perform... [Re: Collective] #211694 28/04/09 08:12 PM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Originally Posted By: Collective
The . hides the default output of the /timer command which informs you when a timer starts and ends. The numbers are explained in the help file entry I pointed you to earlier: 1 is the number of repetitions (how many times the command should be executed) and 5 and 10 are delays in seconds.


Sorry the timer doesn't work when i connect to the other servers, I get:

* /timer: timer 1 not active

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211695 28/04/09 08:25 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I think your timer is missing one or more requred parameters. The required parameters for a valid timer are:
Code:
timer <repetitions> <interval/delay> <command>

Example:
Code:
/timer 1 3 echo -a hi
That's a valid timer: it executes once, after 3 seconds. On execution, it will echo the word "hi" to the active window.

And these will all produce the error message you get - because at least one parameter is missing:
Code:
/timer 1 3 
/timer 1 
/timer echo -a hi
/timer 1 echo -a hi

If you have problems in finding the error, show us your current code. smile

Re: Auto connect to multiple servers and perform... [Re: Collective] #211696 28/04/09 09:07 PM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
As I said, I don't know anything about programming or mirc scrips, I was just using this in the servers perform on connect

Originally Posted By: Collective
/nickserv identify
/.timer 1 5 /msg drone enter #...
/.timer 1 10 /join #...


it doesn't work in the other servers, do I need diffrent timmers?


thanks

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211706 28/04/09 11:30 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You can have a perform apply to all networks / a specific network / ... Did you set up different performs for the different networks (maybe with different nick passwords etc)? What in detail is (or is not) happening after you connect?
I rarley use 'perform', but, testing simulateneous connects to different networks, I'm not able to reproduce a problem related to timer,. They all worked like expected.
For further debugging you could prefix all your commands with "echo -s". Instead of executing the command, mIRC will thereby display the command in the respective status window, so you'll be able to see which command would be fired where and when.
Example:
Code:
ECHO -s DEBUG: nickserv identify
.timer 1 5 ECHO -s DEBUG: msg drone enter #...
.timer 1 10 ECHO -s DEBUG: join #...

Re: Auto connect to multiple servers and perform... [Re: Horstl] #211720 29/04/09 07:37 AM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Hi Horstl thanks for your help

As I said, the timmers aren't working! Mirc doesn't stop before sending the next command

And I get this in the status window: "* /timer: timer 1 not active"

For example:

[08:32] -NickServ- This nickname is registered and protected. If it is your
-
[08:32] -NickServ- nick, type /msg NickServ IDENTIFY password. Otherwise,
-
[08:32] -NickServ- please choose a different nick.
-
[08:32] -NickServ- If you do not change within one minute, I will change your nick.
-
* /timer: timer 1 not active
-
[08:32] -> *NICKNAME* invite
-
* /timer: timer 1 not active
-
You must identify to a registered nick to private message NICKNAME
-
You need a registered nick to join that channel.
-
[08:32] * services.NETWORK.net sets mode: +r
-
[08:32] -NickServ- Password accepted - you are now recognized.

This what I have in Perform and connect:

/nickserv identify PASSWORD
/.timer 1 5
/msg NICKNAME invite
/.timer 1 5
/join #CHANNEL

Why isn't it working? Thanks again!

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211721 29/04/09 07:49 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
It isn't working because you added newlines that shouldn't be there.

Re: Auto connect to multiple servers and perform... [Re: I_Love_Mirc] #211722 29/04/09 08:01 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
nickserv identify PASSWORD
.timer 1 5 msg NICKNAME invite
.timer 1 5 join #CHANNEL

Replace NICKNAME and #CHANNEL with the one's that should be there, just just copy and paste the lines.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Auto connect to multiple servers and perform... [Re: sparta] #211725 29/04/09 10:43 AM
Joined: Feb 2009
Posts: 23
I
I_Love_Mirc Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Feb 2009
Posts: 23
Thanks!