mIRC Home    About    Download    Register    News    Help

Print Thread
count connected servers #213506 29/06/09 06:12 PM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
if //echo -a $scon(0) gives how many opened server windows there are, what is to show on how many connected servers user actualy is ?

Re: count connected servers [Re: vinifera] #213507 29/06/09 06:23 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
You would need to loop throught he connections.

Code:
example: /sc_chk

alias sc_chk {
var %sc = 1
while ($scon(%sc)) {
if ($scon(%sc).status = connected) echo -s $scon(%sc).mnick is connected to $scon(%sc).network on connection %sc .
inc %sc
}
}


Sorry I just realized that isnt your request.


Code:
example: /sc_chk

alias sc_chk {
var %sc = 1, %sx
while ($scon(%sc)) {
if ($scon(%sc).status = connected) inc %sx
inc %sc
}
echo -a %sx of your $scon(0) connections are connected.
}



Last edited by DJ_Sol; 29/06/09 06:26 PM.
Re: count connected servers [Re: vinifera] #213508 29/06/09 06:24 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Hm, here's a custom identifier that uses the -tN switch of /scon
Code:
; $connectedcount = N of server windows with status "connected".
alias connectedcount {
  var %n = 0
  scon -at1 inc % $+ n
  return %n
}
Note: "loggingon" counts to "connected". if that's a problem:
Code:
alias connectedcount {
  var %n = 0
  scon -a if ($status == connected) inc % $+ n
  return %n
}


Last edited by Horstl; 29/06/09 06:33 PM.
Re: count connected servers [Re: Horstl] #213509 29/06/09 06:56 PM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
thanks guys