Total sharing in a hub

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Stranglehold
Posts: 2
Joined: 2003-02-04 11:17
Location: Kalmar, Sweden

Total sharing in a hub

Post by Stranglehold » 2003-02-17 10:06

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

Post by ButterflySoul » 2003-02-17 10:47

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 :

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
Next


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 =)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

TasMan
Posts: 196
Joined: 2003-01-03 13:31
Location: Canada

Post by TasMan » 2003-02-17 11:03

Try that :)

Code: Select all

colUsers.iTotalBytesShared

ButterflySoul
Posts: 210
Joined: 2003-01-23 22:24
Location: Nevada

Post by ButterflySoul » 2003-02-17 11:46

lol. Aye, that's the one I couldn't remember =)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

Who is online

Users browsing this forum: Google [Bot] and 0 guests