mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#171785 - 01/03/07 03:07 AM I need some simple IRC script help please...
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
Well, it's not simple for me since I have no idea how it supposed to look like but it's probably easy as pie for you guys. I just need some examples to go by. smile

I'm just wondering about a few things:

1) how to make a script so it automatically connects me to a particular server, and join a channel with a specified username.

2) a script to connect me to a new server (without exiting the previous) and with a new/different alias. I need to join a total of 3 or 4 different servers.

3) also, a particular server requires me to login using the following command: /login username password. and make it join a particular channel, again, of course. no need to change nick for this one as it automatically does it for me when I identify.

thanks for any help. smile

Also, how to run the script so I open mIRC and it does everything automatically with a click of a button or so.


Edited by invy (01/03/07 03:08 AM)

Top
#171788 - 01/03/07 04:00 AM Re: I need some simple IRC script help please... [Re: invy]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
There have been several scripts done for multiple connections.

All of your requests can be handled using the /server command.

You should read through the help file in the following areas:
/server
on connect
on start

There have been several requests like yours, and scripts have been written to do what you're asking for.

Top
#171799 - 01/03/07 06:39 AM Re: I need some simple IRC script help please... [Re: RusselB]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
Sorry about that. I thought this was more advanced and wouldn't have been covered in the FAQ. I got the basic idea of it now, I see that you can enter the scripts in the popups tab menu.

can you direct me to the 3 areas you mentioned? I can't seem to find them in the MIRC FAQ.

Top
#171800 - 01/03/07 07:22 AM Re: I need some simple IRC script help please... [Re: invy]
Kardafol Offline
Fjord artisan

Registered: 08/01/07
Posts: 259
try using '/help' instead of the FAQ. It has all of the mIRC aliases and commands, excluding network commands.
_________________________
Those who can, cannot. Those who cannot, can.

Top
#171802 - 01/03/07 08:35 AM Re: I need some simple IRC script help please... [Re: Kardafol]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
Bingo. Just what I was looking for. Thank you.

Now i'm still having problems. And quite frankly, I don't have the patience for this.

Under what script tab do I work under? I was using the Popups one but that seems kinda awkward. Under Remote maybe, or another one? And how exactly do I run the script when I first open mIRC? I looked through the FAQs and couldn't find info on how to run it.

Can you please give me a example for me to work with? I feel I can learn it better by example rather than trying to sit here for hours trying to make it work. I will outline what I want to do:

1.
-connect to server irc.BLAH.org on port 55000

when I connect to this particular server, it will then ask me to identify with the '/login username password' command. So please tell me how to fit this in the script. I tried it but it just ignored the command. I'm probably doing something wrong here and don't realize what.

- join channel #BLAH.

2.
-open a NEW server window and connect to irc.p2p-irc.net on port 6667

-change my nick to Invy if it's not already.

-join two channels on this server: #utorrent and #sportbit.


That's it. Pretty simple stuff. I mostly need to know how to successfully identify in #1, and how to make the transition to a new server window. From here, I can go by the example and connect to the rest of the servers that I need to connect to. Then i'll be satisified.

I'd appreciate any more help.

Top
#171815 - 01/03/07 02:15 PM Re: I need some simple IRC script help please... [Re: invy]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
All scripts can be done in just the Remotes window. You *can* put aliases in the aliases tab and popups (menus) in the popups tab, but it isn't necessary.

To create a new window, use /server -m irc.server.net ... the -m makes a new window.

To access things in the help file, you'd use stuff like:

/help on connect
/help /server
/help on start

on START will start things when you start mIRC. on CONNECT will do stuff when you connect to a network. Examples are in the help file.

An example is:

Code:
on *:START: {
  server irc.network1.net 6667 -i nick -j #chan,#chan
  server -m irc.network2.net 6667 -i nick -j #chan,#chan
}

on *:CONNECT: {
  if ($network == network1) {
    login password stuff
  }
  elseif ($network == network2) {
    Do something if needed
  }
}
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#171837 - 01/03/07 07:59 PM Re: I need some simple IRC script help please... [Re: Riamus2]
spermis Offline
Babel fish

Registered: 26/02/07
Posts: 91
i think it is easer just to use perform.ini like i have

