RoboCopv8b or standalone script Nick check - Page 2
 

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.

NightLitch

ok gonna check it some more then
//NL

nErBoS

#26
Hi,

Little suggestion then...

----------------------------------------
-----------------------------------------
--// 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
--// Little Modification by nErBoS
-----------------------------------------
-----------------------------------------
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,num2 = strfind(Nick, "(%d+)%S+(%d+)")
			if (num1 ~= nil or num2 ~= nil) then
				sUser:SendData("It is not allowed to have numbers in your nick...")
				sUser:Disconnect()
			end
		end
	end
end
-----------------------------------------
-----------------------------------------

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

NightLitch

This should be the final code...

takes on nicks with and without [TAG].

Not Allowed Nicks:

123Nick
123Nick456
Nick123
123[TAG]Nick
123[TAG]456Nick
123[TAG]456Nick789
[TAG]123Nick456
[TAG]123Nick
[TAG]Nick123

----------------------------------------
-----------------------------------------
--// 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
--// Bug fixed so not Nick234 or 535Nick432 can slip through
-----------------------------------------
-----------------------------------------
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,tag1,num2,tag2,num3 = strfind(Nick, "^(%d*)(%p*%P*%p*)(%d*)(%D*)(%d*)")
			if tag1~="" and tag2=="" then
				s,e,num1,tag1,num2 = strfind(Nick, "^(%d*)(%D*)(%d*)")
			end
			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
-----------------------------------------
-----------------------------------------

Enjoy / NL
//NL

SMF spam blocked by CleanTalk