On connect

From Scriptwiki
Jump to: navigation, search

on CONNECT

The on CONNECT event triggers when mIRC connects to an IRC Server right after the MOTD is displayed.

on <level>:CONNECT:<commands>

On connect event is most commonly used to perform commands right after joining a server, such as automaticly joining channels or authenticate with Q bot.

on *:connect:{
  if ($network === QuakeNet) && ($right($server, 13) === .quakenet.org) {
    !var %u = username
    !var %p = password
    !.msg Q@CServe.quakenet.org auth %u %p

    join #help.script
    join #mIRC
  }
}

Please note, that keeping your account secure is up to you, the user, and cannot be achieved by anyone/thing else. So using automaticly authenticating scripts or storing your Q-password to remote file is your own choise and only You. There's always existing security risk. Read Security FAQ at QuakeNet's site for further information.

on CONNECTFAIL

The on CONNECTFAIL event uses the same as above and triggers when a connection attempt (including all retries) has failed. $1- is set to the connect error message.

on *:connectfail:{
  echo -sg Connection failed: $1-
}
Contributed by Tovrleaf

See Also