mIRC Home    About    Download    Register    News    Help

Print Thread
#52423 03/10/03 05:10 PM
Joined: Oct 2003
Posts: 9
B
Burchov Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Oct 2003
Posts: 9
I have a script that displays a dialog with a list of servers when I boot mIRC. There I can select what servers I want to connect to, but I also want to be able to select what commands should be executed when connected to a specific server. The on CONNECT does exactly that, I know, but is it possible to enter the commands in the dialog, instead of using the on CONNECT event? " /server irc.blah.com -j #channel " joins a channel on that server when connected, but I want it to execute commands instead of joining a single channel.

TiA

#52424 03/10/03 05:57 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
See if this doesnt give you any ideas laugh

Code:
dialog new_table {
  title "New Project"
  size -1 -1 120 185
  option dbu
  list 1, 5 5 110 70, size
  list 2, 5 90 110 70, size
  text "Perform Following Commands:", 3, 5 80 110 8
  edit "", 4, 5 160 90 10
  button "Add", 5, 95 160 20 10
  button "Connect", 6, 35 172 45 10
}

on 1:DIALOG:new_table:INIT:*: {
  var %s = 1
  while ($server(%s)) {
    /did $iif(%s == 1, -ca, -a) $dname 1 $server(%s)
    /inc %s
  }
  /did -t $dname 5
}

on 1:DIALOG:new_table:DCLICK:1: {
  /server -m $did($dname, 1).seltext
  var %l = 1
  while ($did($dname, 2, %l) != $null) {
    / [ $+ [ $ifmatch ] ]
    /inc %l
  }
}

on 1:DIALOG:new_table:DCLICK:2: {
  /did -d $dname 2 $did($dname, 2).sel
}

on 1:DIALOG:new_table:SCLICK:5: {
  if ($did($dname, 4) != $null) /did -a $dname 2 $ifmatch
  /did -r $dname 4
}

on 1:DIALOG:new_Table:SCLICk:6: {
  /server -m $did($dname, 1).seltext
  var %l = 1
  while ($did($dname, 2, %l) != $null) {
    / [ $+ [ $ifmatch ] ]
    /inc %l
  }
}

Enter it into soemthing like wordpad when u paste first, then copy from wordpad to mirc.


-KingTomato
#52425 03/10/03 06:48 PM
Joined: Oct 2003
Posts: 9
B
Burchov Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Oct 2003
Posts: 9
That works for some commands, but not for commands that should be executed when connected to the new server, like "/notice nick blah". Also a timer doesn't work, it executes the command on the old server frown

#52426 04/10/03 01:20 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You can use a timer, with /scid -at1. Something like this, make sure you have enough delay to make sure you have connected.
timer 1 5 scid -ati if $($!network == network notice nick message,0)


Link Copied to Clipboard