mIRC Home    About    Download    Register    News    Help

Print Thread
#227013 22/10/10 10:33 AM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
If I want a script triggered on server1 and then run on server 2 is this the correct way?

Code:
on *:TEXT:*:#channel: {
  if ($1 == !cmd) {
    msg $chan attempting to run command on server 2
    /scon 2
    ; run commands on server 2 where $me matches nick on server2 not server1
  return
  }

is this the correct way? do I have to consider any other issues when using scon? when to use scon and when to use scid?

also I have server1 as the first server in my mirc and server 2 as the 2nd one but if I gave this script to someone else who has the servers in a different order/position how to determine the scon id of the correct server in the script rather than manually editing the id?

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
The script should be fine that way.

To determine the correct scon number, you could loop through all values of $scon - $scon(0) - and evaluate $scon(%n).network
All identifiers that don't require parameters (e.g. $network does not, but $gettok() does) can be used as a property in the $scon identifier to return a scon-specific value.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yeah, or you can set a variable on connect and point to that variable instead of doing a loop every time.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can also do it like this:

Code:
on *:text:!echo *:#channel1:{
  var %text = $2-
  if ($network == network1) scid -at1 if ($network == network2) msg #channel2 % $+ text
}


Link Copied to Clipboard