2 scribbled examples...
The first one uses an "identifier-property"
alias connectionstats {
var %nr = 1
while ($scon(%nr)) {
echo -a $scon(%nr).status to $scon(%nr).network having nick $scon(%nr).me
inc %nr
}
}
quote mirc.chm:
"If you specify a property which is an identifier, it returns the value of that identifier for that connection. This also works for custom identifiers. Note: The property cannot use brackets."
The second one uses /scon.
alias connectionstats2 {
var %nr = 1
while ($scon(%nr)) {
scon %nr echo -a net: $!network status: $!status nick: $!me chans: $!chan(0)
inc %nr
}
scon -r
}
Note the $
!identifier in this example to prevent an evaluation before time - you might have used these with e.g. timers so far.
quote mirc.chm:
"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."