mIRC Homepage
Posted By: lilleman Perform action on join? - 07/02/05 10:36 PM
Hi,

If this is the wrong forum for my post, I apologize. Now to my question. I've never made any scripts before, so I don't even know if this is possible. What I want to do is that when I join a specific channel, a script is executed (it's for an idle RPG game; I'm getting disconnected from time to time (I think it's due to my connection), and what I want is a script that would automatically log me in (which is done with /msg idle login username password)). Is this possible?

Thanks in advance.
Posted By: Mentality Re: Perform action on join? - 07/02/05 10:42 PM
Sure is smile I personally use the following:

on me:*:join:#idlerpg:{
.msg idlerpg login username password
}


If you join multiple networks, and only want this to be activated when you join #idlerpg on one specific network, use this:

on me:*:join:#idlerpg:{
if ($network == Network) {
.msg idlerpg login username password
}
}


(Assuming #idlerpg is the name of the channel, otherwise replace it with something else). Replace 'Network' with the network name (e.g. DALnet, EFnet, Undernet, etc.), and replace 'username' and 'password' with your username and pass smile

This code would go in your Remote section of the Script Editor, press ALT+R to access it. If you see a file with code already in it when you open that dialog, make sure you start a new file, with File > New.

For further information, see /help ON JOIN.

Regards,
Posted By: lilleman Re: Perform action on join? - 07/02/05 11:31 PM
It worked like a charm. Thank you!
Posted By: lilleman Re: Perform action on join? - 07/02/05 11:36 PM
I just came to think of another thing. How do you join specific channels when you connect to a specific network? Let us assume that I want to connect to irc.domain.com, and automatically join the channels #foo and #bar. How would I do that?
Posted By: tidy_trax Re: Perform action on join? - 07/02/05 11:38 PM
Code:
on *:connect:{
  if ($network == network1) { join #chan1,#chan2,#etc }
  elseif ($network == network2) { join #chan1,#chan2,#etc }
}
Posted By: Relinsquish Re: Perform action on join? - 07/02/05 11:39 PM
Put this into your remotes section of your scripts editor:

Code:
On *:CONNECT: {
  If ($Server == irc.domain.com) { join #foo,#bar }
}
Posted By: lilleman Re: Perform action on join? - 08/02/05 12:13 AM
Thanks guys, that worked perfectly.
© mIRC Discussion Forums