RoboCopv8b or standalone script Nick check - Page 2
 

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