mIRC Home    About    Download    Register    News    Help

Print Thread
#234174 10/10/11 10:55 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
$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,.) }
sparta #234175 10/10/11 11:19 PM
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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

Last edited by Wims; 10/10/11 11:21 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #234176 10/10/11 11:24 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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,.) }
sparta #234177 11/10/11 12:13 AM
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #234179 11/10/11 09:12 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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,.) }
sparta #234182 11/10/11 01:37 PM
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
The CurrentBandwidth property doesn't return anything for me either, there's nothing you can do about this, the code is working.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
sparta #234187 11/10/11 04:21 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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

Link Copied to Clipboard