Total sharing in a hub
Moderator: Moderators
-
Stranglehold
- Posts: 2
- Joined: 2003-02-04 11:17
- Location: Kalmar, Sweden
Total sharing in a hub
How do I get the total sharing in a hub with neomodus basic scripting?
-
ButterflySoul
- Posts: 210
- Joined: 2003-01-23 22:24
- Location: Nevada
Hub total share
I'm not sure if your question was about the name of method/property to directly access the total shared, or if you were thinking of a script that builds it from scratch by adding up everyone's shared bytes.
In case you were looking for a property of the hub (I'm pretty sure there is one, but I've been reading the boards for too long, and I can't remember where I saw it; and more importantly, when =p), you will find a list of all the hub objects in this thread (in the last post of the thread):
http://dcplusplus.sourceforge.net/forum/viewtopic.php?t=264
If you're looking into the computing approach (and are familiar with the basics of scripting, which I assume is the case, since you can't really do anything with just the total share all by itself), you need to use a "For Each ... In ..." loop with the colUsers collection. Like that :
The counter is to keep the hub running smoothly while your loop adds up everyone's share. If your hub has under 100 users, you can safely drop it, but in this case be prepared to revisit your code when your hub grows in size, and you can't figure out what causes it to run so sloooooow =)
In case you were looking for a property of the hub (I'm pretty sure there is one, but I've been reading the boards for too long, and I can't remember where I saw it; and more importantly, when =p), you will find a list of all the hub objects in this thread (in the last post of the thread):
http://dcplusplus.sourceforge.net/forum/viewtopic.php?t=264
If you're looking into the computing approach (and are familiar with the basics of scripting, which I assume is the case, since you can't really do anything with just the total share all by itself), you need to use a "For Each ... In ..." loop with the colUsers collection. Like that :
Code: Select all
Dim objUser, iHubShare, x
For Each objUser In colUsers
x = x+1
iHubShare = iHubShare + objUser.iBytesShared
If x Mod 75 = 0 Then frmHub.DoEventsForMe
NextThe counter is to keep the hub running smoothly while your loop adds up everyone's share. If your hub has under 100 users, you can safely drop it, but in this case be prepared to revisit your code when your hub grows in size, and you can't figure out what causes it to run so sloooooow =)
-
TasMan
- Posts: 196
- Joined: 2003-01-03 13:31
- Location: Canada
-
ButterflySoul
- Posts: 210
- Joined: 2003-01-23 22:24
- Location: Nevada
Who is online
Users browsing this forum: Google [Bot] and 0 guests