RoboCopv8b or standalone script Nick check
 

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

RoboCopv8b or standalone script Nick check

Started by [G-T-E]Gate?, 28 June, 2004, 15:27:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[G-T-E]Gate?

I'll post my Question/Requset here as Iam not sure if it will apply to RCv8b or just a stand alone script..

I as others are getting users with nicks such as;
Rambo216154 ; [telia]snovit1999 ; kabb8658 ; olwia870415 ; podox2256 ; 85ma ; 12lisl21 and many more.
Its just the users with numbers after and before their nick that I want out of the hub.
Is there a way to disconnect/or/kick/or/timeban the user with a messege that numbers after their nick are not allowed.

Running RCv8b on 0.3.3.0 15.25
Tks G8

[G-T-E]Gate?

HI Mutor ,
I know the setting u mean in Ptx under Rules and Bots/Check with Names Enable or Except Ops..
But the thing is that when applies users using [NumericalMbit]Nick  will be effected by settings.

Is there another way to come to a solution thats just captures users with
numerical NICK numerical   //or// NICK numerical

Corayzon

strfind(sString, "%d+") will get all numerical chars from a string

NightLitch

#3
Here you have a simple solusion:

-----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	local s,e,num1,isp,nick,num2 = strfind(sUser.sName, "^(%d*)%s*([%[%S*%]]*)%s*(%S*)%s*(%d*)")
	if num1 or num2 then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnected()
	end
end
-----------------------------------------
-----------------------------------------

Hope it does what you want...

/NL
//NL

[G-T-E]Gate?

Just back and gonna give it a test run .

Tks NightLight

G8

[G-T-E]Gate?

Sorry NightLitch but ;
Upon restarting scripts and checkeing Syntax there is no problem but when
I connect with a nick such as 12tesrun12336 I get first the following mess in main chat and stay connected to the hub;

It is not allowed to have numbers in your nick...
 
Enhanced Right Click Support for [RoboCop] is available!
// Type !help in main for your available commands!
Welcome To SFS 12tesrun12336 to .....

and then when checking Ptx Gui I see a syntax error as follows;

No syntax errors in script file NoNumericalNick.lua
Syntax error: attempt to call field `Disconnected' (a nil value)
stack traceback:
   1:  function `NewUserConnected' at line 11 [file `...30 build 15.25 RCv8\scripts\NoNumericalNick.lua']


Awaiting ur reply egearly
G8

NightLitch

this one is right

-----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	local s,e,num1,isp,nick,num2 = strfind(sUser.sName, "^(%d*)%s*([%[%S*%]]*)%s*(%S*)%s*(%d*)")
	if num1 or num2 then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnect()
	end
end
-----------------------------------------
-----------------------------------------

/NL
//NL

[G-T-E]Gate?

NightLitch my man

Seems as though ur script doesnt like RoboCop v8b.
It works to damn well disconnecting users with numericals in their nick, Disconnects even users with [10Mbit]Nick which isnt right.
It needs to catch the numericals after the nick and before but not within the brackets [ ].
Upon restarting scripts and syntax check all went ok but when connecting to hub it produced a syntax error as follows;


