My new hole from the begining no copy/paste Client checker.
-- CLIENT CHECKER
--=================
-- Ver.: 0.7
-- By: NightLitch
-- Date: 2004/01/22
--=================
AllowClient = {
["++"] = "DC++",
["><"] = "oDC",
["oDC"] = "oDC",
["DC"] = "NeoModus",
["DCGUI"] = "DcGui",
["http://dc.ketelhot.de"] = "DcGui",
["DC:PRO"] = "DcPro",
}
function ParseMyInfo(MyInfo)
local s,e,vTag = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%s([^$<>]+)>%$" )
local s,e,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
local vShare = vShare / (1024 * 1024 * 1024)
local vShare = format("%.2f",vShare)
for t,n in AllowClient do
if strfind(MyInfo,t) then
vClient = n
end
end
return vClient, vTag, vSpeed, vShare
end
function GetTagInfo(vTag)
local _,_,DcVer = strfind(vTag, "V:(%x+.%x*)")
local _,_,Mode = strfind(vTag, "M:([S,A,P,5])")
local _,_,Hubs = strfind(vTag, "H:(%d+/%d+/%d+)")
local _,_,Slots = strfind(vTag, "S:(%d+)")
if strfind(vTag, "L:(%d+)") then
local _,_,Ls = strfind(vTag, "L:(%d+)")
Bwidh = Ls
elseif strfind(vTag, "B:(%d+)") then
local _,_,Bs = strfind(vTag, "B:(%d+)")
Bwidh = Bs
elseif strfind(vTag, "F:(%d+)/%d+") then
local _,_,Fs = strfind(vTag, "F:(%d+)/%d+")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if Hubs == nil then
FakeClient = 1
else
local _,_,Hub,RegHub,OpHub = strfind(Hubs, "(%d+)/(%d+)/(%d+)")
end
return DcVer, Mode, Slots, Hub, RegHub, OpHub, Bwidh
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
if vClient == nil then
curUser:SendData("Client-Check",curUser.sName.." Your Client is not allowed here!")
curUser:Disconnect()
elseif vTag == nil then
curUser:SendData("No-Tag",curUser.sName.." you are hidding your Tag!")
curUser:Disconnect()
end
local DcVer, Mode, Slots, Hub, RegHub, OpHub, Bwidh = GetTagInfo(vTag)
if FakeClient == 1 then
curUser:SendData("Faker",curUser.sName.." you are using a Fake Client")
curUser:Disconnect()
FakeClient = 0
end
end
Checking slots, hubs, versions will come later.
NOTE! This is in User Connect so this is just to show my upcoming script.
Will be rewritten in Data Arrival soon!!
Hope you all like it.
And Plop, Chilla, Phatty, Tezlo and others,
Tell me what I can think of in this script, my point is to
fakers now.
And improvments.
k
If I make it as it is now to local client is nil...
but gonna work on this some more later.
just notice one thing, and I find your function I got is better. gonna check it out more...
Cause getting wrong version on old oDC
k
Nightlitch
AllowClient = {
["++"] = "DC++",
["><"] = "oDC",
["oDC"] = "oDC",
["DC"] = "NeoModus",
["DCGUI"] = "DcGui",
["http://dc.ketelhot.de"] = "DcGui",
["DC:PRO"] = "DcPro",
}
what about non-allowed clients?
like dc++k or black dc
i think it is better to make a list of al clients and then with the option to allow or not allow.
and i had a normal user using odc who had his tag but i had in ptotax the option turned on dont allow clients with no dc++ tag on and he could,nt get in.
so perhaps a warn on this one should be better.
elseif vTag == nil then
curUser:SendData("No-Tag",curUser.sName.." you are hidding your Tag!")
curUser:Disconnect()
but i like the idear alot and perhaps if yuu asked phatty he could give you some descriptions on various tags; cause i know he was trying to do the same.
Here's a update, and this should work with out no bigger problems expect it doesn't detect fake hubs yet.
-- CLIENT CHECKER
--=================
-- Ver.: 1.03
-- By: NightLitch
-- Date: 2004/01/23
--=================
Bot = "Z-LeZ"
AllowClient = {
["<++"] = "DC++",
["["["["["http://dc.ketelhot.de"] = "DcGui",
["}
function ParseMyInfo(MyInfo)
local s,e,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
local vShare = vShare / (1024 * 1024 * 1024)
local vShare = format("%.2f",vShare)
for t,n in AllowClient do
if strfind(MyInfo,t) then
vClient = n
end
end
if strfind(MyInfo,"><") then
local _,_,DcVer = strfind(MyInfo , "")
Version = DcVer
else
local _,_,DcVer = strfind(MyInfo , "V:(.+),M")
Version = DcVer
end
local _,_,Mode = strfind(MyInfo , "M:([S,A,P,5])")
local _,_,Hubs = strfind(MyInfo , "H:(%S+),S")
local _,_,Slots = strfind(MyInfo , "S:(%d+)")
if strfind(MyInfo, "L:(%d+)") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:(%d+)") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:(%d+)/%d+") then
local _,_,Fs = strfind(MyInfo , "F:(%d+)/%d+")
Bwidh = Fs
else
Bwidh = "unlimited"
end
vTag = { ["V"] = Version, ["M"] = Mode, ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
if vTag == nil then
vTag = { ["V"] = "N/A", ["M"] = "N/A", ["H"] = "N/A", ["S"] = "N/A", ["B"] = "N/A"}
end
return vClient, vTag, vSpeed, vShare
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n My Info Check "
Msg = Msg .. "\r\n---------------------"
Msg = Msg .. "\r\n Client: "..vClient..""
Msg = Msg .. "\r\n Version: "..vTag["V"]..""
Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
Msg = Msg .. "\r\n Bandwidh: "..vTag["B"]..""
Msg = Msg .. "\r\n---------------------"
curUser:SendData(Bot,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
if vClient == nil then
curUser:SendData(Bot,curUser.sName.." Your Client is not allowed here!")
curUser:Disconnect()
elseif vTag == nil then
curUser:SendData(Bot,curUser.sName.." You are hidding your Tag!")
curUser:Disconnect()
end
end
end
and Trucker about the client tag above is the most common clients.
dc++k have the same Tag as Dc++ ( <++ )
better use DC++ CMD then.
and Black DC can't be script or I don't know how.
k
QuoteOriginally posted by NightLitch
Here's a update, and this should work with out no bigger problems expect it doesn't detect fake hubs yet.
and Trucker about the client tag above is the most common clients.
dc++k have the same Tag as Dc++ ( <++ )
better use DC++ CMD then.
and Black DC can't be script or I don't know how.
the old k fakers series have a k behind the version number.
a simple way 2 capture those is not 2 only search for a number but also for the K.
plop
k, thx alot plop, your words mean so much for me, like your
opinions thx.
Gonna optimize it more. As it say's above this is my first
client check without copy/paste. So the strfind is a little
new still for me.
/NL
IF I can make vClient local pls show me... I don't get it working...
Am using Chilla's strfind/info line now.
Chilla maybe you could explain for me how you mean with
local vClient ???
notice I gave Plop the credits and forgot you. sry.
got me, damn I feel like a baby.
just also do
function ParseMyInfo(MyInfo)
local vClient = "N/A"
or
local Client = ""
depends on what you need
ThX forgot I could do it like that. Thx Chilla.
what about this one then:
-- CLIENT CHECKER
--=================
-- Ver.: 1.05
-- By: NightLitch
-- Date: 2004/01/23
--=================
Bot = "Z-LeZ"
AllowClient = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "<%+%+%k","DC++k" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "}
function ParseMyInfo(MyInfo)
local vClient = "UnKnown"
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
local vShare = vShare / (1024 * 1024 * 1024)
local vShare = format("%.2f",vShare)
for i = 1,getn(AllowClient) do
if strfind(MyInfo,AllowClient[i][1]) then
vClient = AllowClient[i][2]
end
end
local _,_,DcVer,Mode,Hubs,Slots = strfind( MyInfo, "V:(%S+),M:([S,A,P,5]),H:(%S+),S:(%d+),")
if strfind(MyInfo,"><") then
local _,_,DcVer = strfind(MyInfo , "")
end
if strfind(MyInfo, "L:(%d+)") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:(%d+)") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:(%d+)/%d+") then
local _,_,Fs = strfind(MyInfo , "F:(%d+)/%d+")
Bwidh = Fs
else
Bwidh = "unlimited"
end
vTag = { ["V"] = DcVer, ["M"] = Mode, ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
return vClient, vTag, vSpeed, vShare
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n My Info Check "
Msg = Msg .. "\r\n---------------------"
Msg = Msg .. "\r\n Client: "..vClient..""
Msg = Msg .. "\r\n Version: "..vTag["V"]..""
Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
Msg = Msg .. "\r\n Bandwidh: "..vTag["B"]..""
Msg = Msg .. "\r\n---------------------"
curUser:SendData(Bot,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
--
-- if vClient == nil then
-- curUser:SendData(Bot,curUser.sName.." Your Client is not allowed here!")
-- curUser:Disconnect()
-- elseif vTag == nil then
-- curUser:SendData(Bot,curUser.sName.." You are hidding your Tag!")
-- curUser:Disconnect()
-- end
end
end
Come with more opinions. plz. optimizing etc.
the version number not the start of the tag on k, for example.
<++ V:0.178k, etc.....
no need 2 declare vShare 2 being local 4x, the 1st time you use it is enough.
plop
thx Plop. anymore I should now. One question do, I faked my Tag enormuslly in your hub and got kicked.
but got in, in mine. why. get kick came on hubs. and I didn't fake with " " just used NMDC EMU and put in a hole tag. What did your check sence or do, other words
how did you script that part.
Yet another new version:
-- CLIENT CHECKER
--=================
-- Ver.: 1.07
-- By: NightLitch
-- Date: 2004/01/24
--=================
Bot = "Z-LeZ"
AllowClient = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "}
function ParseMyInfo(MyInfo)
local vClient = "UnKnown"
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
vShare = vShare / (1024 * 1024 * 1024)
vShare = format("%.2f",vShare)
for i = 1,getn(AllowClient) do
if strfind(MyInfo,AllowClient[i][1]) then
vClient = AllowClient[i][2]
end
end
local _,_,DcVer,Mode,Hubs,Slots = strfind( MyInfo, "V:(%S+),M:([S,A,P,5]),H:(%S+),S:(%d+),")
if strfind(MyInfo,"><") then
local _,_,DcVer = strfind(MyInfo , "")
end
if strfind( MyInfo,"V:%S+(k),M") then
vClient = "DC++k"
end
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if strfind(MyInfo,"H:(\")%d+/") then
vClient = "Fake"
end
tMode = {
["S"] = "Socks",
["A"] = "Active",
["P"] = "Passive",
["5"] = "Socks5",
}
vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
return vClient, vTag, vSpeed, vShare
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n My Info Check "
Msg = Msg .. "\r\n---------------------"
Msg = Msg .. "\r\n Client: "..vClient..""
Msg = Msg .. "\r\n Version: "..vTag["V"]..""
Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
Msg = Msg .. "\r\n Bandwidh: "..vTag["B"].." kB/s"
Msg = Msg .. "\r\n---------------------"
curUser:SendData(Bot,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
if vClient == nil then
curUser:SendData(Bot,curUser.sName.." no tag info found!")
curUser:Disconnect()
end
if vClient == "Fake" then
curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
curUser:Disconnect()
end
end
end
analyse this one to... :-D
QuoteOriginally posted by NightLitch
thx Plop. anymore I should now. One question do, I faked my Tag enormuslly in your hub and got kicked.
but got in, in mine. why. get kick came on hubs. and I didn't fake with " " just used NMDC EMU and put in a hole tag. What did your check sence or do, other words
how did you script that part.
don't know what you faked in the tag, but basicly what i do is kick/ban everything which is not normal.
a.i. is locked up like hell. lol
this is why i had sutch a lot of work 2 add support for the new odc tag.
the quick fix i tryed on that caused incompatebilety with testdrive so i had 2 rewrite nearly the whole core of the tag checking stuff.
but it was sure worth it, i can make it even more locked now.
for every client a.i. supports it has a dedicated routine (currently 7) 2 filter out as much as posible faked tags (if needed).
btw no need 2 build sutch things for dcgui, they can't fake unless they alter it in the source, mathen made it imposible 2 use the < > in the description.
plop
nightlitch
Perhaps it is an idear to add an on/off switch for each client so that any hubowner can decide wich to pass or wich to deny.
and i see your added socks5 could it fall under that to?
as it could be used to fake.
Will see what I can do, this client check was ment to be as simple as it can be.
cause gonna use it the script-builder(Bot-Builder) me
and WooshMan gonna/are creating.
But sure can add some more features l8r, np.
Here is some more features and updates hope you all like it.
-- CLIENT CHECKER
-- Ver.: 1.16
-- By: NightLitch
-- Date: 2004/01/25
---------------------------------------------------------------------
Bot = "Z-LeZ"
-- Allow Clients / 1:on/0:off
AllowDCPP = 1 -- DC++
AllowODC = 1 -- oDC
AllowNMDC2 = 1 -- Neo Modus DC 2
AllowDCGUI = 1 -- DcGui
AllowDCPRO = 1 -- DC:PRO
AllowNOTAG = 0 -- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0 -- Fake Client (Fake Taging)
-- Client Settings
MinSlots = 2
MaxSlots = 5
MaxHubs = 8
---------------------------------------------------------------------
ClientTAG = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "}
function ParseMyInfo(MyInfo)
local vClient = "Unknown"
local Bwidh = ""
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
vShare = vShare / (1024 * 1024 * 1024)
vShare = format("%.2f",vShare)
for i = 1,getn(ClientTAG) do
if strfind(MyInfo,ClientTAG[i][1]) then
vClient = ClientTAG[i][2]
end
end
local _,_,DcVer,Mode,Hubs,Slots = strfind( MyInfo, "V:(%S+),M:([S,A,P,5]),H:(%S+),S:(%d+),")
if strfind(MyInfo,"><") then
local _,_,DcVer = strfind(MyInfo , "")
end
if strfind( MyInfo,"V:%S+(k),M") then
vClient = "DC++k"
end
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if strfind(MyInfo,"H:(\")%d+/") then
vClient = "Fake"
end
if DcVer == nil or Mode == nil or Hubs == nil or Slots == nil then
DcVer = "N/A" Mode = "0" Hubs = "N/A" Slots = "N/A"
end
tMode = {
["S"] = "Socks",
["A"] = "Active",
["P"] = "Passive",
["5"] = "Socks5",
["0"] = "N/A",
}
vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
return vClient, vTag, vSpeed, vShare
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n My Info Check "
Msg = Msg .. "\r\n---------------------"
Msg = Msg .. "\r\n Client: "..vClient..""
Msg = Msg .. "\r\n Version: "..vTag["V"]..""
Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
Msg = Msg .. "\r\n Bandwidh: "..vTag["B"].." kB/s"
Msg = Msg .. "\r\n---------------------"
curUser:SendData(Bot,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
AllowClients(curUser,vClient)
end
end
function AllowClients(curUser,vClient)
if (vClient =="oDC" and AllowODC==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="DC++" and AllowDCPP==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="DCGUI" and AllowDCGUI==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="Fake" and AllowFAKE==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="Unknown" and AllowNOTAG==1) then
CheckSlotsHubs(curUser,vTag)
elseif (vClient =="Fake" and AllowFAKE==0) then
curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
curUser:Disconnect()
elseif (vClient =="Unknown" and AllowNOTAG==0) then
curUser:SendData(Bot,curUser.sName.." you are using a client with no tag!")
curUser:Disconnect()
else
curUser:SendData(Bot,curUser.sName..", "..vClient.." is not allowed here!")
curUser:Disconnect()
end
end
function CheckSlotsHubs(curUser,vTag)
if (tonumber(vTag["S"]) < MinSlots) then
curUser:SendData(Bot,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["S"]) > MaxSlots) then
curUser:SendData(Bot,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["H"]) > MaxHubs) then
curUser:SendData(Bot,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
curUser:Disconnect()
end
end
More too come.
Probobly the finished version I guess, but you never now...
-- CLIENT CHECKER
-- Version: 2.02
-- By: NightLitch
-- Date: 2004/01/25
---------------------------------------------------------------------
Bot = "Z-LeZ"
--Level Checks / 1:on/0:off
LC = {
[0] = 0, -- Check Masters
[1] = 0, -- Check Operators
[2] = 1, -- Check VIPs
[3] = 1, -- Check REGs
[-1] = 1, -- Check Users
}
-- Allow Clients / 1:on/0:off
AllowDCPP = 1 -- DC++
AllowODC = 1 -- oDC
AllowNMDC2 = 1 -- Neo Modus DC 2
AllowDCGUI = 1 -- DCGUI
AllowDCPRO = 1 -- DC:PRO
AllowNOTAG = 0 -- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0 -- Fake Client (Fake Taging)
-- Client Settings
MinSlots = 2 -- Min Slots
MaxSlots = 15 -- Max Slots
MaxHubs = 8 -- Max Hubs for users
LockBW = 10 -- Min Bandwidh Lock
-- Version Checks
DCPPver = 0.300 -- DC++ Min. Version
ODCver = 5.2 -- oDC Min. Version
NMDC2ver = 2.02 -- Neo Modus DC 2 Min. Version
DCPROver = "0.2.2.10" -- DC:PRO Min. Version
DCGUIver = "0.2.20" -- DCGUI Min. Version
---------------------------------------------------------------------
ClientTAG = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "}
function ParseMyInfo(MyInfo)
local vClient = "Unknown"
local Bwidh = ""
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
vShare = vShare / (1024 * 1024 * 1024)
vShare = format("%.2f",vShare)
for i = 1,getn(ClientTAG) do
if strfind(MyInfo,ClientTAG[i][1]) then
vClient = ClientTAG[i][2]
end
end
local _,_,DcVer,Mode,Hubs,Slots = strfind( MyInfo, "V:(%S+),M:([S,A,P,5]),H:(%S+),S:(%d+),")
if strfind(MyInfo,"><") then
local _,_,DcVer = strfind(MyInfo , "")
end
if strfind( MyInfo,"V:%S+(k),M") then
vClient = "DC++k"
end
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if strfind(MyInfo,"H:(\")%d+/") then
vClient = "Fake"
end
if DcVer == nil or Mode == nil or Hubs == nil or Slots == nil then
DcVer = "N/A" Mode = "0" Hubs = "N/A" Slots = "N/A"
end
tMode = {
["S"] = "Socks",
["A"] = "Active",
["P"] = "Passive",
["5"] = "Socks5",
["0"] = "N/A",
}
local _,_,Hubs,rHub,oHub = strfind(Hubs,"(%d+)/(%d+)/(%d+)")
vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
return vClient, vTag, vSpeed, vShare
end
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n Welcome "..curUser.sName.." !"
Msg = Msg .. "\r\n-------------------------------------------"
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n You are using "..vClient.." Version: "..vTag["V"].."."
Msg = Msg .. "\r\n You are Sharing "..vShare.." Gb and "..vTag["S"].." Slot(s)."
Msg = Msg .. "\r\n You are in "..vTag["H"].." Hub(s)."
Msg = Msg .. "\r\n Your Bandwidh is "..vTag["B"].." kB/s"
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n-------------------------------------------"
curUser:SendData(Bot,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
AllowClients(curUser,vClient,vTag)
end
end
function AllowClients(curUser,vClient,vTag)
if (LC[curUser.iProfile]==1) then
if (vClient =="oDC" and AllowODC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,ODCver,"http://gempond.com/odc")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC++" and AllowDCPP==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPROver,"http://btpro.altervista.org/index.php")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DCGUI" and AllowDCGUI==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCGUIver,"http://dc.ketelhot.de")
BandwidhCheck(curUser,vTag)
elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,NMDC2ver,"http://neo-modus.com")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Fake" and AllowFAKE==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Unknown" and AllowNOTAG==1) then
elseif (vClient =="Fake" and AllowFAKE==0) then
curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
curUser:Disconnect()
elseif (vClient =="Unknown" and AllowNOTAG==0) then
curUser:SendData(Bot,curUser.sName.." you are using a client with no tag!")
curUser:Disconnect()
else
curUser:SendData(Bot,curUser.sName..", "..vClient.." is not allowed here!")
curUser:Disconnect()
end
end
end
function CheckSlotsHubs(curUser,vTag)
if (tonumber(vTag["S"]) < MinSlots) then
curUser:SendData(Bot,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["S"]) > MaxSlots) then
curUser:SendData(Bot,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["H"]) > MaxHubs) then
curUser:SendData(Bot,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
curUser:Disconnect()
end
end
function VersionCheck(curUser,vClient,vTag,Version,Download)
if (vClient == "DCGUI" or vClient == "DC:PRO") then
if (vTag["V"] < Version) then
curUser:SendData(Bot,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(Bot,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
else
if (tonumber(vTag["V"]) < tonumber(Version)) then
curUser:SendData(Bot,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(Bot,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
end
end
function BandwidhCheck(curUser,vTag)
if vTag["B"] == "unlimited" then
elseif (tonumber(vTag["B"]) < LockBW) then
curUser:SendData(Bot,"You are using a Bandwidh Locker, locked to ( "..vTag["B"].." kB/s ), Minimum is ( "..LockBW.." kB/s ).")
curUser:Disconnect()
end
end
Hope it works ok... :-)
AllowClients = {
["<++"] = 1,
["oDC"] = 1,
["DC"] = 0,
["DCGUI"] = 1,
["http://dc.ketelhot.de"] = 1,
["DC:PRO"] = 1
}
This is how i allow or block clients from entering my hub..
for key,v in AllowClients do
if strfind(user.sMyInfoString,key) and ((v == 0)) then
Hi having a few probs
was wondering does the bot name show up in user list?? bacause it is not in mine??
Woodster
:))
Woodster
QuoteHi having a few probs
was wondering does the bot name show up in user list?? bacause it is not in mine??
Woodster
nope this bot isnt showing in userlist.
nice going NightLitch, enjoying the show, keep up the good work, you already have give me somenice ideas, :))
Gonna update it soon have updated it so much in my NXS-3 so forgot doing it in this to.
Update coming soon.
eheh ive done the same with my userinfo bot, inside gekko, i havent updated the one on forum lol, i will have to free sometime
Report Evetually BUGS!
here is the full RIP from NXS-3
-- CLIENT CHECKER
-- Version: 3.0
-- By: NightLitch
-- Date: 2004/02/10
---------------------------------------------------------------------
BotName = "Z-LeZ"
--Level Checks / 1:on/0:off
LC = {
[0] = 0, -- Check Masters
[1] = 0, -- Check Operators
[2] = 1, -- Check VIPs
[3] = 1, -- Check REGs
[-1] = 1, -- Check Users
}
-- Client Settings
-------------------------------------------------
-- Allow Clients / 1:on/0:off
AllowDCPP = 1 -- DC++
AllowODC = 1 -- oDC
AllowNMDC2 = 1 -- Neo Modus DC 2
AllowDCGUI = 1 -- DCGUI
AllowDCPRO = 1 -- DC:PRO
AllowBCDC = 1 -- BCDC++
AllowCZDC = 1 -- CZDC++
AllowPDC = 1 -- Phantom DC++
AllowIDC = 1 -- Italian DC++
AllowNDC = 1 -- nDC++
AllowNOTAG = 0 -- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0 -- Fake Client (Fake Taging)
-- Client Settings
MinSlots = 2 -- Min Slots
MaxSlots = 15 -- Max Slots
MaxHubs = 8 -- Max Hubs for users
LockBW = 10 -- Min Bandwidh Lock
-- Version Checks
DCPPver = "0.201" -- DC++ Min. Version
ODCver = "5.2" -- oDC Min. Version
NMDC2ver = "2.02" -- Neo Modus DC 2 Min. Version
DCPROver = "0.2.2.10" -- DC:PRO Min. Version
DCGUIver = "0.2.20" -- DCGUI Min. Version
IDCver = "1.03" -- Italian DC++ Min. Version
nDCver = "0.300" -- nDC++ Min. Version
---------------------------------------------------------------------
ClientTAG = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "{ "{ "zDC++[","zDC++" },
{ "","MS++V" },
{ "","MS++V" },
{ "{ "<.P>","Phantom DC++" },
}
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n Welcome "..curUser.sName.." !"
Msg = Msg .. "\r\n------------------------------------------------------------------------------------"
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n You are using "..vClient.." Version: "..vTag["V"].."."
Msg = Msg .. "\r\n You are Sharing "..format("%.2f",vShare/gb).." Gb and "..vTag["S"].." Slot(s)."
Msg = Msg .. "\r\n You are in "..vTag["H"].." Hub(s) as user."
Msg = Msg .. "\r\n You are in "..vTag["RH"].." Hub(s) as registered user."
Msg = Msg .. "\r\n You are in "..vTag["OH"].." Hub(s) as operator."
Msg = Msg .. "\r\n Your Bandwidh Limiter is "..vTag["B"].." kB/s"
Msg = Msg .. "\r\n You are in "..vTag["M"].." Mode."
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n------------------------------------------------------------------------------------"
curUser:SendData(BotName,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
AllowClients(curUser,vClient,vTag)
end
end
function ParseMyInfo(MyInfo)
local vClient = "Unknown"
local Bwidh = ""
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
for i = 1,getn(ClientTAG) do
if strfind(MyInfo,ClientTAG[i][1]) then
vClient = ClientTAG[i][2]
end
end
local Version = ""
local _,_,Slots = strfind( MyInfo, "S:(%d+)")
local _,_,Mode = strfind( MyInfo, "M:([S,A,P])")
local _,_, DcVer = strfind(MyInfo,"V:(%x+.%x+)")
Version = DcVer
if strfind(MyInfo," local _,_,oDCVer = strfind(MyInfo,"")
Version = oDCVer
vClient = "oDC"
elseif strfind(MyInfo,":)") or strfind(MyInfo,"subidub") then
local _,_,nDCVer = strfind(MyInfo,"::%[(%S+)%]::")
SendToAll("V:"..nDCVer)
Version = nDCVer
vClient = "nDC++"
elseif vClient=="Italian DC++" then
local _,_,IDCVer = strfind(MyInfo,"")
Version = IDCVer
end
local Hubs = ""
local Regged = ""
local Opped = ""
local _,_, gethub = strfind(MyInfo,"H:(%x+)/")
if gethub == nil then
_,_, Hubs = strfind(MyInfo,"H:(%x+)")
Regged = 0
Opped = 0
else
Hubs = gethub
_,_, Regged = strfind(MyInfo,"H:%x+/(%x+)/")
_,_, Opped = strfind(MyInfo,"H:%x+/%x+/(%x+)")
end
if strfind(MyInfo,"H:\"%d+/%d+/%d+\",S") then
vClient = "Fake Client"
_,_,Hubs,Regged,Opped = strfind(MyInfo,"H:\"(%x+)/(%x+)/(%x+)\"")
end
if strfind( MyInfo,"V:%S+(k),M") then vClient = "DC++k" end
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
vClient = "CZDC++"
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
if not vClient=="Phantom DC++" then
vClient = "BCDC++"
end
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if Version == nil then Version = "0" end
if Mode == nil then Mode = "0" end
if Hubs == nil then Hubs = "0" end
if Slots == nil then Slots = "0" end
tMode = {
["S"] = "Socks",
["A"] = "Active",
["P"] = "Passive",
["0"] = "N/A",
}
vTag = { ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh,["V"] = Version, ["M"] = tMode[Mode], ["RH"] = Regged, ["OH"] = Opped}
return vClient, vTag, vSpeed, vShare
end
function AllowClients(curUser,vClient,vTag)
if (LC[curUser.iProfile]==1) then
if (vClient =="oDC" and AllowODC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,ODCver,"http://gempond.com/odc")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC++" and AllowDCPP==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPROver,"http://btpro.altervista.org/index.php")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DCGUI" and AllowDCGUI==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCGUIver,"http://dc.ketelhot.de")
BandwidhCheck(curUser,vTag)
elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,NMDC2ver,"http://neo-modus.com")
BandwidhCheck(curUser,vTag)
elseif (vClient =="BCDC++" and AllowBCDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://utrum.dyndns.org:8000/index.html")
BandwidhCheck(curUser,vTag)
elseif (vClient =="CZDC++" and AllowCZDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://www.czdcplusplus.tk/")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Phantom DC++" and AllowPDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://pdc.recoil.net.nz/index.php")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Italian DC++" and AllowIDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,IDCver,"http://www.p2pitalia.com/")
BandwidhCheck(curUser,vTag)
elseif (vClient =="nDC++" and AllowNDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,nDCver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Fake Client" and AllowFAKE==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Unknown" and AllowNOTAG==1) then
elseif (vClient =="Fake Client" and AllowFAKE==0) then
curUser:SendData(BotName,curUser.sName.." you are using a fake tag or client!")
curUser:Disconnect()
elseif (vClient =="Unknown" and AllowNOTAG==0) then
curUser:SendData(BotName,curUser.sName.." you are using a client with no tag!")
curUser:Disconnect()
else
curUser:SendData(BotName,curUser.sName..", "..vClient.." is not allowed here!")
curUser:Disconnect()
end
end
end
function CheckSlotsHubs(curUser,vTag)
if (vTag["S"] == "N/A" or vTag["H"] == "N/A") then
elseif (tonumber(vTag["S"]) < MinSlots) then
curUser:SendData(BotName,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["S"]) > MaxSlots) then
curUser:SendData(BotName,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["H"]) > MaxHubs) then
curUser:SendData(BotName,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
curUser:Disconnect()
end
end
function VersionCheck(curUser,vClient,vTag,Version,Download)
if (vClient == "DCGUI" or vClient == "DC:PRO") then
if (vTag["V"] == "N/A") then
elseif (vTag["V"] < Version) then
curUser:SendData(BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
else
if (vTag["V"] == "N/A") then
elseif (vTag["V"] < Version) then
curUser:SendData(BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
end
end
function BandwidhCheck(curUser,vTag)
if vTag["B"] == "unlimited" then
elseif (tonumber(vTag["B"]) < LockBW) then
curUser:SendData(BotName,"You are using a Bandwidh Locker, locked to ( "..vTag["B"].." kB/s ), Minimum is ( "..LockBW.." kB/s ).")
curUser:Disconnect()
end
end
Enjoy it. :-p
/NL
nightlitch
I love this client checker script but ..........
i get this error
Syntax error: attempt to perform arithmetic on global `gb' (a nil value)
stack traceback:
1: function `NewUserConnected' at line 75 [file `...=PTOTAX==\gekkobeta5\scripts\client-checker.lua']
Script stopped.
could you fix this?
and perhaps make 2 additions :-)
1 a log file
2 3xkick = ban
would be great thanx in advance.
quick update becouse of the error.
nDC++ removed due to problem resolving the version on it. Tag seam to differ. on the info about nDC otherwise the tag is the same as DC++
-- CLIENT CHECKER
-- Version: 3.1
-- By: NightLitch
-- Date: 2004/02/10
---------------------------------------------------------------------
kb = 1024
gb = kb*kb*kb
tb = kb*kb*kb*kb
---------------------------------------------------------------------
Bot = "Z-LeZ"
--Level Checks / 1:on/0:off
LC = {
[0] = 0, -- Check Masters
[1] = 0, -- Check Operators
[2] = 1, -- Check VIPs
[3] = 1, -- Check REGs
[-1] = 1, -- Check Users
}
-- Client Settings
-------------------------------------------------
-- Allow Clients / 1:on/0:off
AllowDCPP = 1 -- DC++
AllowODC = 1 -- oDC
AllowNMDC2 = 1 -- Neo Modus DC 2
AllowDCGUI = 1 -- DCGUI
AllowDCPRO = 1 -- DC:PRO
AllowBCDC = 1 -- BCDC++
AllowCZDC = 1 -- CZDC++
AllowPDC = 1 -- Phantom DC++
AllowIDC = 1 -- Italian DC++
AllowNOTAG = 0 -- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0 -- Fake Client (Fake Taging)
-- Client Settings
MinSlots = 2 -- Min Slots
MaxSlots = 15 -- Max Slots
MaxHubs = 8 -- Max Hubs for users
LockBW = 10 -- Min Bandwidh Lock
-- Version Checks
DCPPver = "0.201" -- DC++ Min. Version
ODCver = "5.2" -- oDC Min. Version
NMDC2ver = "2.02" -- Neo Modus DC 2 Min. Version
DCPROver = "0.2.2.10" -- DC:PRO Min. Version
DCGUIver = "0.2.20" -- DCGUI Min. Version
IDCver = "1.03" -- Italian DC++ Min. Version
nDCver = "0.300" -- nDC++ Min. Version
---------------------------------------------------------------------
ClientTAG = {
{ "<%+%+","oDC" },
{ "{ "<%+%+","DC++" },
{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "{ "{ "zDC++[","zDC++" },
{ "","MS++V" },
{ "","MS++V" },
{ "{ "<.P>","Phantom DC++" },
}
function NewUserConnected(curUser)
local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)
local Msg = "\r\n\r\n"
Msg = Msg .. "\r\n Welcome "..curUser.sName.." !"
Msg = Msg .. "\r\n------------------------------------------------------------------------------------"
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n You are using "..vClient.." Version: "..vTag["V"].."."
Msg = Msg .. "\r\n You are Sharing "..format("%.2f",vShare/gb).." Gb and "..vTag["S"].." Slot(s)."
Msg = Msg .. "\r\n You are in "..vTag["H"].." Hub(s) as user."
Msg = Msg .. "\r\n You are in "..vTag["RH"].." Hub(s) as registered user."
Msg = Msg .. "\r\n You are in "..vTag["OH"].." Hub(s) as operator."
Msg = Msg .. "\r\n Your Bandwidh Limiter is "..vTag["B"].." kB/s"
Msg = Msg .. "\r\n You are in "..vTag["M"].." Mode."
Msg = Msg .. "\r\n "
Msg = Msg .. "\r\n------------------------------------------------------------------------------------"
curUser:SendData(BotName,Msg)
end
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
AllowClients(curUser,vClient,vTag)
end
end
function ParseMyInfo(MyInfo)
local vClient = "Unknown"
local Bwidh = ""
local _,_,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
local vShare = tonumber(sShare)
for i = 1,getn(ClientTAG) do
if strfind(MyInfo,ClientTAG[i][1]) then
vClient = ClientTAG[i][2]
end
end
local Version = ""
local _,_,Slots = strfind( MyInfo, "S:(%d+)")
local _,_,Mode = strfind( MyInfo, "M:([S,A,P])")
local _,_, DcVer = strfind(MyInfo,"V:(%x+.%x+)")
Version = DcVer
if strfind(MyInfo," local _,_,oDCVer = strfind(MyInfo,"")
Version = oDCVer
vClient = "oDC"
elseif vClient=="Italian DC++" then
local _,_,IDCVer = strfind(MyInfo,"")
Version = IDCVer
end
local Hubs = ""
local Regged = ""
local Opped = ""
local _,_, gethub = strfind(MyInfo,"H:(%x+)/")
if gethub == nil then
_,_, Hubs = strfind(MyInfo,"H:(%x+)")
Regged = 0
Opped = 0
else
Hubs = gethub
_,_, Regged = strfind(MyInfo,"H:%x+/(%x+)/")
_,_, Opped = strfind(MyInfo,"H:%x+/%x+/(%x+)")
end
if strfind(MyInfo,"H:\"%d+/%d+/%d+\",S") then
vClient = "Fake Client"
_,_,Hubs,Regged,Opped = strfind(MyInfo,"H:\"(%x+)/(%x+)/(%x+)\"")
end
if strfind( MyInfo,"V:%S+(k),M") then vClient = "DC++k" end
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
vClient = "CZDC++"
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
if not vClient=="Phantom DC++" then
vClient = "BCDC++"
end
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
else
Bwidh = "unlimited"
end
if Version == nil then Version = "0" end
if Mode == nil then Mode = "0" end
if Hubs == nil then Hubs = "0" end
if Slots == nil then Slots = "0" end
tMode = {
["S"] = "Socks",
["A"] = "Active",
["P"] = "Passive",
["0"] = "N/A",
}
vTag = { ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh,["V"] = Version, ["M"] = tMode[Mode], ["RH"] = Regged, ["OH"] = Opped}
return vClient, vTag, vSpeed, vShare
end
function AllowClients(curUser,vClient,vTag)
if (LC[curUser.iProfile]==1) then
if (vClient =="oDC" and AllowODC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,ODCver,"http://gempond.com/odc")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC++" and AllowDCPP==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPROver,"http://btpro.altervista.org/index.php")
BandwidhCheck(curUser,vTag)
elseif (vClient =="DCGUI" and AllowDCGUI==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCGUIver,"http://dc.ketelhot.de")
BandwidhCheck(curUser,vTag)
elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,NMDC2ver,"http://neo-modus.com")
BandwidhCheck(curUser,vTag)
elseif (vClient =="BCDC++" and AllowBCDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://utrum.dyndns.org:8000/index.html")
BandwidhCheck(curUser,vTag)
elseif (vClient =="CZDC++" and AllowCZDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://www.czdcplusplus.tk/")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Phantom DC++" and AllowPDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://pdc.recoil.net.nz/index.php")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Italian DC++" and AllowIDC==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,IDCver,"http://www.p2pitalia.com/")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Fake Client" and AllowFAKE==1) then
CheckSlotsHubs(curUser,vTag)
VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
BandwidhCheck(curUser,vTag)
elseif (vClient =="Unknown" and AllowNOTAG==1) then
elseif (vClient =="Fake Client" and AllowFAKE==0) then
curUser:SendData(BotName,curUser.sName.." you are using a fake tag or client!")
curUser:Disconnect()
elseif (vClient =="Unknown" and AllowNOTAG==0) then
curUser:SendData(BotName,curUser.sName.." you are using a client with no tag!")
curUser:Disconnect()
else
curUser:SendData(BotName,curUser.sName..", "..vClient.." is not allowed here!")
curUser:Disconnect()
end
end
end
function CheckSlotsHubs(curUser,vTag)
if (vTag["S"] == "N/A" or vTag["H"] == "N/A") then
elseif (tonumber(vTag["S"]) < MinSlots) then
curUser:SendData(BotName,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["S"]) > MaxSlots) then
curUser:SendData(BotName,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
curUser:Disconnect()
elseif (tonumber(vTag["H"]) > MaxHubs) then
curUser:SendData(BotName,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
curUser:Disconnect()
end
end
function VersionCheck(curUser,vClient,vTag,Version,Download)
if (vClient == "DCGUI" or vClient == "DC:PRO") then
if (vTag["V"] == "N/A") then
elseif (vTag["V"] < Version) then
curUser:SendData(BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
else
if (vTag["V"] == "N/A") then
elseif (vTag["V"] < Version) then
curUser:SendData(BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
curUser:SendData(BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
curUser:Disconnect()
end
end
end
function BandwidhCheck(curUser,vTag)
if vTag["B"] == "unlimited" then
elseif (tonumber(vTag["B"]) < LockBW) then
curUser:SendData(BotName,"You are using a Bandwidh Locker, locked to ( "..vTag["B"].." kB/s ), Minimum is ( "..LockBW.." kB/s ).")
curUser:Disconnect()
end
end
EnJoy!!!
nightlitch
testing the new one now :-)
did you add the futures i requested?
oke here is an error for ya
Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
1: function `strfind' [C]
2: function `ParseMyInfo' at line 104 [file `...PTOTAX==\gekkobeta5\scripts\clientchecker_2.lua']
3: function `NewUserConnected' at line 77 [file `...PTOTAX==\gekkobeta5\scripts\clientchecker_2.lua']
Script stopped.
new update will come...
Nightlitch
Quotenew update will come...
When???
When I get something straight in my life.
NXS-3 will be updated now & then. If you run that you will not need this one.
But will see what I can do upcoming week.
Nightlitch
see that you get your live back on track m8 i can wait
live is more important than dc