mIRC Home    About    Download    Register    News    Help

Print Thread
U
unknownd
unknownd
U
/scid <-rsatM | N> [command]
Changes the active connection for a script to connection id N, where N is a $cid value.

All commands after the /scid command will be performed on the new connection id.
... ... ...

i dont see any function to return a variable, ore alias..
i want to see something like this: $scid(N,%var/$alias)
(:

L
LtGuide
LtGuide
L
$scid(N)[.id]
Returns the connection id, where N is a $cid value.

If N = 0, returns total number of open server windows.

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.
-----------------
by brackets it means stuff like $chan(0)

examples: $scid(2).me, $scid(11).chans [custom identifier]
-----------------
if you want something more like your idea, you could try this out (note: returning a variable using this is pointless as variables are the same for all connections):

Code:
alias scideval {
  scid $1 return $eval($!2,2)
}

example: echo -a $scideval(11,$!ng.me)
note: you need the ! in the example or $ng.me would be evaulated before it got to $scideval

Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
Assume:
$scon(1).server == kernel-c.nj.us.dal.net
$scon(1).network == DALnet
%variable1 = Khaled
%variable2 = Hammer
Code:

alias myAlias return $gettok($server,-2-,46)
alias variable1 return %variable1 on $network
alias variable2 return %variable2 on $chans
alias chans var %s, %i = 1 | while ($chan(%i)) { %s = %S $ifmatch | inc %i } | return %s
  • $scon(1).myAlias returns dal.net
  • $scon(1).variable1 returns Khaled on DALnet
  • $scon(1).variable2 returns Hammer on #mIRC #HelpDesk
And yes, I realize that these are workarounds to what you want. I thought when this idea first came out that it'd be quite nice to be able to do something like:
  • $scon(2).send(3).file
  • $scon(4).myCustomIdentifier($nick,$server,$me,$chan).property
cool

U
unknownd
unknownd
U
maby i'll just read a little better next time.. (:

P
pDude
pDude
P
I would like to suggest the ability to use properties with brackets when using the $scid and $scon identifiers.

For example, $scon(3).chan(2).status

/ pDude

L
LtGuide
LtGuide
L
With the time Khaled took to add all the multiserver capabilities, I'm sure he would have added the ability to use properties with brackets if he felt it was *necessary*.

using my scideval alias from before:
echo -a $scideval(11,$!chan(3).status)


Link Copied to Clipboard