Top
#171842 - 01/03/07 08:34 PM Re: I need some simple IRC script help please... [Re: spermis]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
The nice thing with not doing that is that you can keep your entire script in a single file rather than spreading it out over multiple files. It also makes it easier to distribute. Distributing with a popups file is troublesome for users.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#171855 - 01/03/07 10:05 PM Re: I need some simple IRC script help please... [Re: Riamus2]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
I tried using perform on connect before, but the problem with that is it only works for servers that are in the server list! The ones I add myself don't show up in it!

How do I get around that? I think perform would be easier.

Top
#171866 - 01/03/07 10:35 PM Re: I need some simple IRC script help please... [Re: invy]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
ugh i'm getting pissed off! no matter what I do it keeps telling me this:

[16:34] -irc.org- *** Looking up your hostname...
-
[16:34] -irc.org- *** Checking Ident
-
[16:34] -irc.org- *** Found your hostname
-
[16:34] -irc.org- *** No Ident response
-
[16:34] -irc.org- *** You didn't specify a password.
-
[16:34] -irc.org- *** Login Failed. Please use /LOGIN <nickname> <password> to gain access.

Top
#171867 - 01/03/07 10:47 PM Re: I need some simple IRC script help please... [Re: invy]
raZOR Offline
Hoopy frood

