Maxhubs with dc++0.24 check

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

PiluMinzollaa
Posts: 2
Joined: 2003-02-09 12:59

Maxhubs with dc++0.24 check

Post by PiluMinzollaa » 2003-04-07 13:03

Hi
I'm looking for some script that check the number of connected hubs with dc++ 0.24... can someone help me? Thanks

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-07 21:17


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

Post by TasMan » 2003-04-07 21:45

If you'd like an example.....here you go!

Code: Select all

Const BOTNAME = "HubBot"  'Name of the bot used in PMs
Const MAXHUBS = 50           'Maximum number of hubs an user can be connected to

Sub DataArival(curUser, sCurData)
  If Not curUser.bOperator Then
    If LeftB$(sCurData, 14) = "$MyINFO" Then
      '$MyINFO $ALL <name> <desc>$ $<conn><char>$<email>$<share>$|

      Dim iPos

      sCurData = MidB(sCurData, InStrB(1, sCurData, " ") + 2)
      sCurData = MidB(sCurData, InStrB(1, sCurData, " ") + 2)

      iPos = InStrB(1, sCurData, " ")

      sCurData = MidB(sCurData, iPos + 2, InStrB(1, sCurData, "$") - iPos - 3)
 
      iPos = InStrRev(sCurData, "<++")
      If iPos Then
        Dim iHubs

        sCurData = Mid(sCurData, iPos + 4)
        iPos = InStrB(1, sCurData, "H:")
        sCurData = MidB(sCurData, iPos + 4, InStrB(iPos, sCurData, ",") - iPos - 5)

        If InStrB(1, sCurData, "/") Then
          Dim aTmp()

          aTmp = Split(sCurData, "/")

          iHubs = CInt(aTmp(0)) + CInt(aTmp(1))
        Else
          iHubs = sCurData
        End If

        If CInt(iHubs) > CInt(MAXHUBS) Then
          curUser.PrivateMessage CStr(BOTNAME), "You are connected to too many hubs. The max you can be connected to is " & CStr(MAXHUBS) & "."
           frmHub.DoEventsForMe
           curUser.Disconnect
        End If

      End If
     
    End If
  End If
End Sub
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-07 22:00

It's a real pity that I'm to lazy to come out with nice posts like this one ! :cry:

Animated 0wner
Posts: 36
Joined: 2003-04-09 09:04

Post by Animated 0wner » 2003-04-10 09:21

A few noob questions, sorry. The above script...is it just for .24+ clients? If so, how will it react to earlier versions? If it will just let them by, I would be able to run my pre-.24 max hubs script alongside it, correct?

I hate being a noob! :oops:

[KUN.NL]mepmuff
Posts: 73
Joined: 2003-01-06 14:32

Post by [KUN.NL]mepmuff » 2003-04-10 09:29

be careful that you don't end up with one script checking .24+ users and the other one then kicking them when let through.... (and vice versa)

TheSaint
Posts: 3
Joined: 2003-04-09 15:25

Post by TheSaint » 2003-04-10 09:33

If u use Direct Connect Hub (NMDC Hub) I would advise to get the Generalbot of http://www.gagdet.no-ip.info .

But change one line in the script, unless the new dc version will be blocked...

Code: Select all

 '----------EDITABLE SETTINGS----------
  sMinDCPPVersion   = "0"            '<- Minimum DC++ version (0.175 recommended because there are problems between 0.181 and 0.174 and earlier versions).


And further down in the bot :

Code: Select all

'-----Policies: 0=no action, 1=redirect, 2=disconnect, 3=kick, 4=kick&permban
'-----OLD DCPLUSPLUS-----
  sReason(11)       = "Your version is accepted, enjoy [F]allen [H]eaven"
  iPolicy(11)       = 0


If you dont change iPolicy(11) to 0 most people with new dc ++ versions cant login and get blocked. And well turn down the "Min Client Version" in "Network Setup" to zero (in the DC Hubsoft).

Marvin
Posts: 147
Joined: 2003-03-06 11:56
Location: France

Post by Marvin » 2003-04-10 12:25

Animated 0wner wrote:A few noob questions, sorry. The above script...is it just for .24+ clients? If so, how will it react to earlier versions?


The script checks if the H: tag is H:n or H:x/y/z so it deals with the pre 0.24 clients too. Note that it doesn't count OPs.

