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
-
BSOD2600
- Forum Moderator
- Posts: 503
- Joined: 2003-01-27 23:47
- Location: USA
Post
by BSOD2600 » 2003-03-11 21:45
Code: Select all
' Find the description. If it contains a DC++ tag, find the number of hubs the user is in, and how many slots he has open.
sDescription = BeforeFirst(AfterFirst(AfterFirst(sCurData, "$All "), " "), "$")
If InStr(sDescription, "<++") <> 0 And InStr(sDescription, ">") <> 0 Then
sDescription = BeforeFirst(AfterFirst(sDescription, "<++"), ">")
' Find the number of hubs and the number of slots. At this stage, the user is not yet really connected, so add 1 to the Hubs
' count, to account for this hub. Pun not intended. UPDATE: BUG ALERT. We should NOT add 1!
iHubs = CInt(BeforeFirst(AfterFirst(sDescription, "H:"), ",S")) ' + 1
iSlots = CInt(AfterFirst(sDescription, "S:"))
' If the user is connected to more hubs than is allowed, deny access: PM him, and then redirect him.
If iHubs > sldrMaxHubsAllowed.Value And sldrMaxHubsAllowed.Value > 0 Then
CommunicateMessage curUser, frmHub.txtName, sMsgTooManyHubs
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
Exit Sub
End If
' If the user has fewer open slots than is allowed, deny access: PM and redirect him.
If iSlots < CDbl(txtMinSlotsPerHub.Text) * iHubs Then
CommunicateMessage curUser, frmHub.txtName, sMsgTooFewSlots
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
Exit Sub
End If
' If the user is using a too old DC++ version, deny access: PM and redirect him.
If CDbl(BeforeFirst(AfterFirst(sCurData, "V:"), ",M")) < CDbl(txtMinDCppVersion.Text) Then
CommunicateMessage curUser, frmHub.txtName, sMsgDCppTooOld
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
Exit Sub
End If
End If
Could someone help me change the code to handle the new 0.24 Hub listing? thanks!
-
Sedulus
- Forum Moderator
- Posts: 687
- Joined: 2003-01-04 14:32
Post
by Sedulus » 2003-03-11 23:13
instead of:
Code: Select all
iHubs = CInt(BeforeFirst(AfterFirst(sDescription, "H:"), ",S")) ' + 1
(looking at some code other posted here recently) I think something like
Code: Select all
sTmp = BeforeFirst(AfterFirst(sDescription, "H:"), ",S")
If Instr(sTmp,"/") > 0 Then
a024Hubs=Split(sTmp,"/")
iHubs = CInt(a024Hubs(0)) + CInt(a024Hubs(1))
Else
iHubs = CInt(sTmp)
End If
might do the trick
-
BSOD2600
- Forum Moderator
- Posts: 503
- Joined: 2003-01-27 23:47
- Location: USA
Post
by BSOD2600 » 2003-03-12 19:15
It seems to have compleatly disabled the hub checking....for dc++ 0.233 and 0.24.
-
ButterflySoul
- Posts: 210
- Joined: 2003-01-23 22:24
- Location: Nevada
Post
by ButterflySoul » 2003-03-12 22:09
It seems to have compleatly disabled the hub checking....for dc++ 0.233 and 0.24.
Considering the code your originally posted includes
Code: Select all
' If the user is connected to more hubs than is allowed, deny access: PM him, and then redirect him.
If iHubs > sldrMaxHubsAllowed.Value And sldrMaxHubsAllowed.Value > 0 Then
CommunicateMessage curUser, frmHub.txtName, sMsgTooManyHubs
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
Exit Sub
End If
And
Code: Select all
' If the user has fewer open slots than is allowed, deny access: PM and redirect him.
If iSlots < CDbl(txtMinSlotsPerHub.Text) * iHubs Then
CommunicateMessage curUser, frmHub.txtName, sMsgTooFewSlots
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
Exit Sub
End If
it might be a redirect issue (since you don't disconnect or kick after the redirect). Have an eye to
this thread for various fix suggestions about this specific issue =)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best
-
BSOD2600
- Forum Moderator
- Posts: 503
- Joined: 2003-01-27 23:47
- Location: USA
Post
by BSOD2600 » 2003-03-12 22:26
yeah, after I initially posted I remembered that I had made the change in that post about the min share issues and changed the code to:
Code: Select all
frmHub.DoEventsForMe
curUser.ForceMove frmHub.txtRedirect
curUser.Kick()
Exit Sub
I've tried the suggested code from Sedulus two ways.
1) use stealth dc and typed in H:5/2/2 and see if the bot kicks me
2) used bcdc (0.233) and connected to 5 hubs (bot limit was 2) and see if it kicked me.
In both cases, it did not, thus I deducted the code change wasnt working.
-
ButterflySoul
- Posts: 210
- Joined: 2003-01-23 22:24
- Location: Nevada
Post
by ButterflySoul » 2003-03-13 05:31
I've tried the suggested code from Sedulus two ways.
1) use stealth dc and typed in H:5/2/2 and see if the bot kicks me
2) used bcdc (0.233) and connected to 5 hubs (bot limit was 2) and see if it kicked me.
In both cases, it did not, thus I deducted the code change wasnt working.
Interesting way to test Sedulus's code, but I'm afraid it doesn't mean the hubs are calculated wrongly, and in fact, the code he posted is about as perfect as it can get. That's why I think it's a kicking issue caused by some other problems in the code
1) Add a
at the begining of the sub, just in case
2) If after the "End If" of the code posted by Sedulus, you add a
Code: Select all
curUser.PrivateMessage "Test", cstr(iHubs)
what does the bot answer ? =)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best
-
BSOD2600
- Forum Moderator
- Posts: 503
- Joined: 2003-01-27 23:47
- Location: USA
Post
by BSOD2600 » 2003-03-13 18:03
Thanks for the suggestions...I had to dim a024Hubs AND sTmp for it to work.
Users browsing this forum: Google [Bot] and 0 guests