From Scriptwiki
Jump to: navigation, search

Changes the active connection for a script to connection id N, where N is the Nth connection.

/scon <-rsatM | N> [command]

Note that all commands after the /scon command will be performed on the new connection id.

Explanation of the switches (-a and -tM can only be used if you specify a command):

Switch Meaning
r resets the connection id to the original id for that script.
a performs the command on all connection ids.
tM limits the command to being performed only on servers with a certain connection status, where M is an or'd value of 1 = server connected, 2 = not connected, 4 = connecting, 8 = not connecting. The command is only performed if M matches the connect status of the connection id.
s makes any called commands or identifiers show their results.

Note that if you use a command that contains $identifiers, and you want the identifiers to be evaluated in the target connection, you must pass them as $!identifier to prevent them from being evaluated first in the current connection.


scon 1 echo -s My nick is $!me

This would echo your nick from the connection 1 in the status window of connection 1.

scon 1 echo -s My nick is $me

This example would echo the nick of the currently active connection in the status window of connection 1.

scon -a echo -a This is $!network

This would echo all your networks in your active window.