mIRC Home    About    Download    Register    News    Help

Topic Options
#234174 - 10/10/11 11:55 PM wmiget
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
$wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).Name , with this line i can grab the name of the network card, but if i have two it only return the first one, how can i get the information from the other? i dont want to use dll for this. And any other usefull information that can be grabed from the network card? like duplex and so on?
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#234175 - 11/10/11 12:19 AM Re: wmiget [Re: sparta]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3465
Loc: France
The $wmiget alias isn't supposed to be used to get more than one result, use your own code:
Code:
alias getInet {
  .comopen a WbemScripting.SWbemLocator
  .comclose a $com(a,ConnectServer,3,dispatch* b) 
  .comclose b $com(b,ExecQuery,3,bstr*,select Name from Win32_PerfRawData_Tcpip_NetworkInterface,dispatch* c)
  var %r = $comval(c,0)
  while (%r) { echo -a $comval(c,%r,Name) | dec %r }
  :error 
  if ($error) reseterror 
  if ($com(a)) .comclose a
  if ($com(b)) .comclose b
  if ($com(c)) .comclose c
}
You can get more properties (thing like Name) here


Edited by Wims (11/10/11 12:21 AM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#234176 - 11/10/11 12:24 AM Re: wmiget [Re: Wims]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
Thank you, but found out a way..

//echo -a $wmiget(Win32_PerfRawData_Tcpip_NetworkInterface,2).Name

The ,2 tell me the name of my network card no 2..
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#234177 - 11/10/11 01:13 AM Re: wmiget [Re: sparta]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3465
Loc: France
Yeah.. the point being that each time you call $wmiget(,N) it makes a new connection, which is very slow and not a good solution
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#234179 - 11/10/11 10:12 AM Re: wmiget [Re: Wims]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I could not get your code to give me the amount of data transfered.

$calc($wmiget(Win32_PerfRawData_Tcpip_NetworkInterface,2).CurrentBandwidth / 1000000) $+ MB/s

I tested to edit your code to get it, but it always return 0 . I guess i did somthing wrong..
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#234182 - 11/10/11 02:37 PM Re: wmiget [Re: sparta]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3465
Loc: France
The CurrentBandwidth property doesn't return anything for me either, there's nothing you can do about this, the code is working.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#234187 - 11/10/11 05:21 PM Re: wmiget [Re: sparta]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
CurrentBandwidth and various other properties are not always available depending on hardware and operating system. Current Bandwidth is especially troublesome in this regard, so if you want current bandwidth including what is used outside of mIRC, you'll need another method of obtaining it.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top