Animated 0wner
Posts: 36
Joined: 2003-04-09 09:04

Post by Animated 0wner » 2003-04-10 20:27

I tried using the above script. There is an error in it somewhere. Any chance one of you could point it out? Oh yes, as for using the General Bot, a friend of mine uses it and it is indeed a very nice bot. But I like my current setup, all I need is a max hubs script that checks for .24+ versions. Thanks for the help guys.

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

Post by TasMan » 2003-04-10 21:33

Oops.....too used to using regular VB :P

Here it is fixed, in all it's glory!

Code: Select all

Const BOTNAME = "HubBot"  'Name of the bot used in PMs 
Const MAXHUBS = 50           'Maximum number of hubs an user can be connected to

Sub DataArival(curUser, sCurData)
  If Not curUser.bOperator Then
    If LeftB(sCurData, 14) = "$MyINFO" Then
      '$MyINFO $ALL <name> <desc>$ $<conn><char>$<email>$<share>$|

      Dim iPos

      sCurData = MidB(sCurData, InStrB(1, sCurData, " ") + 2)
      sCurData = MidB(sCurData, InStrB(1, sCurData, " ") + 2)

      iPos = InStrB(1, sCurData, " ")

      sCurData = MidB(sCurData, iPos + 2, InStrB(1, sCurData, "$") - iPos - 3)

      iPos = InStrRev(sCurData, "<++")
      If iPos Then
        Dim iHubs

        sCurData = Mid(sCurData, iPos + 4)
        iPos = InStrB(1, sCurData, "H:")
        sCurData = MidB(sCurData, iPos + 4, InStrB(iPos, sCurData, ",") - iPos - 5)

        If InStrB(1, sCurData, "/") Then
          Dim aTmp()

          aTmp = Split(sCurData, "/")

          iHubs = CInt(aTmp(0)) + CInt(aTmp(1))
        Else
          iHubs = sCurData
        End If

        If CInt(iHubs) > CInt(MAXHUBS) Then
          curUser.PrivateMessage CStr(BOTNAME), "You are connected to too many hubs. The max you can be connected to is " & CStr(MAXHUBS) & "."
           frmHub.DoEventsForMe
           curUser.Disconnect
        End If

      End If
     
    End If
  End If
End Sub
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....

Animated 0wner
Posts: 36
Joined: 2003-04-09 09:04

Post by Animated 0wner » 2003-04-10 23:10

Thank you! One more question, if you don't mind. I've read that the new versions update the number of hubs a user is connected to every so often. Will the script kick them if they go over my limit, after they've already successfully connected to my hub, when their hub number updates or will it only get them upon entrance?

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

Post by ButterflySoul » 2003-04-10 23:31

Will the script kick them if they go over my limit, after they've already successfully connected to my hub, when their hub number updates or will it only get them upon entrance?


This script is based on a reception of a $MyInfo string. The feature you are talking about is precisely not to send such a string too often, in order to ease on the hub bandwidth load and the processing load generated by these strings.

That said, if the script receives a string from someone over the limit, it will get rid of them, so yes, it will work if the users' hub number updates; there might just be a small delay between the moment the user actually connected to another hub and the moment it sends an updated string (bout a minute or so).
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

Animated 0wner
Posts: 36
Joined: 2003-04-09 09:04

Post by Animated 0wner » 2003-04-10 23:44

The script doesn't work. After running it, I went through and found a person over my limit and kicked them. Then I cleared their ip from the temp ban list and waited. The user was able to get back in, still over my limit. Thanks anyways guys, I really appreciate the effort.

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

Post by TasMan » 2003-04-11 00:36

Sorry....it's a simple problem....as I said before I'm using to regular VB

Find this

Code: Select all

...
        If InStrB(1, sCurData, "/") Then
          Dim aTmp()

          aTmp = Split(sCurData, "/")
...


and replace that with

Code: Select all

...
        If InStrB(1, sCurData, "/") Then
          Dim aTmp

          aTmp = Split(sCurData, "/")
...


Just a stupid mistake, but hey it's free :)
Shadows Direct Connect Hub - Taking away the light from NMDCH, leaving only shadows.....

Animated 0wner
Posts: 36
Joined: 2003-04-09 09:04

Post by Animated 0wner » 2003-04-11 01:09

Thanks! It works! I really appreciate it man!

Who is online

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