mIRC Home    About    Download    Register    News    Help

Topic Options
#176159 - 04/05/07 06:06 PM SCRIPT TO READ ALL NETWORK CARDS INSTALLED
chump Offline
Ameglian cow

Registered: 24/09/06
Posts: 35
hi i am trying to find somthing that can read all my network cards at the same time and then display total bandwidth..like what darkengine does..only read all of the cards and not just 1 at a time..cheers peeps

Top
#176165 - 04/05/07 08:26 PM Re: SCRIPT TO READ ALL NETWORK CARDS INSTALLED [Re: chump]
NaquadaServ Offline
Fjord artisan

Registered: 12/12/02
Posts: 580
I'm sure $com could do this, although I do not know the details on what objects to use...

These links might help...

Basic information about COM Objects
Using WMI to do something like this

_________________________
NaquadaBomb
www.mirc-dll.com

Top
#176171 - 05/05/07 12:07 AM Re: SCRIPT TO READ ALL NETWORK CARDS INSTALLED [Re: chump]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
I believe that this script will do that, but I cannot test it.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#176185 - 05/05/07 04:17 AM Re: SCRIPT TO READ ALL NETWORK CARDS INSTALLED [Re: chump]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
What do you mean by "Bandwidth"?

The total bandwidth of the interfaces on this computer is 154Mb/s (100Mb/s wired + 54Mb/s wireless).

The current speed can only be calculated as an average:
<delta data transferred> / <elapsed time>

Let us know which you want to display, bandwidth or speed.



edit:

If you are looking for a script to display the current (average) speed, this should work for you.

Code:
on *:START:bw.check
alias bwcheck {
  .timerbw 1 5 bwcheck

  var %r, %c = 0, %cc = $numtok($dll($scriptdir $+ moo.dll,interfaceinfo,_),35)
  if (!$hget(bw)) hmake bw 1
  else hdel -w bw t.*

  while (%c < %cc) {
    inc %c

    %r = $gettok($dll($scriptdir $+ moo.dll,interfaceinfo,_),%c,35)
    %r = $regex(d.i,%r,/([\d.]+)MB In/i) $regex(d.o,%r,/([\d.]+)MB Out/i)

    if (!$hget(bw,first)) {
      hadd -m bw $+(I.,%c) $regml(d.i,1)
      hadd -m bw $+(O.,%c) $regml(d.o,1)
    }

    hadd -m bw t.i $calc($hget(bw,t.i) + ($regml(d.i,1) - $hget(bw,$+(I.,%c))))
    hadd -m bw t.o $calc($hget(bw,t.o) + ($regml(d.o,1) - $hget(bw,$+(O.,%c))))

    hadd -m bw $+(I.,%c) $regml(d.i,1)
    hadd -m bw $+(O.,%c) $regml(d.o,1)
  }

  var %time = $calc($ticks - $hget(bw,time))
  hadd -m bw time $ticks
  hadd -m bw first 1

  ;returns <IN> <OUT> <unit>
  return $round($calc($hget(bw,t.i) * 10^6 / %time),3) $round($calc($hget(bw,t.o) * 10^6 / %time),3) kb/s
}


However, it requires the use of a dll (moo.dll). If anyone can present COM code that will retrieve the same NIC stats as moo.dll, the dll can be eliminated. The data that moo.dll returns looks like this:

Code:
1 (D-Link AirPlus G DWL-G122 Wireless USB Adapter(rev.B) - Packet Scheduler Miniport (11Mb/s) 0.07MB In, 0.01MB Out)
2(Realtek RTL8139 Family PCI Fast Ethernet NIC - Packet Scheduler Miniport (100Mb/s) 3429.34MB In, 714.39MB Out)


-genius_at_work


Edited by genius_at_work (05/05/07 05:18 AM)

Top
#176283 - 07/05/07 03:02 PM Re: SCRIPT TO READ ALL NETWORK CARDS INSTALLED [Re: genius_at_work]
NaquadaServ Offline
Fjord artisan

Registered: 12/12/02
Posts: 580
I've not used it but, there is a scripted version of moo.dll that I assume uses $com instead of the DLL, located here.
_________________________
NaquadaBomb
www.mirc-dll.com

Top
#176314 - 08/05/07 03:08 AM Re: SCRIPT TO READ ALL NETWORK CARDS INSTALLED [Re: NaquadaServ]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
I looked at that script briefly, but I haven't had time to examine it in depth. However, what I found so far is that it only returns stats based on the last NIC found.

-genius_at_work

Top