No syntax errors in script file NoNumericalNick.lua
Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 428 [file `Robocop\RoboCopv8.0b.lua']

Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
   1:  function `strsub' [C]
   2:  function `NewUserConnected' at line 428 [file `Robocop\RoboCopv8.0b.lua']

Did I give ya something to bite into  :D

G8

NightLitch

so it does take the tag 2 hmm... load RoboC. first then mine... always the masterbot before the small ones that is what I do...

gonna test it some more then...
//NL

NightLitch

#9
Finished with some help from Plop:

----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
--// Got help form Plop for strfind.
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	local s,e,num1,tag2,num2,tag3,num3 = strfind(sUser.sName, "^(%d*)(%p*%P*%p*)(%d*)(%D*)(%d*)")
	if num1~="" or num2~="" or num3~="" then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnect()
	end
end
-----------------------------------------
-----------------------------------------

/NL
//NL

[G-T-E]Gate?

Will run a quick check before I pop out to work,,,  Grrr !!

Tks u 2 :D

[G-T-E]Gate?

Quick check seems ok
get responce in main chat ;
*** Connection closed  or *** Connection reset by server.

The order of startingthe scripts is very imortant. Will explain when I get back.

G8

[G-T-E]Gate?

To the order of starting the script first.

Start Nick Checker then all other scripts or else u will get a syntax error when a user is connected and kicked.

Now to the remaining problem;

Messege received in main chat is
*** Connection closed or *** Connection reset by server.
and not
It is not allowed to have numbers in your nick...

So that part still needs checking.

Appreciate it NightLitch and Plop if u can get around to it.

Closer then U know m8s

Tks G8

Heres the code again

----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
--// Got help form Plop for strfind.
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	local s,e,num1,tag2,num2,tag3,num3 = strfind(sUser.sName, "^(%d*)(%p*%P*%p*)(%d*)(%D*)(%d*)")
	if num1~="" or num2~="" or num3~="" then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnect()
	end
end
-----------------------------------------
-----------------------------------------

nErBoS

#13
Hi,

Little mod on the script more simple,

----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
--// Got help form Plop for strfind.
--// Littl Mod by nErBoS
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	if (strfind(sUser.sName, "%d+") ~= nil) then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnect()
	end
end
-----------------------------------------

Best regard, nErBoS
--## nErBoS Spot ##--

[G-T-E]Gate?

Sorry nErBoS but
1- Allows user in with numericals Nick numericals
2- Gives syntax error in RC v8b , no matter in which order the 2 scripts are started.

G8

nErBoS

#15
Hi,

Try this then...

----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
--// Got help form Plop for strfind.
--// Little Modification by nErBoS
-----------------------------------------
-----------------------------------------
function NewUserConnected(sUser)
	if (strfind(sUser.sName, "%d+") ~= nil) then
		sUser:SendData("It is not allowed to have numbers in your nick...")
		sUser:Disconnect()
		return 1
	end
end
-----------------------------------------

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

[G-T-E]Gate?

Here ya go nErBoS

Result after test running ONLY RCv8b and Nick Check

***Kicks users with Tags [10Mbit]Nick and users with Numerical Nick Numerical
Suppose to catch only  Numerical Nick Numerical

A- Order of scripts start

1- Nick Check
2- RCv8b
Main chat messege = ***Connection Closed
No Syntax Error

----------------------------------------------------------------------

A- Order of scripts start

1- RC v8b
2- Nick Check
Main Chat Messege= It is not allowed to have numbers in your nick..
***Disconnected

Produces Syntax error: bad argument #1 to `strsub' (string expected, got nil)
stack traceback:
1: function `strsub' [C]
2: function `NewUserConnected' at line 428 [file `Robocop\RoboCopv8.0b.lua']

G8 ;)

nErBoS

#17
Hi,

Well about that error is because of data not catch by robocop, i wouldn't mind that error, to be apeared will not affect the work of both scripts i think.

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

[G-T-E]Gate?

Ive tested different placements of the scripts and get either
***Connection Closed
No Syntax Error
or
It is not allowed to have numbers in your nick..
***Disconnected
With Syn Error.

I'll run it for a day or so to see what effect it has with syn error..

Tks and open to more tests
I'ld love to see a clean Syntax Board

G8

NightLitch

#19
Rewrote it from NewUserConnected to DataArrival ($ValidateNick)

This should be no problem running along side RoboCop, works withour problem for me with THOR and I have had the same problems, just hadn't enabled the checks in NewUser....

Here is the code:

----------------------------------------
-----------------------------------------
--// Simple Nick Checker, by: NightLitch
--// Request by: [G-T-E]Gate?
--// Small fix
--// Got help form Plop for strfind.
--// Rewrote it from UserConnected to DataArrival
-----------------------------------------
-----------------------------------------
function DataArrival(sUser, sData)
	if strsub(sData, 1, 13) == "$ValidateNick" then
		local s,e,Nick = strfind(sData, "k (.*)%|$")
		if Nick then
			local s,e,num1,tag2,num2,tag3,num3 = strfind(Nick, "^(%d*)(%p*%P*%p*)(%d*)(%D*)(%d*)")
			if num1~="" or num2~="" or num3~="" then
				sUser:SendData("It is not allowed to have numbers in your nick...")
				sUser:Disconnect()
			end
		end
	end
end
-----------------------------------------
-----------------------------------------

Cheers / NL
//NL

[G-T-E]Gate?

Jo NL

Just back from work and started my vacation YaHoo!!!

Now I say ur messege and was wiled to try ur fix.
Results Below:

Disconnects user and sends Messege to Main Chat with No syntax error ;

[10Mbit]Nick123
[10Mbit]Nick    <<==== Should not apply to this sort of Nick
1213Nick1213
123Nick
----------------------------------------------------------------------------

No Discconnection of User, Enters hub, No syn Error ;

Nick1213    <<==== Should apply to this sort of Nick

Iam sure u can see where the problem is left.
I have only tested it as Nick Check being loaded last.

Cheers / G8

[G-T-E]Gate?

Mutor will do.

I thought this would be interesting

G8

NightLitch

Doesn't above script do what it should ???

Kepp all users with numbers in nickname out ??

like:

2112[TAG]323nickname4343
or
[TAG]323nickname4343
or
[TAG]nickname4343
or
[TAG]323nickname
or
3232[TAG]323nickname

etc...

??????

seam to works for me ??

/NL
//NL

[G-T-E]Gate?

NL it disconnects [TAG]Nick like [10Mbit]Nick when I test it, it shouldnt.

G8

[G-T-E]Gate?

Oh and Nick1213 enters the hub , it should not..

G8

SMF spam blocked by CleanTalk