mIRC Home    About    Download    Register    News    Help

Print Thread
correct way to use scon #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?

Re: correct way to use scon [Re: firefox] #227015 22/10/10 11:33 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
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.

Re: correct way to use scon [Re: 5618] #227017 22/10/10 02:22 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
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.

Re: correct way to use scon [Re: 5618] #227031 22/10/10 10:28 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
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
}