Minimum Required Slots?!?

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

Locked
bl4cKz4cK
Posts: 5
Joined: 2004-02-24 07:10

Minimum Required Slots?!?

Post by bl4cKz4cK » 2004-02-24 07:42

I've installed a Script which checks if the user has at least 3 slots open. But it didn't work! It is still possible to connect with less than 3 slots open! Can somebody post a WORKING script and explain -exactly- howto install it?

THX @ All

Todi
Forum Moderator
Posts: 699
Joined: 2003-03-04 12:16
Contact:

Post by Todi » 2004-02-24 08:16

It usually helps to mention what script language you are using, and which hub you are running. Pasting your script here might help also, if it's not too long.

bl4cKz4cK
Posts: 5
Joined: 2004-02-24 07:10

Post by bl4cKz4cK » 2004-02-24 08:27

Neo Modus Direct Connect Hub (v1.0)





My Script:

Code: Select all

dim firsttimer
dim secondtimer
Sub DataArival(index, sCurData)
dim seb
dim hub
dim slot
dim maxhubs
dim minslotperhub
dim maxslots
dim kick
Dim botname
if index.boperator = true then exit sub
botname = "BOT"
maxhubs = 5
minslotperhub = 1
maxslots = 15
kick = "false"
if instr(lcase(scurdata),lcase("$MyInfo")) <> 0 then
seb = left(scurdata,instr(scurdata,"$ $") -1)
if right(seb,1) = ">" then

seb = right(seb,len(seb) - instr(scurdata,"<++ ") -3)
do while true
if instr(seb, "<++") = 0 then 
exit do
end if
seb = right(seb,len(seb) - instr(seb,"<++")-3)
loop
hub = left(seb,instr(seb, ",S:") -1)
hub = right(hub, len(hub) - instr(hub, "H:") -1)
if instr(seb, "O:") then
slot= left(seb,instr(seb, "O") -1)
else
slot= left(seb,instr(seb, ">") -1)
end if
slot = right(slot, len(slot) - instr(slot, "S:") -1)

if int(hub) > maxhubs then
index.SendChatMessage cstr(botname), "The hub limit is " & maxhubs & ". You are in " & hub & ".That's too much, so close some before you get back"
kick = "true"
end if
if int(slot) > maxslots then
index.SendChatMessage cstr(botname), "The slot limit is " & maxslots & ". You have " & slot & ".That's too much, so close some before you get back"
kick = "true"
end if
seb1 = int(hub)
seb2 = int(slot)
if seb2/seb1 < minslotperhub then
index.SendChatMessage cstr(botname), "You are suppossed to have " & minslotperhub & " slots per hub, but you are in " & hub & " hub and only have " & slot & " slots open. So open " & minslotperhub * hub & " slots and try again!"
kick = "true"
end if
if kick = "true" then
if instr(firsttimer, "|" & index.sname & "|") <> 0 then
firsttimer = Replace(firsttimer, index.sname, "", 1, -1, 1)
secondtimer = secondtimer & "|" & index.sname & "|"
elseif instr(secondtimer, "|" & index.sname & "|") <> 0 then
secondtimer = Replace(secondtimer, index.sname, "", 1, -1, 1)
index.SendChatMessage cstr(botname), "This is your third offense, therefore, you get a permban!"
frmHub.lstPermBan.addItem index.ip
else
firsttimer = firsttimer & "|" & index.sname & "|"
end if
frmhub.DoEventsForMe
index.kick
else
index.SendChatMessage cstr(botname), "Welcome " & index.sname & "! You are using DC++ and are in " & hub & " hubs and have " & slot & " slots open."
end if
end if
end if
end sub

bl4cKz4cK
Posts: 5
Joined: 2004-02-24 07:10

Post by bl4cKz4cK » 2004-02-24 08:28

this is the original script, i've set minslotperhub = 3 but it don't work

joakim_tosteberg
Forum Moderator
Posts: 587
Joined: 2003-05-07 02:38
Location: Sweden, Linkoping

Post by joakim_tosteberg » 2004-02-24 08:40

If you try te set kick="true" instead of kick="false", does it help?

Todi
Forum Moderator
Posts: 699
Joined: 2003-03-04 12:16
Contact:

Post by Todi » 2004-02-24 08:46

Looks like a pretty poorly written script, compared to some i've seen. At a first glance it doesn't seem to support DC++'s newer hubtag either, in the 1/0/0 format. As far as installation goes, you only need to put the scripname.script file in a folder called Scripts, that is located in your hub installation folder.

I'm not sure if this one does either, but you can try it. Otherwise you've always got Generalbot which can handle this and much more.

bl4cKz4cK
Posts: 5
Joined: 2004-02-24 07:10

Post by bl4cKz4cK » 2004-02-24 08:51

i changed it....
still the same problem...

shouldn't i see some messages from the script in the dc++ status window?

--> The hub limit is " & maxhubs & ". You are in " & hub & ".That's too much, so close some before you get back........

but there arent any of these messages?!?!

the script is in the /script folder of the direct connect hub folder! i also can edit it with the script editor of the direct connect hub programm!

bl4cKz4cK
Posts: 5
Joined: 2004-02-24 07:10

Post by bl4cKz4cK » 2004-02-24 09:05

Big THX! It works now with General Bot!

:D

Locked