Auto Connect to Your Server

By Protheus on Dec 12, 2011

Screenshots

On startup, it will ask you for the name/ip addy of your server or your favorite server. Everytime you start mIRC thereafter, it will ask if you would like to connect to that particular server. I thought it was pretty neat...

#aconyserv off

alias aconyserv {
  if ($dialog(aconyserv)) { dialog -x aconyserv }
  dialog -m aconyserv aconyserv
}

dialog aconyserv {
  title "Auto Connect to Your Server"
  size -1 -1 125 50
  option dbu
}

on *:dialog:aconyserv:init:*: {
  dcx Mark $dname aconyserv_cb
  $blk
  if (!%your.server) {
  set %your.server $$?="Enter server IP Address:" }
  $xdc 1 text 4 4 250 20 transparent
  xdid -t $dname 1 0,1Would you like to connect to %your.server $+ ?
  $xdc 2 button 25 68 82 26
  xdid -t $dname 2 Yes
  $xdc 3 button 144 68 82 26
  xdid -t $dname 3 No
}

alias aconyserv_cb {
  if ($2 == sclick) && ($3 == 2) {
    server %your.server 
    dialog -x aconyserv
  }
  elseif ($2 == sclick) && ($3 == 3) {
    dialog -x aconyserv
  }
}

on 1:START: {
  aconyserv
}

#aconyserv end

menu channel,status {
  .Aconyserv
  ..On: .enable #aconyserv | echo -a AutoConnect2UrServer on
  ..Off: .disable #aconyserv | echo -a AutoConnect2UrServer off
}

Comments

Sign in to comment.
Protheus   -  Dec 12, 2011

Thank you sir. Much appreciated.

 Respond  
Jethro   -  Dec 12, 2011

Just a friendly suggestion to make these bits less redundant:

alias aconyserv {
if ($dialog(aconyserv)) { dialog -x aconyserv }
dialog -m aconyserv aconyserv
}

alias aconyserv {
  dialog $iif($dialog(aconyserv),-v,-md) aconyserv aconyserv
}

alias aconyserv_cb {
if ($2 == sclick) && ($3 == 2) {
server %your.server
dialog -x aconyserv
}
elseif ($2 == sclick) && ($3 == 3) {
dialog -x aconyserv
}
}

alias aconyserv_cb {
  if ($2 == sclick) {
    if ($3 == 2) {
      server %your.server 
      dialog -x aconyserv
    }
    elseif ($3 == 3) {
      dialog -x aconyserv
    }
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.