mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2006
Posts: 35
C
chump Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Sep 2006
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

Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
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
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I believe that this script will do that, but I cannot test it.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Last edited by genius_at_work; 05/05/07 04:18 AM.
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
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
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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


Link Copied to Clipboard