mIRC Home    About    Download    Register    News    Help

Print Thread
#185508 10/09/07 11:53 AM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
can someone please explain how to use them
tho show (instead $network and $server) what is my
current connection name and how to display
all connection names that are established ?

i tried with

//echo -a $scid(1).cid = 1
//echo -a $scid(1).1 = error

same goes for $scon

:P


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
2 scribbled examples...

The first one uses an "identifier-property"
Code:
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.
Code:
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."

Last edited by Horstl; 10/09/07 01:09 PM.
Horstl #185512 10/09/07 01:19 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
great example, thank you very much for this !


The harder I chase my dreams the more I experience the time for smiles and tears...
Horstl #185517 10/09/07 04:20 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
FYI, instead of that loop you could use /scon -a for your second example.

hixxy #186292 20/09/07 03:51 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
new question.

si wanted to have written on how many servers user is connected
so i took //echo -a $scid(0)

but it shows 1 even if user isnt connected
so i guess it only shows how many status windows are open.

but how to display then on how many servers user REALY IS connected ?

if even possible ?


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
//var %a = 0 | scon -at1 inc % $+ a | echo -a Active connections: %a

deegee #186297 20/09/07 04:10 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
oh, nice

thanks you.

edit:
may i ask
what all properties does $scon has
since i dont see in help file any given nor described
?

Last edited by WideOpenSpace; 20/09/07 04:10 PM.

The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Any identifier works with $scon() and $scid().

If you do //echo -a $scon(1).identifierhere, it's the same as doing //scon 1 | echo -a $identifierhere

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
See in /help Multi-Server
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.

deegee #186300 20/09/07 04:31 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
Originally Posted By: hixxy
Any identifier works with $scon() and $scid().


yeah, but which ?

Originally Posted By: deegee
See in /help Multi-Server
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.


it only gives

$scon(N)[.id]
$scid(N)[.id]

and talks something about $lactiveid, $activeid and $cid

but no properties as Horstl used


The harder I chase my dreams the more I experience the time for smiles and tears...
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Ehm, "any identifier" means "any identifier" wink

Code:
alias myidentifier return $me on $server $+([,$network,])


  • /scid -at1 echo -a $scid($cid).server $scid($cid).me $scid($cid).network -- $scid($cid).myidentifier

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Like he said it means any identifier.

Code:
alias hello { return hi }
alias test { echo -a $scon(1).$hello }

deegee #186304 20/09/07 04:53 PM
Joined: Jun 2007
Posts: 157
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 157
hmm kinda confusing to see that O_o
i always thought that these network related
commands are limited with some properties :P

thanks all laugh


The harder I chase my dreams the more I experience the time for smiles and tears...

Link Copied to Clipboard