deny clients...
 

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

Started by blackwings, 12 October, 2004, 03:35:54

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blackwings

I don't really need help, I just wanted to here what you more skilled scripters think(heh, I'm a pure newbie) about my script that blocks certian clients. It's made to use together with RoboCop 9.0b.

Do you guys think this script is slow?
Do you guys think that it's check is bad?
Is there a better way to make a simple client block script?


Anyway, here is the code =
-- ??????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 1.0 - Made by: blackwings            ?
-- ?------------------------------------------------------------?
-- ? A personlized deny client's bot. To be fast as             ?
-- ? possible(with my little lua scripting knowledge), I didn't ?
-- ? make a fancy config option in the beginning of the script. ?
-- ?            --------------------------------------          ?
-- ? This Script blocks: BCDC++,nDC++, iDC++,StrongDC++,CZDC++, ?
-- ? DC@fe++,rmDC++,ReverseConnect                  		?
-- ?            --------------------------------------          ?
-- ? The Script doesn't check Ops and VIP's                     ?
-- ?            --------------------------------------          ?
-- ? I made this script to use it with RoboCop 9.0b             ?
-- ??????????????????????????????????????????????????????????????


Bot="Client-Checker"

Client =""

function Main()
	frmHub:RegBot(Bot)
end

function DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		if strfind(data,"V:(0.%d+)") then
			if strfind(data, "[BL]:") then
				Client="BCDC++"
				User:SendData(Bot,"The Client <"..Client.."> isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, "v%[") then
				Client="nDC++"
				User:SendData(Bot,"The Client <"..Client.."> isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, "V:0.%d+%a") then
				Client="CZDC++"
				User:SendData(Bot,"The Client <"..Client.."> isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, " isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, " isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, "reverseconnect.sf.net" ) or strfind(data,"www.RevConnect.com") then
				Client="ReverseConnect"
				User:SendData(Bot,"The Client <"..Client.."> isn't allowed in this hub.")
				User:Disconnect()
			end
		else
			if strfind(data, " isn't allowed in this hub.")
				User:Disconnect()
			elseif strfind(data, " isn't allowed in this hub.")
				User:Disconnect()
			end
		end
	end
end


imby

i thought you was one of the 'big dogs' mutor

nErBoS

#2
Hi,

Fast answers....

"Do you guys think this script is slow? "

No i don't think so, but it could be faster  :))

"Do you guys think that it's check is bad?"

It will fail on checking iDC since iDC has the DC++ tag then he will enter in the condition "if strfind(data,"V:(0.%d+)") then"

"Is there a better way to make a simple client block script? "

Yes. Check out for NightLitch Parse Info and Client Checker.


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

Herodes

I think that u would need to check the tag and only the tag ...

you need to find a way to grab it ...
and as soon as u grab it check that ...
just to make it a lil bit better ...

blackwings

#4
@Herodes: I don't quite follow what you mean, grasp them in what way? Something else then strfind(data,"")??
   
Maybe I have optimized it a bit more now, but I think that maybe the table thingie I use isn't needed.
Heh, it's just me trying out things while I'm learning lua :P

-- ??????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 2.0 - Made by: blackwings            ?
-- ?------------------------------------------------------------?
-- ? A personlized deny client's bot. To be fast as             ?
-- ? possible(with my little lua scripting knowledge), I didn't ?
-- ? make a fancy config option in the beginning of the script. ?
-- ?            --------------------------------------          ?
-- ? This Script blocks: BCDC++,nDC++, iDC++,StrongDC++,CZDC++, ?
-- ? DC@fe++,rmDC++,ReverseConnect                  		?
-- ?            --------------------------------------          ?
-- ? The Script doesn't check Ops and VIP's                     ?
-- ?            --------------------------------------          ?
-- ? I made this script to use it with RoboCop 9.0b             ?
-- ?            --------------------------------------          ?
-- ? Changed: Maybe Optimized the script :S                     ?
-- ??????????????????????????????????????????????????????????????

Bot="Client-Checker"

C={
[1]="BCDC++",
[2]="nDC++",
[3]="CZDC++",
[4]="DC@fe++",
[5]="rmDC++",
[6]="iDC++",
[7]="ReverseConnect",
[8]="StrongDC++",
}

Client=""

function Main()
	frmHub:RegBot(Bot)
end

function BlockedUser(User)
	User:SendData(Bot,"The Client <"..Client.."> isn't allowed in this hub.")
	User:Disconnect()
end

function DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		if strfind(data,"V:(0.%d+)") then
			if strfind(data, "[BL]:") then
				Client=C[1]
				return BlockedUser(User)
			elseif strfind(data, "v%[") then
				Client=C[2]
				return BlockedUser(User)
			elseif strfind(data, "V:0.%d+%a") then
				Client=C[3]
				return BlockedUser(User)
			elseif strfind(data, " isn't allowed in this hub.")
				User:Disconnect()
			end
		end
	end
end


Optimus

Keep on going m8, btw a nice link with some more info = http://www.dslreports.com/faq/6529

But maybe you know it allready

Greetingz Optimus ;)

blackwings

#6
By hard thinking about my current deny client script, checking in the LUA Guide etc, I made this. I rewrote most of the code and I think it's much faster then the other 2 I made earlier.

I think the script works properly, but please, if anyone of you skilled scripters see anything weird in my script, tell me about it

EDIT: Updated the code (added a table)
EDIT 2: Added few more clients to the table
-- ??????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 3.1                                  ?
-- ? Made by: blackwings                                        ?
-- ?------------------------------------------------------------?
-- ? This Script blocks: StrongDC++,Phantom DC++,iDC++,MS++V,   ?
-- ? DC++K CDM,rmDC++,DC@fe++,DC++ DCDM,BCDC++,nDC++,CZDC++,    ?
-- ? ReverseConnect,zY++,xR++                                   ?
-- ?            --------------------------------------          ?
-- ? The Script doesn't check Ops and VIP's                     ?
-- ?            --------------------------------------          ?
-- ? I made this script to use it with RoboCop 9.0b             ?
-- ?            --------------------------------------          ?
-- ? Changed: Maybe Optimized the script :S                     ?
-- ? Changed: I rewrote most of the script, much better now     ?
-- ? Added: A table for clients that I don't know the version   ?
-- ?        description off                                     ?
-- ? Added: A few more clients to the table                     ?
-- ??????????????????????????????????????????????????????????????

Bot="Client-Checker"

C = {
{"","V:(0.%d+)","Phantom DC++"},
{" isn't allowed in this hub.")
	User:Disconnect()
end

function DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		for i=1,getn(C) do
			C[i][1] = gsub(C[i][1], "<" , "")
			if strfind(data, C[i][1]) and strfind(data, C[i][2]) then
				Client=C[i][3]
				return BlockedUser(User)
			end
		end
		for j=1,getn(U) do
			U[j][1] = gsub(U[j][1], "<" , "")
			if strfind(data, U[j][1]) then
				Client=U[j][2]
				return BlockedUser(User)
			end
		end
	end
end


BoJlk

Got a question :

to integrate this script with the RoboCop
i have to disable the RoboCop's ClientCheck feature
or organize the scripts that this one will come before the RoboCop's?

bastya_elvtars

QuoteOriginally posted by BoJlk
Got a question :

to integrate this script with the RoboCop
i have to disable the RoboCop's ClientCheck feature
or organize the scripts that this one will come before the RoboCop's?

disable check in rc and let it come AFTER rc imho
Everything could have been anything else and it would have just as much meaning.

Typhoon

No need to check for those they are not public and will never be , besides they can stealth that tag...

U = {
{"

just some info and now you can make it even shorter now :)

Typhoon?



blackwings

#10
I did the thing Typhoon pointed out =
-- ??????????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 3.5.2                                    ?
-- ? 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                                                 ?
-- ?            --------------------------------------              ?
-- ? 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: Maybe Optimized the script :S                         ?
-- ? Changed: I rewrote most of the script, much better now         ?
-- ? Added: A table for clients that I don't know the version       ?
-- ?        description off                                         ?
-- ? Added: A few more clients to the table                         ?
-- ? Removed: The check on the clients zY++ and xR++ (after Typhoon ?
-- ? pointed it out), which make the script shorter and faster      ?
-- ? Added: DCGUI and zDC++ to the deny table                       ?
-- ? Fixed: A small bug in the client table                         ?
-- ??????????????????????????????????????????????????????????????????

Bot="Client-Checker"

C = {
{"","V:(0.%d+)","Phantom DC++"},
{" isn't allowed in this hub.")
	User:Disconnect()
end

function DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		for i=1,getn(C) do
			C[i][1] = gsub(C[i][1], "<" , "")
			if strfind(data, C[i][1]) and strfind(data, C[i][2]) then
				Client=C[i][3]
				return BlockedUser(User)
			end
		end
	end
end


Typhoon

just Remember to add DCGUI to your list to , a very good client in my oppinion ..
looks great so far keep it up m8 :)

Typhoon?



blackwings

#12
QuoteOriginally posted by blackwings
QuoteOriginally posted by bastya_elvtars
disable check in rc . Let it come AFTER rc imho
@bastya_elvtars: didn't you mean = "don't disable the check in rc and let this script come AFTER rc imho"

Can some other well known client that isn't in my script table, be mistaken and blocked by my script?
Anyway, I have updated the script in my post before this one. I added DCGUI and zDC++.


Optimus

I think (haven't tested) that it works but at the moment you add DC++ tag you will get in troubles i think. Then you need todo it maybe in a other way.

Optimus

blackwings

#14
The script has been updated again(version 3.5.2), I fixed a small bug in the client table.

The script seems to work perfectly now. I have tested it with RC 9.0b ClientChecker activated and it seems to work.

@Optimus: heh, I tested to block Phantom DC in both RC and in my script. Even if my script is loaded after RC in the list, my script blocks Phantom DC, not RC :P  Probably because my script is faster on blocking it :]


Optimus

QuoteProbably because my script is faster on blocking it
Lol i don't think that has anything todo with it, mine is just not loaded directly at the beginning. There are some other checks first.

Typhoon

small scripts dedicated to do only 1 thing , should be faster , but compare your hub with RC on then turn RC off, and see what crap gets allowed to enter  ;)  
and as optimus said RC dont only check the client ..
but also share , slots , hubs , do logging and so on.. thats why yours seem to work faster


Typhoon?



blackwings

#17
Ok. I have now updated the script again. I improved the "search info" (Thanx Optimus) and added allot of clients.

Anyway, if someone sees something wierd in the "search infos"/strings of the new clients, please post about it.

Here is the updated code =
-- ??????????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 4                                        ?
-- ? 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++                         ?
-- ?            --------------------------------------              ?
-- ? 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: Maybe Optimized the script :S                         ?
-- ? Changed: I rewrote most of the script, much better now         ?
-- ? Added: A table for clients that I don't know the version       ?
-- ?        description off                                         ?
-- ? Added: A few more clients to the table                         ?
-- ? Removed: The check on the clients zY++ and xR++ (after Typhoon ?
-- ? pointed it out), which make the script shorter and faster      ?
-- ? Added: DCGUI and zDC++ to the deny table                       ?
-- ? Fixed: A small bug in the client table                         ?
-- ? Added: Allot of new clients                                    ?
-- ? Improved: some of search info, so that some clients won't get  ?
-- ? confused with other clients. (Thanx Optimus)                   ?
-- ??????????????????????????????????????????????????????????????????

Bot="Client-Checker"

-- To remove a client from the deny table, simple delete the line
C = {
{"","V:(0.%d+)","Phantom DC++"},
{"[BL]:","V:(0.%d+)","BCDC++"},
{"zDC%+%+","V:(0.%d+)","zDC++"},
{" isn't allowed in this hub.")
	User:Disconnect()
end

function DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		for i=1,getn(C) do
			C[i][1] = gsub(C[i][1], "<" , "")
			if strfind(data, C[i][1]) and strfind(data, C[i][2]) then
				Client=C[i][3]
				return BlockedUser(User)
			end
		end
	end
end


Optimus

Maybe a good idea is to make a swith for everyclient. (1=on,0=off) so that people don't have to remove the clients from list. Cause if they do remove them the could forget what the tag was when they want to put it back or sum like that.

Optimus

{"

and
if C[i][4] == 1 then
					Client=C[i][3]
					return BlockedUser(User)
				end

blackwings

#20
Another update(version 4.2)

I have added on/off setting, so that you don't need to delete the lines in the table(Thanx for the idea Optimus).

I have also added another field in each string, so that you can add a info that shouldn't be found example = for BCDC++, I have in the fourth field added <%.%P> and. This function works well I think and I hope by doing this, there won't be any confusion in the checking.

 For the moment I have in the other strings just added "cccc" in the fourth field. Anyone can give a sugestion of a better info or that you know a client that you think should have a certian info in the fourth field just like BCDC++
-- ??????????????????????????????????????????????????????????????????
-- ? Deny Client's Checker 4.2.1                                    ?
-- ? 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: Maybe Optimized the script :S                         ?
-- ? Changed: I rewrote most of the script, much better now         ?
-- ? Added: A table for clients that I don't know the version       ?
-- ?        description off                                         ?
-- ? Added: A few more clients to the table                         ?
-- ? Removed: The check on the clients zY++ and xR++ (after Typhoon ?
-- ?          pointed it out), which make the script shorter        ?
-- ?	      and faster                                            ?
-- ? Added: DCGUI and zDC++ to the deny table                       ?
-- ? Fixed: A small bug in the client table                         ?
-- ? Added: Allot of new clients (Thanx Optimus)                    ?
-- ? Improved: some of search info, so that some clients won't get  ?
-- ?           confused with other clients. (Thanx Optimus)         ?
-- ? Added: A on/off setting for each client (Thanx Optimus)        ?
-- ? Improved: I made the table and the way it search better,       ?
-- ?           so now there is no confusion in the checking         ?
-- ??????????????????????????????????????????????????????????????????

Bot="Client-Checker"

-- 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 DataArrival(User , data)
	if strsub(data, 1, 7) == "$MyINFO"  and not User.bOperator  and User.iProfile ~= 2 then	
		for i=1,getn(C) do
			C[i][1] = gsub(C[i][1], "<" , "")
			if strfind(data, C[i][1]) and strfind(data, C[i][2]) and not strfind(data, C[i][4]) then
				if C[i][5] == 1 then
					local Client=C[i][3]
					return BlockedUser(User,Client)
				end
			end
		end
	end
end


nErBoS

Hi,

You could also avoid on using a global var "Client" on making the Blocked function reciving the client. For eg:

local Client=C[i][3]
return BlockedUser(User,Client)

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

blackwings

#22
The Script is updated!-Version 4.2.1- (Check the post before this one to find the script)

I followed nErBoS advice and changed the variabel Client from Global to local.


Optimus

I wonder what will be the next stepp, lol

SMF spam blocked by CleanTalk