mIRC Home    About    Download    Register    News    Help

Topic Options
#213506 - 29/06/09 07:12 PM count connected servers
vinifera Offline
Babel fish

Registered: 21/06/09
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 ?

Top
#213507 - 29/06/09 07:23 PM Re: count connected servers [Re: vinifera]
DJ_Sol Offline
Hoopy frood

Registered: 04/01/07
Posts: 1156
Loc: Seattle
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.
}




Edited by DJ_Sol (29/06/09 07:26 PM)

Top
#213508 - 29/06/09 07:24 PM Re: count connected servers [Re: vinifera]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
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
}



Edited by Horstl (29/06/09 07:33 PM)

Top
#213509 - 29/06/09 07:56 PM Re: count connected servers [Re: Horstl]
vinifera Offline
Babel fish

Registered: 21/06/09
Posts: 91
thanks guys

Top