Minimum Required Slots?!?
Moderator: Moderators
Minimum Required Slots?!?
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
THX @ All
Neo Modus Direct Connect Hub (v1.0)
My Script:
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
-
- Forum Moderator
- Posts: 587
- Joined: 2003-05-07 02:38
- Location: Sweden, Linkoping
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.
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.
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!
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!