m (Bot: Fixing links) |
m (Bot: Fixing links) |
||
Line 83: | Line 83: | ||
* [[List of commands - mIRC|List of commands]] | * [[List of commands - mIRC|List of commands]] | ||
* [[List of identifiers - mIRC|List of identifiers]] | * [[List of identifiers - mIRC|List of identifiers]] | ||
− | * | + | * {{mIRC|$status}} |
− | * | + | * {{mIRC|$network}} |
− | * | + | * {{mIRC|$scon}} |
− | * | + | * {{mIRC|$scid}} |
* {{mIRC|/scid}} | * {{mIRC|/scid}} | ||
{{mIRC command list}} | {{mIRC command list}} | ||
[[Category:MIRC commands]] | [[Category:MIRC commands]] |
Revision as of 19:40, 5 July 2014
The /scon command can change the connection associated with the current script. When a command is not specified, mIRC changes the connection of the current script to the Nth connection. The rest of the code will continue to execute on that connection. When a command is specified, mIRC will execute the command on the specified connection or connections based on the switches provided. Any active connection changes are restored upon returning to the calling routine. A command can be executed on all or some of the connections depending on their types using the -a or -at<Type> switches.
Connection Type
- 1 = Connected
- 2 = Disconnected or Connecting
- 3 = 1+2 = Connected, Disconnected, or Connecting (Same as -a)
- 4 = Connecting
- 5 = 1+4 = Connected or Connecting
- 6 = 2+4 = 2 = Disconnected or Connecting
- 7 = 3+4 = Disconnected or Connected or Connecting
- 8 = Disconnected
Synopsis
/scon <-r|Nth> /scon <Nth> [command] /scon -r [command] /scon -a [command] /scon -at<type> [command] /scon -s [Nth]
Switches
- -r - Resets the connection id back to what it original was (before any /scon/scid calls)
- -s - Prints the current connection ID. (Or changes to the Nth connection and prints its ID.)
- -a - Perform on all connections.
- -at<type> - Perform on all the connections of a specific type.
Parameters
- <Nth> - The Nth connection.
- <type> - The connection type, only used with -at switchs.
Example
A simple example of using /scon to send a command to all connected connections.
/* ** Global amsg - performs an amsg on all the ** the actives connections you are on. ** ** /gamsg <message> */ alias gamsg { if (!$1) { echo -gtcse info * /gamsg: insufficient parameters halt } ; all active connections scon -at1 amsg $1- }
Print all the channels you are on from every connection you have:
alias listChans { var %x = 1 while ($scon(%x)) { ; switch connection scon %x ; iterate over the channels var %c = 1, %chans while ($chan(%c)) { var %chans = $addtok(%chans, $chr(32) $v1, 44) inc %c } ; print channels scon -r echo -s Network: $network Channels: %chans ; next connection inc %x } }
Compatibility
Added: mIRC v6.0
Added On: 03/02/2002
Note: Individual switches were not taken into consideration.