Deny Clients Checker 4.3 LUA 5
 

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

Deny Clients Checker 4.3 LUA 5

Started by blackwings, 27 February, 2005, 22:32:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blackwings

I have converted some terms from LUA 4 to LUA 5. Now I just wonder if there is more that is needed to be changed for it to work?
-- ??????????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 4.3                                      ?
-- ? Made by: blackwings                                            ?
-- ?----------------------------------------------------------------?
-- ? This Script blocks: DCGUI,zDC++,StrongDC++,Phantom DC++,iDC++, ?
-- ? MS++V,DC++K CDM,rmDC++,DC@fe++,DC++ DCDM,BCDC++,nDC++,CZDC++,  ?
-- ? ReverseConnect,oDC,NMDC,DC:PRO,RDC++,[X]DC,YETI++,DHDc++,      ?
-- ? MORIA++,LDC++,TiDc++,R2++,Chp++,SdDC++,FInDC                   ?
-- ?            --------------------------------------              ?
-- ? The Script doesn't check Ops and VIP's                         ?
-- ?            --------------------------------------              ?
-- ? I made this script to use it with RoboCop 9.0b                 ?
-- ? (remeber to name the script so it comes after RC when ptokax   ?
-- ? loads it)                                                      ?
-- ?            --------------------------------------              ?
-- ? Changed: Converted the script into LUA 5	                    ?
-- ??????????????????????????????????????????????????????????????????

Bot="Client-Checker"

-- if you don't want to block mldc/edonkey, then change the number 1 to 0
mldcCheck=1

-- To make the bot not block a certain client, you should
-- then change the number at the end from 1 to 0
C = {
{"","V:(0.%d+)","Phantom DC++","cccc", 1},
{"[BL]:","V:(0.%d+)","BCDC++","<%.%P>", 1},
{"zDC%+%+","V:(0.%d+)","zDC++","cccc", 1},
{" isn't allowed in this hub.")
	User:SendData(Bot,"Use Original DC++, NMDC, oDC or DCGUI")
	User:Disconnect()
end

function MyINFOArrival(User,data)
	if string.sub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		for i=1,table.getn(C) do
			C[i][1] = string.gsub(C[i][1], "<" , "")
			if string.find(data, C[i][1]) and string.find(data, C[i][2]) and not string.find(data, C[i][4]) then
				if C[i][5] == 1 then
					local Client=C[i][3]
					return BlockedUser(User,Client)
				end
			elseif mldcCheck==1 and User.iProfile == -1 then	
				if string.find(data,"mld(%S+)") or string.find(data,"edonk(%S+)") then 
					User:Disconnect()
				end
			end
		end
	end
end


Pothead

What might help is the minv.lua script.  This calls
curUser.sClient == "DC++"

I think this sClient implys that PtokaX can detect quite a few clients as is.  Would be nice to know which ones it can detect, and how to reference them ("DC++" for DCplusplus). :)

nErBoS

Hi,

You can chage this...

if string.sub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then

...to this...

if not User.bOperator  and User.iProfile ~= 2 then

You don't need to check if is a $MyINFO, because the function only recieves the $MyINFO string. About the rest of the script it seems fine.

Best regards, nErBoS
--## nErBoS Spot ##--

PPK

QuoteOriginally posted by Pothead
I think this sClient implys that PtokaX can detect quite a few clients as is.  Would be nice to know which ones it can detect, and how to reference them ("DC++" for DCplusplus). :)
PtokaX 0.3.3.0 build 16.04 know as default this tags (Tag start|Client name|)
Quote++|DC++|
DCGUI|DCGUI|
DC|NMDC2|
oDC|oDC|
DC:PRO|DC:PRO|
QuickDC|QuickDC|
StrgDC++|StrongDC++|
LDC++|LDC++|
R2++|R2++|
Z++|Zion++|
This is saved in file ClientTags.dat and is easy to change ... remove not wanted client, add not included etc.  :]
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

blackwings

#4
QuoteOriginally posted by PPK
PtokaX 0.3.3.0 build 16.04 know as default this tags (Tag start|Client name|)
Quote++|DC++|
DCGUI|DCGUI|
DC|NMDC2|
oDC|oDC|
DC:PRO|DC:PRO|
QuickDC|QuickDC|
StrgDC++|StrongDC++|
LDC++|LDC++|
R2++|R2++|
Z++|Zion++|
This is saved in file ClientTags.dat and is easy to change ... remove not wanted client, add not included etc.  :]
You mean that only the one in there is the one that is allowed to enter?


bastya_elvtars

Only if tagcheck is enabled i guess.
Everything could have been anything else and it would have just as much meaning.

blackwings

QuoteOriginally posted by bastya_elvtars
Only if tagcheck is enabled i guess.
and where is that option?


PPK

QuoteOriginally posted by blackwings
You mean that only the one in there is the one that is allowed to enter?
If you set in Rules option for Users without DC tag to reject or redirect then only users with tag from ClientTags.dat are allowed to enter :)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

blackwings

#8
QuoteOriginally posted by PPK
QuoteOriginally posted by blackwings
You mean that only the one in there is the one that is allowed to enter?
If you set in Rules option for Users without DC tag to reject or redirect then only users with tag from ClientTags.dat are allowed to enter :)
ok, thanx PPK :)

is this ok PPK? =
++|DC++|
DCGUI|Valknut|
DC|NMDC2|
oDC|oDC|
DC:PRO|DC:PRO|
zDC++|zDC++|
iDC|iDC++|
DCTC|DCTC|


SMF spam blocked by CleanTalk