-- ClientChecker by [ES]latinmusic V: 1.0
-- Thanks plop for always answer my questions and teach me a little or more than a little
-- The array "isClient" contains the list of clients who can connect to the server
-- You can add more or remove some to fit your needs
-- There are some lines not really requiered but putted inside the script because last problems with MyInfoString in the latests betas of ptokax
-- Enjoy
botName = "ClientChecker"
function NewUserConnected(curUser)
CheckClient(curUser)
end
function OpConnected(curUser)
CheckClient(curUser)
end
function CheckClient(curUser)
local Found = nil
local isClient = { " if curUser.sMyInfoString then
for i,v in isClient do
if strfind(curUser.sMyInfoString, v) then Found = 1 break end
end
if Found == nil then
curUser:SendData(botName, "You are using a forbidden client in this HUB.")
curUser:SendData(botName, "List of allowed Clients.:")
curUser:SendData(botName,"==============================================")
curUser:SendData(botName, "DC++\t-->http://dcplusplus.sourceforge.net")
curUser:SendData(botName, "oDC++\t-->http://www.gempond.com/odc/")
curUser:SendData(botName, "DCGUI\t-->http://dc.ketelhot.de/")
curUser:SendData(botName, "DC:PRO\t-->http://www.gempond.com/odc/")
curUser:SendData(botName,"==============================================")
curUser:SendData(botName, "Disconnecting.....")
curUser:Disconnect()
return 1
end
else
return 1
end
end
I get this, and am new to it, so if someone can help
Syntax Error: `end' expected (to close `function' at line 14);
last token read: `' at line 37 in file `C:\Program Files\PtokaX-0.326.TestDrive4\scripts\ClientChecker.lua'
i wudnt have a return 1 there, change to sumit like user:Disconnect()
i think mldc will sit on conenction with return 1, *i think*
Nope still get same error :baby:
QuoteOriginally posted by egm47
Nope still get same error :baby:
lol no that was not for error that was just a little tip
and it works for me fine, make sure you dont copy code*
Sorry, I'm really an ediot at this stuff
good news it works tho now.
thank you
Will this block Hacked DC++ clients?
Thanks again
i dont think this will blocjk hacked clients
as it only looks at the tag the clients are giving.
and as we all know hacked clients kan emulate all kinds of tags if they use the right line.
I'm searching for a script to kick dc++ Stealth users.
A friend of mine told me that exists only one script that ask for an inexistant file and dc stealth answer with : No slots avaiable (instead of File not avaiable) does anyone has this script?
-Celeblost:"I'm searching for a script to kick dc++ Stealth users. "
+Cp6uja:"I'm searching for a script to kick dc++ Stealth users TOO "
I hvae download this DC++ Stalth !!!
Nice script from NightLitch :D
-- 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.
QuoteOriginally posted by Caleblost
I'm searching for a script to kick dc++ Stealth users.
A friend of mine told me that exists only one script that ask for an inexistant file and dc stealth answer with : No slots avaiable (instead of File not avaiable) does anyone has this script?
this isn't done by a script but by dc++k CDM / IDC and some more CDM mods.
plop