| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 5697
|
Posted: Fri Apr 27, 2007 9:11 am Post subject: |
|
|
| Sean wrote: | after discussing with Skan about the discrepancy between the script and netstat.exe, in this very thread, I realized that the loopback (24, in your first interface 1 : 24 : 5, indicates it's a loopback interface) may not be a particular target of netstat.exe. It may simply try to sum up the data of all the interfaces.
So, I may also do it here.
What I'm concerned atm is, however, whether we have to include the loopback interface too or not.
I'd like to hear about the opinion of yours and other users on it. |
Sean, try LanSpeed2 when you have time: http://httpd.chello.nl/~m.vanosta/orcasoft/ . It allows you to select an adaptor, and you can run multiple instances by renameing the exe. The setback is that it has too much fancy things that one does not need.
We may run in to compare the results.
My existing setup is :
NIC attached to a ADSL2 / 256Kbps / Data Limit: Day Usage: 1GB Data per month / Night usage: Unlimited.
The existing script helps me to keep a check on Sent/Recvd so that I do not exceed my day usage bandwidth limits. My previous attempt was to ControlGetText from LAN dialog and show the bandwidth on the start button. But I could never automate the opening of the dialog . ( See: How to start the "Local Area Connection Status" )
Now I have decided to sign for an additional ISP for better browsing speed. ( I will be retaining the current for my downloading needs ). I will be adding another NIC and modem and will be simulataneously using both the connections from different browsers. ( I am yet to find if it possible )
The additional setup would be:
Additional NIC attached to a ADSL2 / 2Mbps / Data Limit: A meagre 350MB per month.
So my future script will have to monitor and display data for two adaptors with a single script in a compact GUI.  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Fri Apr 27, 2007 1:23 pm Post subject: |
|
|
| Skan wrote: | | Sean, try LanSpeed2 when you have time: http://httpd.chello.nl/~m.vanosta/orcasoft/ . It allows you to select an adaptor, and you can run multiple instances by renameing the exe. The setback is that it has too much fancy things that one does not need. |
Thanks for the link. I'll try it later as I have to update a few other scripts first.
It turned out difficult to do it than I thought.
I'm controlling, i.e., enable/disable a network adapter, using FolderItem Verb COM. As the status verb is just the second verb, I expected it to work with VerbItem to 1 (it's 0-based) but nothing happened!
It didn't work even with explorer.exe (:file-manager, not the shell) if setting to use separate (explorer.exe) processes for the shell and for the file-manager.
I presume atm that some neccessary modules are not loaded into the file-manager explorer.exe.
So, unless you configured to show networt connection tray icon, it would be very hard to find a solution.
If the tray icon is shown, then it's easy to pop up the status dialog.
| Quote: | Now I have decided to sign for an additional ISP for better browsing speed. ( I will be retaining the current for my downloading needs ). I will be adding another NIC and modem and will be simulataneously using both the connections from different browsers. ( I am yet to find if it possible ) |
Is that possible?
Anyway, I think I have to wait a while to hear opinions of other users before updating the script. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Sat Apr 28, 2007 1:42 am Post subject: |
|
|
Hi Chris,
| Chris wrote: | This is no big deal because my config isn't typical: Neither the topmost script nor Skan's works on my system, probably because I have a NIC for LAN and another for Internet (so perhaps the script is monitoring the LAN one). | Code: | 1 : 24 : 5
65539 : 6 : 5
65540 : 6 : 5 |
|
I uploaded a second script at the top post, which tries to add up the data of all available interfaces.
You may use it temporarily until final version is completed.
If there is still a problem, please let me know. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Apr 28, 2007 9:09 am Post subject: |
|
|
| Yes, it seems to work great. Thanks! |
|
| Back to top |
|
 |