Registered: 06/04/05
Posts: 1009
Loc: Green Hill Zone
perform (mirc's) only works according to Network name and not server.

to findout your network name, type //echo -a $network
this should show network name (if it has one)

if you connect to server only (that does not belong to network)
perform wont work then, you should do your own scripting then
with ON CONNECT event:

on 1:CONNECT:{
if ($server == your.server.name) { do your login commands }
}
_________________________
IceCapped

Top
#171868 - 01/03/07 11:36 PM Re: I need some simple IRC script help please... [Re: invy]
LonDart Offline
Vogon poet

Registered: 21/07/06
Posts: 107
Loc: Virginia USA
I'd assume that you have to wait until your login is accepted before joining a channel on the restricted network
(which we're calling BLAH), and that the server sends you a notice that your login was successful.
So going by your third post:
Code:
on *:START: {
  server irc.BLAH.org 55000
  server -m irc.p2p-irc.net 6667 -i Invy -j #utorrent,#sportbit
}
on *:CONNECT: {
  if ($network == BLAH) {
    editbox -an /login username password
  }
}
on *:SNOTICE:*response_text_here*:*:join #BLAHchan

Obviously you need to change:
  • irc.BLAH.org
  • BLAH
  • username password
  • response_text_here
  • #BLAHchan
to your values.

Copy the edited script to Windows clipboard.
Open mIRC.
Type ALT+R twice.
On the menu, choose File | New
Paste the edited script. [or paste the original and edit it here.]
On the menu, choose File | Save As...
and name the script something recognizable, e.g. MyConnects.mrc
Click OK.
To test, close and reopen mIRC.

Any problems, post back.
_________________________
LonDart

Top
#171871 - 02/03/07 12:02 AM Re: I need some simple IRC script help please... [Re: LonDart]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
Yes, you are correct, LonDart. I have to wait for the server to prompt me for my login info. Then, I can use the /login username password and it will automatically change my username to what is registered in the db.

Everything seems to work fine, except, i'm just a bit confused on that response_text_here part that you mentioned...

What part of the response text do I type in there? The "You didn't specify a password" or the "Login Failed. Please use /LOGIN <nickname> <password> to gain access." part?

Also, do you have any idea why there is about a 10 second pause between the following two lines or how to fix it?:

[18:02] -irc.BLAH.org- *** Found your hostname
*pauses for about 10 seconds here*
[18:02] -irc.BLAH.org- *** No Ident response
*the rest of server response....*

I really appreciate all the help so far.


Edited by invy (02/03/07 12:06 AM)

Top
#171874 - 02/03/07 12:55 AM Re: I need some simple IRC script help please... [Re: invy]
LonDart Offline
Vogon poet

Registered: 21/07/06
Posts: 107
Loc: Virginia USA
Sorry.

When you login to that server manually, doesn't it give you a message when your login is successful?

For example, when I auth on my network, a bot notices me and I see
Quote:
[timestamp] -bot- Authentication Successful!
so I use
Quote:
on *:NOTICE:*Authenticat*:*: join #mychannel
(I wildcarded it like that to also catch the bot's response of "You have already Authenticated yada yada" )

I was assuming your message would come from the server, so you would use
Code:
on *:SNOTICE:*response_text_here *:*: join #mychannel


Replace *response_text_here* with the message you get when you login successfully.
No point trying to join if it didn't work smile

If SNOTICE doesn't work, try NOTICE.

The ident lag is probably a firewall issue. I'll have to try to find what it was that I did. I know I tried several things before it worked okay.

Re-reading I see you have to wait for a prompt to log in.
So we need to change the
Code:
on *:CONNECT: {
to
Code:
on *:SNOTICE:<exact prompt text here>:*: {

I'm trying to make sense, really I am.


Edited by LonDart (02/03/07 01:03 AM)
_________________________
LonDart

Top
#171876 - 02/03/07 01:08 AM Re: I need some simple IRC script help please... [Re: LonDart]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
Ok... when I successfully identify with the /login username password , I get this:

-
[19:05] * Your nick is now MYNICK
-
[19:05] -irc.org- *** Connecting to MySQL...
-
[19:05] -irc.org- *** Connected to MySQL. Authenticating you...
-
[19:05] -irc.org- *** You have been authenticated!
-
[19:05] -irc.org- *** Spoofing your IP.
-
[19:05] -irc.org- *** You are exempt from idle limits.

[insert LUSERS MOTD and TIME here]

and that's it... so, which one of those lines is the response?

btw, I fixed the no ident response by forwarding the port in my WRT54GL router. no more lag..thanks.


Edited by invy (02/03/07 01:28 AM)

Top
#171879 - 02/03/07 02:12 AM Re: I need some simple IRC script help please... [Re: invy]
LonDart Offline
Vogon poet

Registered: 21/07/06
Posts: 107
Loc: Virginia USA
I would use
Code:
on *:SNOTICE:*You have been authenticated*:*: join #mychannel


Were you able to get the login automated?
Say you see a prompt of "Please log in"
Code:
on *:SNOTICE:*Please log in*:*: {
    editbox -an /login username password
}
ought to work.



Edited by LonDart (02/03/07 02:12 AM)
_________________________
LonDart

Top
#171883 - 02/03/07 02:49 AM Re: I need some simple IRC script help please... [Re: LonDart]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
I still can't get it to login it just says:

[20:48] -irc.BLAH.org- *** You didn't specify a password.
-
[20:48] -irc.BLAH.org- *** Login Failed. Please use /LOGIN <nickname> <password> to gain access.
-

BTW, do you think it's that editbox part that is the problem? There isn't really an edit box...


Edited by invy (02/03/07 02:55 AM)

Top
#171885 - 02/03/07 03:03 AM Re: I need some simple IRC script help please... [Re: invy]
invy Offline
Nutrimatic drinks dispenser

Registered: 01/03/07
Posts: 9
OMG I fixed it! This worked:

on *:START: {
server irc.BLAH.org 50000 MYPASSWORD

}
on *:SNOTICE: {
if ($network == irc.BLAH.org) {
editbox -an /login MYNAME MYPASSWORD
}
}
on *:SNOTICE:*you have been**: /join #CHANNEL

So yeah, apparently my password needs to be after the PORT NUMBER.

Is that middle 'SNOTICE' part redundant, do you think? Also, I deleted all the { and } brackets and it worked fine without them.... it makes everything look complicated.

Thanks for all the help! ^_^


Edited by invy (02/03/07 03:13 AM)

Top
#171887 - 02/03/07 03:53 AM Re: I need some simple IRC script help please... [Re: invy]
LonDart Offline
Vogon poet

Registered: 21/07/06
Posts: 107
Loc: Virginia USA
Yeah. If sending your password with the server command works, you can
trash that first on SERVER (the one with the editbox line).

If you add more servers to the on START, remember to use
/server -m etc. etc.
to keep from closing the other server connections.

Glad you got it working smile
_________________________
LonDart

Top
#171905 - 02/03/07 02:01 PM Re: I need some simple IRC script help please... [Re: invy]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
The first SNOTICE section is invalid anyhow. Just remove it. You cannot remove {}'s without problems unless everything in the event is on a single line. And that can make it difficult for people to help fix problems later because it's harder to read.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
Page 1 of 2 1 2 >