Hi
I'm running the Dark-Minds script, and it has built in anti dupe IP address. This is fine, but there are a few ISP's arround who give all their users the same static IP. Is there anyway to change the script so that it will allow registered users to bypass this dupe check. I know you can turn the check off, but I would like to still use it.
This is the part of the script that I think needs changing
Quoteif CloneKiller == 1 then
frmHub:EnableFullData(1)
if (strsub(data,1,8) == "$GetINFO") then
local _,_, test = strfind(data,"$GetINFO%s+(%S+)%s+")
if test ~= curUser.sName then
Test = GetItemByName(test)
if Test ~= nil then
if Test.sIP == curUser.sIP and not Test.bOperator and not curUser.bOperator then
SendPmToOps("Hub-Security","Name/Ip "..curUser.sName.."/"..curUser.sIP.." was trying to connect but he was already connected with Name/Ip "..Test.sName.."/"..Test.sIP)
curUser:SendPM(Bot,"No clones in this hub.. You are already connected with Name/Ip "..Test.sName.."/"..Test.sIP)
curUser:Disconnect()
end
end
end
Any ideas anyone
Thanks in advance
Twix
Hmm, I can not test PART of the script, can you please paste here whole script or at least whole function?
Ok, here's part 1 of the lua file:
Quoteassert(dofile("Dark-Minds.Settings.ini"),"Dark-Minds.Settings.ini not found")
assert(dofile("Dark-Minds/Functions.Cmdes.lua"),"Dark-Minds/Functions.Cmdes.lua not found")
assert(dofile("Dark-Minds/hubtag.lua"),"Dark-Minds/hubtag.lua not found")
assert(dofile("Dark-Minds/Users.Connect.lua"),"Dark-Minds/Users.Connect.lua not found")
assert(dofile("Dark-Minds/UserInfo.lua"),"Dark-Minds/UserInfo.lua not found")
assert(dofile("Dark-Minds/Whois.lua"),"Dark-Minds/Whois.lua not found")
assert(dofile("Dark-Minds/commands.lua"),"Dark-Minds/commands.lua not found")
assert(dofile("Dark-Minds/Save.Load.lua"),"Dark-Minds/Save.Load.lua not found")
FAQ = "Dark-Minds-txt/Faq.txt"
HELP = "Dark-Minds-txt/Help.txt"
OHELP = "Dark-Minds-txt/Ophelp.txt"
MHELP = "Dark-Minds-txt/Masterhelp.txt"
VHELP = "Dark-Minds-txt/Viphelp.txt"
RULES = "Dark-Minds-txt/Rules.txt"
NETWORK = "Dark-Minds-txt/Network.txt"
NEWS = "Dark-Minds-txt/News.txt"
ADVERT = "Dark-Minds-txt/Advert.txt"
MTODU = "Dark-Minds-txt/mtod.users.txt"
MTODOP = "Dark-Minds-txt/mtod.opar.txt"
SAVEWARN= "Dark-Minds-save/warn.save.txt"
SAVEKICK= "Dark-Minds-save/kick.save.txt"
BOOK = "Dark-Minds-save/GuestBook.txt"
ADVERT = "Dark-Minds-save/advert.txt"
userArray = {}
chArray = {}
PmCount = {}
MainCount = {}
infoArray = {}
Share = {}
Kicked = {}
ReasonKick = {}
BOTS_INFO = "$MyINFO $ALL "..Bot.." V0.1 Made by Cane and ankan $ $Satellite$$0$|"
function Main()
SendToAll(BOTS_INFO)
loadfile(SAVEWARN)
SendToAll(KickMsg)
loadfile(SAVEKICK)
StartTimer()
ReStart()
StartChat()
frmHub:RegBot(Bot)
end
LastWarn = {}
handle = {}
Warn = {}
Kicked = {}
Mkicks = {}
Pass = {}
Fake = {}
----------------------------------------------------- - Function Load Warnings - -----------------------------------------------------
function loadfile (SAVEWARN)
assert(readfrom(SAVEWARN))
dostring(read("*all"))
readfrom()
end
----------------------------------------------------- - Function LoadKicks - -----------------------------------------------------
function loadfile (SAVEKICK)
assert(readfrom(SAVEKICK))
dostring(read("*all"))
readfrom()
end
----------------------------------------------------- - Function DataArrivall - -----------------------------------------------------
function DataArrival(curUser,data)
--Darks Chat
if DarkMindsChat == 1 then
if curUser.iProfile ~= -1 then
if strsub(data, 1, 5) == "$To: " and strsub(data, 6, strlen(ChatName) + 5) == ChatName then
data = strsub(data, 1, strlen(data) - 1)
local _,_,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
local aProfiles = GetProfiles()
for i = 0, getn(aProfiles) do
local aUsers = GetUsersByProfile(aProfiles)
for i = 0, getn(aUsers) do
if aUsers ~= from then
local user = GetItemByName(aUsers)
if user then user:SendData("$To: "..aUsers.." From: "..ChatName.." $<"..from.."> "..msg) end
end
end
end
end
end
end
--MLDC CHECK
if MldcCheck == 1 then
if (strsub(data,1,7) == "$MyINFO") and curUser.bOperator == nil then
for i,v in ANTIWORDS do
Find = strlower(data)
if strfind(Find,v,1,1) then
curUser:SendData(Bot,"You have a client that we dont want in the hub.")
curUser:Disconnect()
do return end
end
end
end
end
--ONLYDC CHECK
if CloneKiller == 1 then
frmHub:EnableFullData(1)
if (strsub(data,1,8) == "$GetINFO") then
local _,_, test = strfind(data,"$GetINFO%s+(%S+)%s+")
if test ~= curUser.sName then
Test = GetItemByName(test)
if Test ~= nil then
if Test.sIP == curUser.sIP and not Test.bOperator and not curUser.bOperator then
SendToOps(Bot,"Name/Ip "..curUser.sName.."/"..curUser.sIP.." was trying to connect but he was already connected whit Name/Ip "..Test.sName.."/"..Test.sIP)
curUser:SendPM(Bot,"No clones in this hub.. You are already connected whit Name/Ip "..Test.sName.."/"..Test.sIP)
curUser:Disconnect()
end
end
end
end
end
if OnlyDc == 1 then
if strfind(data, "<++") then
elseif strsub(data,1,7) == "$MyINFO" then
curUser:SendData(Bot,"We only want dc++/oDc in this hub so download dc at: http://dcplusplus.sourceforge.net/ ")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
end
--BADFILES CHECK
if BadFilesCheck == 1 then
if( strsub(data, 1, 3) == "$SR" ) then
local _,_,nick = strfind( data, "\05(%S*)|$" )
if nick == Bot and Kicked[curUser.sName] == nil then
Kicked[curUser.sName] = 1
local _,_, test = strfind(data,"$SR%s+%S+(.*)%d+%s+%d+/%d+")
Reason = FindWhat(data)
if test == nil then test = BadFilesMsgNil else test = test end
SendToOps(Bot,""..curUser.sName.." was kicked bacuse: "..test)
curUser:SendPM(Bot,"Dont share "..Reason..".. I fund it in the directory: "..test)
curUser:TempBan()
end
end
end
--NOT WANTED ISP CHECK
if NotWantedIspCheck == 1 then
if (strsub(data,1,7) == "$MyINFO") and curUser.iProfile == -1 then
for i,v in NOTWANTEDISPS do
name = strlower(curUser.sName)
if strfind(name,v,1,1) then
curUser:SendData(Bot,"You are not op her so remove "..v.." from your name")
curUser:Disconnect()
end
end
end
end
--ANTI ADVERTS CHECK
if AdvertCheck == 1 then
if (strsub(data,1,1) == "<") and not curUser.bOperator then
data = strlower(data)
for key,pr in Promotion do
if strfind(data,pr) then
to,what = AdvertsFindMain(data)
SendPmToNick(curUser.sName,Bot,"Dont do promotion.")
SendPmToOps(Bot,"Name/ip "..curUser.sName.."/"..curUser.sIP.." was kicked for promotion he wrote: "..what)
appendto(ADVERT)
write("\r\nAt: "..date("%D").." Kl: "..date("%T").." was Name/ip "..curUser.sName.."/"..curUser.sIP.." kicked for promotion he wrote: "..what)
writeto()
curUser:TempBan()
do return 1 end
end
end
end
end
if AdvertCheck == 1 then
if (strsub(data,1,4) == "$To:") and not curUser.bOperator then
data = strlower(data)
for key,pr in Promotion do
if strfind(data,pr) then
to,what = AdvertsFindPm(data)
SendPmToNick(curUser.sName,Bot,"Dont do promtion.")
SendPmToOps(Bot,"Name/Ip "..curUser.sName.."/"..curUser.sIP.." was kicked for promotion he wrote it too "..to.." and he wote: "..what)
appendto(ADVERT)
write("\r\nAt: "..date("%D").." Kl: "..date("%T").." was Name/Ip "..curUser.sName.."/"..curUser.sIP.." kicked for promotion he wrote it too "..to.." and he wote: "..what)
writeto()
curUser:TempBan()
do return 1 end
end
end
end
end
--LAST TIME KICK CHECK
if strsub(data,1,4) == "$To:" and strfind(data,"because:") then
local _,_, who,op,why = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%S+%s+You%s+are%s+being%s+kicked%s+because:(.*)")
if who~=nil and op~=nil and why~=nil then
op = GetItemByName(op)
if op~= nil and op.bOperator then
who = GetItemByName(who)
if who~= nil then
ReasonKick[who.sName] = (curUser.sName.." last kick was: "..why)
local _,_, I = strfind(data,"$Kick")
end
end
end
end
--3 KICK UNTIL BAN CHECK
if MaxKickUntilBanCheck == 1 then
if strsub(data,1,5) == "$Kick" then
local _,_, names = strfind(data,"$Kick+%s+(%S+)|")
NAME = GetItemByName(names)
if NAME ~= nil then
if Mkicks[NAME.sName] == nil then
Mkicks[NAME.sName]=1
else
Mkicks[NAME.sName] = Mkicks[NAME.sName]+1
end
if Mkicks[NAME.sName] == MaxKicks then
SendToAll(Bot,"Name/Ip "..curUser.sName.."/"..curUser.sIP.." was banned beacuse: "..MaxKicks.."/Kicks")
Mkicks[NAME.sName] = nil
NAME:Ban()
end
end
end
end
--MINDC VERSION CHECK
and here's part 2:
Quote--MaxHubs check
if (strsub(data,1,7) == "$MyINFO") and curUser.bOperator == nil and curUser.iProfile ~= 2 then
local _,_, Hubs = strfind(data,"H:(%d+)")
local _,_, DcVer = strfind(data,"V:(%d.%d+),")
local _,_, Slots = strfind(data,"S:(%d+)")
local _,_, Share = strfind(data,"$%s+$.*$.*$(%d+)$|")
if Hubs == nil and MaxHubsCheck == 1 then
curUser:SendData(Bot,"I cant check your hubratio.")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if Slots == nil and MinSlotsCheck == 1 and MaxSlotsCheck == 1 then
curUser:SendData(Bot,"I cant check your slots")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if Share == nil and MinShareCheck == 1 and MaxShareCheck == 1 then
curUser:SendData(Bot,"I cant check your share.")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if DcVer ~= nil and DcVerCheck == 1 then
if (tonumber(DcVer) < DcVersion ) then
curUser:SendData(Bot,"Your dc++ version is to old so download the newest one at: http://dcplusplus.sourceforge.net/")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if (tonumber(Hubs) > MaxHubs) and MaxHubsCheck == 1 then
curUser:SendData(Bot,"you are in to many hubs.("..Hubs.."). Max hubs is ("..MaxHubs..")")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if (tonumber(Slots) < MiniS) and MinSlotsCheck == 1 then
curUser:SendData(Bot,"You have too litle slots open. ("..Slots.."). Minislots is ("..MiniS..")")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
elseif (tonumber(Slots) > MaxS) and MaxSlotsCheck == 1 then
curUser:SendData(Bot,"You have to many slots open ("..Slots.."). Maxslots is ("..MaxS..")")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if (tonumber(Share) < MINGB) and MinShareCheck == 1 then
curUser:SendData(Bot,"You have to little share. Minishare is ("..MINGB/(1024^3)..") Gb" )
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
if (tonumber(Share) > MAXGB) and MaxShareCheck == 1 then
curUser:SendData(Bot,"You have to bigg share . Maxshare is ("..MAXGB/(1024^3)..") Gb")
if Redirect == 1 then
curUser:SendData("$ForceMove "..frmHub:GetRedirectAddress())
end
curUser:Disconnect()
end
end
end
--VIPSHARE CHECK
if VipShareCheck == 1 then
if (strsub(data,1,7) == "$MyINFO") and curUser.bOperator == nil and curUser.iProfile == 2 then
local _,_, Share = strfind(data,"$%s+$.*$.*$(%d+)$|")
if Share ~= nil then
if (tonumber(Share) < MINGBVIP) then
curUser:SendData(Bot,"You have too little share minishare for vip is ("..MINGBVIP/(1024^3)..") Gb")
curUser:Disconnect()
end
end
end
end
if (strsub(data,1,1) == "<") then
data=strsub(data,1,strlen(data)-1)
local s,v, cmd = strfind(data, "%b<>%s+(%S+)")
----------------------------------------------------- - Function Normal Commands - -----------------------------------------------------
if (cmd ==Prefix.."help") and (help == 1) then
SendHelp(curUser)
return 1
elseif (cmd ==Prefix.."rules") and (rules == 1) then
dorules(curUser)
return 1
elseif (cmd ==Prefix.."network") and (network == 1) then
donetwork(curUser)
return 1
elseif (cmd ==Prefix.."faq") and (faq == 1) then
dofaq(curUser)
return 1
elseif (cmd ==Prefix.."report") and (report == 1) then
doreport(curUser,data)
return 1
elseif (cmd ==Prefix.."away") and (away == 1) then
doaway(curUser,data)
return 1
elseif (cmd ==Prefix.."myip") and (myip == 1) then
SendPmToNick(curUser.sName,Bot,"Your ip is ("..curUser.sIP..")")
return 1
elseif (cmd ==Prefix.."show") and (show == 1) then
doshowprofile(curUser,data)
return 1
elseif (cmd ==Prefix.."regme") and (regme == 1) then
doregme(curUser,data)
do return 1 end
elseif (cmd ==Prefix.."time") and (time == 1) then
dotime(curUser)
return 1
elseif (cmd ==Prefix.."hublist") and (hublist == 1) then
doHubList(curUser)
return 1
elseif (cmd ==Prefix.."join") and (join == 1) then
doJoin(curUser,data)
return 1
elseif (cmd ==Prefix.."wguestbook") and (wguestbook == 1) then
doGuestBook(curUser,data)
return 1
elseif (cmd ==Prefix.."rguestbook") and (rguestbook == 1) then
doReadGuest(curUser)
return 1
elseif (cmd ==Prefix.."rednews") and (rednews == 1) then
dorednews(curUser,data)
return 1
end
----------------------------------------------------- - Function VIP Commands - -----------------------------------------------------
if curUser.iProfile < 2 and curUser.iProfile ~= -1 then
if (cmd ==Prefix.."hubinfo") and (hubinfo == 1) then
dohubinfo(curUser,data)
return 1
elseif (cmd ==Prefix.."offline") and (offline == 1) then
SendOffLine(curUser,data)
return 1
end end
----------------------------------------------------- - Function Operator Commands - -----------------------------------------------------
if curUser.bOperator then
if (cmd ==Prefix.."clrtemp") and (clrtemp == 1) then
ClearTempBan()
curUser:SendData(Bot,TempBanMsg)
return 1
elseif (cmd ==Prefix.."mass") and (mass == 1) then
domass(curUser,data)
return 1
elseif (cmd ==Prefix.."kick") and (kick == 1) then
dokick(curUser,data)
return 1
elseif (cmd ==Prefix.."drop") and (drop == 1) then
dodrop(curUser,data)
return 1
elseif (cmd ==Prefix.."kickban") and (kickban == 1) then
dokickban(curUser,data)
return 1
elseif (cmd ==Prefix.."unban") and (unban == 1) then
dounban(curUser,data)
return 1
elseif (cmd ==Prefix.."visits") and (visits == 1) then
douserinfo(curUser,data)
return 1
elseif (cmd ==Prefix.."timeban") and (timeban == 1) then
dotimeban(curUser,data)
return 1
elseif (cmd ==Prefix.."addregs") and (addregs == 1) then
doaddregs(curUser,data)
return 1
elseif (cmd ==Prefix.."wnews") and (wnews == 1) then
dowritenews(curUser,data)
return 1
elseif (cmd ==Prefix.."dnews") and (dnews == 1) then
dodelitnews(curUser,data)
return 1
elseif (cmd ==Prefix.."warn") and (warn == 1) then
dowarn(curUser,data)
return 1
elseif (cmd ==Prefix.."getinfo") and (getinfo == 1) then
dogetinfo(curUser,data)
return 1
elseif (cmd ==Prefix.."getwarn") and (getwarn == 1) then
dogetwarn(curUser)
return 1
elseif (cmd ==Prefix.."getkicks") and (getkicks == 1) then
dogetkicks(curUser,data)
return 1
elseif (cmd ==Prefix.."info") and (info == 1) then
doinfo(curUser,data)
return 1
elseif (cmd ==Prefix.."red") and (red == 1) then
dored(curUser,data)
return 1
elseif (cmd ==Prefix.."redpass") and (redpass == 1) then
doredpass(curUser,data)
return 1
elseif (cmd ==Prefix.."fake") and (fake == 1) then
dofake(curUser)
return 1
elseif (cmd ==Prefix.."whois") and (whois == 1) then
dowhois(curUser,data)
return 1
elseif (cmd ==Prefix.."advert") and (advert == 1) then
doadvert(curUser)
return 1
----------------------------------------------------- - Function PtokaX Commands - -----------------------------------------------------
elseif cmd =="!nickban" then
return 0
elseif cmd =="!banip" then
return 0
elseif cmd =="!getbanlist" then
return 0
elseif cmd =="!clrpermban" then
return 0
elseif cmd =="!op" then
return 0
elseif cmd =="!gag" then
return 0
elseif cmd =="!ungag" then
return 0
elseif cmd =="!ipinfo" then
return 0
elseif cmd =="!iprangeinfo" then
return 0
elseif cmd =="!userinfo" then
return 0
elseif cmd =="!me" then
return 0
elseif cmd =="!restartscripts" then
return 0
elseif cmd =="!restart" then
return 0
end
----------------------------------------------------- - Function Masters Commands - -----------------------------------------------------
if curUser.iProfile == 0 then
if (cmd ==Prefix.."chhubname") and (chhubname == 1) then
dohubname(curUser,data)
return 1
elseif (cmd==Prefix.."chhubdesc") and (chhubdesc == 1) then
dohubdesc(curUser,data)
return 1
elseif (cmd==Prefix.."chhubred") and (chhubred == 1) then
dohubred(curUser,data)
return 1
elseif (cmd==Prefix.."chredall") and (chredall == 1) then
doredall(curUser,data)
return 1
elseif (cmd==Prefix.."chredfull") and (chredfull == 1) then
doredfull(curUser,data)
return 1
elseif (cmd==Prefix.."chmtodusers") and (chmtodusers == 1) then
ChangeMtodUsers(curUser,data)
return 1
elseif (cmd==Prefix.."chmtodopar") and (chmtodopar == 1) then
ChangeMtodOpar(curUser,data)
return 1
elseif (cmd==Prefix.."chregserv") and (chregserv == 1) then
dochregserver(curUser,data)
return 1
elseif (cmd==Prefix.."chautoreg") and (chautoreg == 1) then
doautoreg(curUser,data)
return 1
elseif (cmd ==Prefix.."onlydc") and (onlydc == 1) then
doonlydc(curUser,data)
return 1
elseif (cmd==Prefix.."chmaxusers") and (chmaxusers == 1) then
dochangemaxusers(curUser,data)
return 1
elseif (cmd==Prefix.."chshare") and (chshare == 1) then
dochangeshare(curUser,data)
return 1
elseif (cmd==Prefix.."addops") and (addops == 1) then
doaddops(curUser,data)
return 1
elseif (cmd==Prefix.."flood") and (flood == 1) then
doflood(curUser,data)
return 1
elseif (cmd==Prefix.."delreg") and (delreg == 1) then
dodelreg(curUser,data)
return 1
elseif (cmd ==Prefix.."savewarn") and (savewarn == 1) then
curUser:SendData(Bot,"Warnings is saved..")
dosave(curUser)
return 1
elseif (cmd ==Prefix.."delwarn") and (delwarn == 1) then
curUser:SendData(Bot,"Warnings is delited..")
dodelwarn(curUser,data)
return 1
elseif (cmd ==Prefix.."savekicks") and (savekicks == 1) then
curUser:SendData(Bot,"Kicks count is saved..")
dosavekick(curUser)
return 1
elseif (cmd ==Prefix.."delkicks") and (delkicks == 1) then
curUser:SendData(Bot,"Kickscount is delited..")
dodelkick(curUser)
return 1
elseif (cmd==Prefix.."unreg") and (unreg == 1) then
frmHub:UnregBot(Bot)
curUser:SendData(Bot,"The bot is unreged..")
return 1
elseif (cmd==Prefix.."reg") and (reg == 1) then
frmHub:RegBot(Bot)
curUser:SendData(Bot,"The bot is reged..")
return 1
elseif (cmd==Prefix.."luacheck") and (luacheck == 1) then
SendPmToNick(curUser.sName,Bot,"The script is now using ("..gcinfo()..") Kb..")
SendPmToNick(curUser.sName,Bot,"And is using (".._VERSION..") Ver..")
return 1
elseif (cmd==Prefix.."fmain") and (fmain == 1) then
SendFakeMsg(curUser,data)
return 1
end
end
end
end
end
----------------------------------------------------- - Function Resstart - -----------------------------------------------------
function ReStart()
SendToAll(Bot,"Is being restared at: ("..date("%T")..") Kl: ("..date("%T")..") ")
end
function StartChat()
if DarkMindsChat == 1 then
frmHub:RegBot(ChatName)
else
frmHub:UnregBot(ChatName)
end
end