ai4fu
Joined: 09 Dec 2007 Posts: 10
|
Posted: Sun Dec 09, 2007 8:02 pm Post subject: Newbie needs a leg up....pls |
|
|
I grabbed both of these scripts (Sean's on page 1 and Skan's on page 2) and wanted to modify them both in different ways. A pointer in the right direction would be useful ( and if you've the patience, the reasoning for it! helps me learn!)
Network Download/Upload Meter:
Removed the /1024 part in order to show my very variable network card connection. I am mobile 5 days a week... but that is only effective when I am on an "RTT" connection. When i get to an "EVDO" area my speed can go all the way to 2Mb/s+. What I am looking for is a way to make the bar graph logarithmic...
And for Skan's "Netmeter" script I was hoping to find a way to tell the script to look for the bitmap in a local, non-temporary directory so that it doesn't have to dl it every time... (again with explanations so I can learn instead of "mooching" all the time... I need all the help I can get... )
Thanks
Jim |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5697
|
Posted: Sun Dec 09, 2007 9:23 pm Post subject: Re: Newbie needs a leg up....pls |
|
|
| ai4fu wrote: | | And for Skan's "Netmeter" script I was hoping to find a way to tell the script to look for the bitmap in a local, non-temporary directory so that it doesn't have to dl it every time... |
That bitmap is just 2 pixel with a size of mere 62 bytes
Looks like a dirt particle when opened in a browser.
http://www.autohotkey.net/~goyyah/samples/grad001.bmp
BTW, I wrote it in W2K and icons numbers are inconsistent when run in XP.
 |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Mon Dec 10, 2007 6:41 am Post subject: Re: Newbie needs a leg up....pls |
|
|
| ai4fu wrote: | | What I am looking for is a way to make the bar graph logarithmic... |
AHK has a built-in logarithmic functions: Log()/Ln(). You may use it. |
|
| Back to top |
|
 |
ai4fu
Joined: 09 Dec 2007 Posts: 10
|
Posted: Mon Dec 10, 2007 1:45 pm Post subject: Re: Newbie needs a leg up....pls |
|
|
You are absolutely correct, it IS minute... however I just wanted help on how to make it find the file locally, if it exists, THEN dl it if not, and save it where it could be found next time, not in the temp dir, that gets dumped too frequently...
| Sean wrote: |
AHK has a built-in logarithmic functions: Log()/Ln(). You may use it.
|
Yep, found that, but I tried to use it as a log of the divisor:
| Code: | dnRate := Round((dnNew - dnOld) / log(1024))
upRate := Round((upNew - upOld) / log(1024)) |
...but that did not quite produce the desired result. I was thinking of trying this instead:
| Code: |
log(dnRate) := Round((dnNew - dnOld) / 1024)
log(upRate) := Round((upNew - upOld) / 1024) |
...but I doubt it will work.
Thank you both for the pointers...
Nope...it didn't work  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Mon Dec 10, 2007 2:42 pm Post subject: Re: Newbie needs a leg up....pls |
|
|
| ai4fu wrote: | | Code: | dnRate := Round((dnNew - dnOld) / log(1024))
upRate := Round((upNew - upOld) / log(1024)) |
|
You may use this:
| Code: | dnRate := Round(ln(dnNew - dnOld + 1) * 8)
upRate := Round(ln(upNew - upOld + 1) * 8) |
|
|
| Back to top |
|
 |
ai4fu
Joined: 09 Dec 2007 Posts: 10
|
Posted: Tue Dec 11, 2007 3:27 am Post subject: |
|
|
Thanks Sean!
The first one did the trick nicely. It is now speed proportionate from just a bare few kb/s out in the rural areas to nearly full graph at 850 kb/s.
I must admit that I could not find a "progress control" as you put it but I guessed at it...let me know if I got it right
| Code: | Gui, -Caption +Border +AlwaysOnTop +ToolWindow
Gui, Color, 00FF00
Gui, +LastFound
WinSet, TransColor, EEAA99
Gui, Add, Progress, w100 h10 cGreen -0x1 vDn Range0-12
Gui, Add, Progress, x+10 w100 h10 cRed -0x1 vUp Range0-12
Gui, Show, x780 y20 , NetMeter ; Adjust X & Y to suit your screen res
If GetIfTable(tb)
ExitApp
|
Jim |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Tue Dec 11, 2007 4:52 am Post subject: |
|
|
| ai4fu wrote: | | I must admit that I could not find a "progress control" as you put it but I guessed at it...let me know if I got it right |
I realized that as you're new to AHK, and I think you got it right.
BTW, I updated the code so as to need not put Range. It may be better one as its range is fine-grained between 0-100, which is the default one, than 0-12. I multiplied 8 as you said the rate was 2Mbps. If it's 850Kbps, may use 8.6 instead. Or you may use log instead of ln with multiplying one between 19 and 20. |
|
| Back to top |
|
 |
ai4fu
Joined: 09 Dec 2007 Posts: 10
|
Posted: Tue Dec 11, 2007 9:47 am Post subject: |
|
|
I should have qualified the 850... that was just the best speed it has gone to since I have made those changes you suggested. I do see 2Mb/s occasionally, but only in major metro areas, and then usually only when downloading torrents. Most of the time my speed ranges from 5kb/s to 500Kb/s, with the best ever at 2.86Mb/s The changes you have suggested make it work great now, exactly what I had wanted.
And yes, I am very new to AHK, indeed, I am new to scripting at all. Trust me, if there was a web page for "AHK for dummies" that's where I would be.
Most of what I do with AHK is cutting and pasting existing scripts and making changes to suit my particular needs. I have a hard time making new scripts. Just don't know enough...which is why I ask so many questions.
Thanks for your help. Seriously. |
|
| Back to top |
|
 |
Thalon
Joined: 12 Jul 2005 Posts: 640
|
Posted: Wed Dec 12, 2007 10:30 am Post subject: |
|
|
Didn't see this topic before, but it works nicely here.
I might take it as a baseground to build "Netmeter" in AHK out of it
Thalon _________________ AHK-Icon-Changer
AHK-IRC
deutsches Forum
SacredVault |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1279
|
Posted: Thu Dec 13, 2007 4:45 am Post subject: |
|
|
| Thalon wrote: | I might take it as a baseground to build "Netmeter" in AHK out of it  |
Good to hear it. Of course you'll share it? |
|
| Back to top |
|
 |
noisex Guest
|
|
| Back to top |
|
 |
|