Project

General

Profile

Running Commands After Connect

Added by Todd Kirchner about 8 years ago

I'm having some trouble running commands on connect. Here is what I'm doing... I'm trying to connect through a bouncer to get to connected to a final IRC server. What this means is that I have to issue a 'CONN irc.servername.com' to the bouncer in order to get connected. I would like to automate the process so that when I connect to the bouncer, AdiIRC automatically sends the appropriate command and I'm on my way. I thought this would be easy to do by using the custom commands feature on connect. Alas, it only runs that command after I issue the CONN command to the bouncer and I reach my final IRC server. I've tried putting together a script to do it as well, but I am unable to figure out how to get the script to load on startup. Does anyone have experience with this type of setup? I'm at a loss.

Thanks,

Slewfoot


Replies (10)

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

Yeah auto commands is run after the MOTD is received.

on LOGON should do the trick.

on *:LOGON:{
  ; Change 'your.bnc.server.com'
  if ($servertarget == your.bnc.server.com) {
     CONN irc.servername.com
  }
}

RE: Running Commands After Connect - Added by Todd Kirchner about 8 years ago

Ok, but where do I put it? If the auto logon commands happen after the MOTD, it will never run. I've tried it as a script as well, but I can't seem to get any response from any script until I manually load the script. How can I load a script automatically?

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

Yeah you add it as a script in the script editor (ALT + R) and it should execute when you log on to the BNC.

RE: Running Commands After Connect - Added by Todd Kirchner about 8 years ago

Yeah, I did that - it won't execute there. If I copy the code and paste it into the server window, it will run no problem, but putting the code into script1.ini via the script editor, it never runs.

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

Did you put the code in I wrote ? and did you change the "your.bnc.server.com" to match your BNC server name you are connecting?

You can use this code to find the server name if you are unsure.

on *:LOGON:{
  echo -ag $servertarget
}

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

You cannot put an echo outside an event, it needs to be inside something, e.g.

on *:LOGON:{
  echo -s Starting Logon Script

  ; Change 'your.bnc.server.com'
  /echo -s Executing Logon Script
  if ($servertarget == 24.247.248.201) {
    /raw CONN irc.thegeekgroup.org
  }
}

if ($servertarget == XXX) must equal the host name in your serverlist:

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

My bad, there is a missing "*" in the syntax, try:

on *:LOGON:*:{
  echo -s Executing Logon Script
  if ($servertarget == 24.247.248.201) {
    /raw CONN irc.thegeekgroup.org
  }
}

Verified it worked on your BNC, you can lock it again.

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

I edited a little in case you look at the email code.

RE: Running Commands After Connect - Added by Todd Kirchner about 8 years ago

Phew! Thanks!!!

Works great.

RE: Running Commands After Connect - Added by Per Amundsen about 8 years ago

Good to hear, your welcome :>

    (1-10/10)