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 = "Subzero"
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
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 = "Subzero"
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.BanIP index.ip
else
firsttimer = firsttimer & "|" & index.sname & "|"
end if
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