ClientChecker V: 1.0
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

ClientChecker V: 1.0

Started by [ES]latinmusic, 15 December, 2003, 12:40:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[ES]latinmusic

-- 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 = { "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

egm47

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'

pHaTTy

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*
Resistance is futile!

egm47

Nope still get same error :baby:

pHaTTy

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*
Resistance is futile!

egm47

#5
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

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


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?

Cp6uja

-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 "

Cp6uja

I hvae download this DC++ Stalth !!!

Cp6uja

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.

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk