No Numbers in Nickname 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

No Numbers in Nickname Check

Started by NightLitch, 01 July, 2004, 11:55:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

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

[G-T-E]Gate?

NIGHTLITCH Ur A WIZARD !!
Ur final Result is JUST AMAZING !!!
A toast to u my friend is worth loads Thanks from G8

Iam sure that loads of our members at Lua will enjoy this script u made for me... Tks again ...

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

pHaTTy

QuoteOriginally posted by NightLitch
----------------------------------------
-----------------------------------------
--// 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

u should also add filter setting for []nick

as utb and some others sometimes use [420]Nick
Resistance is futile!

[G-T-E]Gate?

I already check it pH?tt? and they get in as well
G8

NightLitch

QuoteOriginally posted by [G-T-E]Gate?
NIGHTLITCH Ur A WIZARD !!
Ur final Result is JUST AMAZING !!!
A toast to u my friend is worth loads Thanks from G8

Iam sure that loads of our members at Lua will enjoy this script u made for me... Tks again ...


Am just doing my job ;-P hehe

poff / NL
//NL

NightLitch

QuoteOriginally posted by (uk-kingdom)pH?tt?
u should also add filter setting for []nick

as utb and some others sometimes use [420]Nick

Check it real good Phatty m8 the you see it is a ok code... ;-D

cheers / NL
//NL

[G-T-E]Gate?

NL
 I wanna thank u once again, I never had such a CLEAN Users List before and I mean Really Clean !!!!!!!!!!!
Thanks M8

Regards and Happy Summer
G8

[G-T-E]Gate?

A new request
 NightLitch
Emperor

Its still concerning Nick Checker,
Can u adjust the scipt so that it does not check the profiles  Master, Operator,Vip, Reg, Moderator and Netfounder
That would be the Gr8
G8

NightLitch

Gonna see what I can do when I get the time...

Cheers / NL
//NL

[G-T-E]Gate?

ok NL looking forward to another testrun
G8   ;)

NightLitch

New one out:

----------------------------------------
-----------------------------------------
--// 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
--// Added ProfileChecking
--// Registered UsersName is Case Sensitive...
-----------------------------------------
-----------------------------------------

--// Level Check ( Just fix it so your Profiles.dat is right for this table... )
ProfileCheck = {
[-1] = 1, -- User
[3] = 2, -- Reg
[2] = 3, -- Vip
[1] = 4, -- Operator
[0] = 5, --Master
}

--// User over This level is not Checked...
CheckLevel = 3

-----------------------------------------
-----------------------------------------
RegT = {}
RegF = "../RegisteredUsers.dat"

function Main()
	LoadRegistredFile()
end

function DataArrival(sUser, sData)
	if strsub(sData, 1, 13) == "$ValidateNick" then
		local s,e,Nick = strfind(sData, "k (.*)%|$")
		if Nick then
			if tonumber(ProfileCheck[LevelCheck(Nick)]) <= tonumber(CheckLevel) 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
end

function LevelCheck(nick)
	if RegT[nick] then
		return RegT[nick][2]
	else
		return -1
	end
end

function LoadRegistredFile()
	local handle = openfile(RegF, "r")
	if (handle) then
    		local line = read(handle)
    		while line do
			s,e,nick,password,status = strfind(line, "(.+)|(.+)|(%d+)")
			RegT[strlower(nick)] = {password, status}
			line = read(handle)
    		end
  		closefile(handle)
	end
end

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

Hope it works as it should / NL
//NL

[G-T-E]Gate?

will testrun i a bit , so many new users that need assistance .
Thanks M8
G8

NightLitch

All ready notice a bug that I will fix...
//NL

NightLitch

Updated:

----------------------------------------
-----------------------------------------
--// 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
--// Added ProfileChecking
--// Registered UsersName is Case Sensitive...
-----------------------------------------
-----------------------------------------

--// Level Check ( Just fix it so your Profiles.dat is right for this table... )
ProfileCheck = {
[-1] = 1, -- User
[3] = 2, -- Reg
[2] = 3, -- Vip
[1] = 4, -- Operator
[0] = 5, --Master
}

--// User over This level is not Checked...
CheckLevel = 3

-----------------------------------------
-----------------------------------------
RegT = {}
RegF = "../RegisteredUsers.dat"

function Main()
	LoadRegistredFile()
end

function DataArrival(sUser, sData)
	if strsub(sData, 1, 13) == "$ValidateNick" then
		local s,e,Nick = strfind(sData, "k (.*)%|$")
		if Nick then
			Profile = LevelCheck(Nick)
			if ProfileCheck[tonumber(Profile)] <= tonumber(CheckLevel) 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
end

function LevelCheck(nick)
	if RegT[nick] then
		return RegT[nick][2]
	else
		return -1
	end
end

function LoadRegistredFile()
	local handle = openfile(RegF, "r")
	if (handle) then
    		local line = read(handle)
    		while line do
			s,e,nick,password,status = strfind(line, "(.+)|(.+)|(%d+)")
			RegT[nick] = {password, status}
			line = read(handle)
    		end
  		closefile(handle)
	end
end

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

Enjoy / NL
//NL

[G-T-E]Gate?

After running it for a few days the Response was PERFECT !!!

Tks again
 G8

"Its grand with summer house cleaning"

NightLitch

QuoteOriginally posted by [G-T-E]Gate?
After running it for a few days the Response was PERFECT !!!

Tks again
 G8

"Its grand with summer house cleaning"

yw / NL =)
//NL

[G-T-E]Gate?

Oppps!!!

 [0,5Mbit]Nick , [0.5Mbit]Nick , [1.5Mbit]Nick and [1,5Mbit]Nick is disconnected >>not good :(

But whole numericals [10Mbit]Nick gets in.

What ya think NL ???

G8

NightLitch

gonna see what I can do / NL
//NL

plop

here is the strfind for it.
i leave it 2 nightlitch 2 stuff it into the script.
tTable = {
["[0,5Mbit]Nick"]=1, 
["[0.5Mbit]Nick"]=1 , 
["[1.5Mbit]Nick"]=1 , 
["[1,5Mbit]Nick"]=1,
["[10Mbit]Nick"]=1
}

print("")

function checkprefix(Nick)
   local s,e,num1,tag1,num2,tag2,num3 = strfind(Nick, "^(%d*)(%p*[%.%,%P]*%p*)(%d*)(%D*)(%d*)")
   print(Nick)
   print(tag1)
   print("")
end

for a,b in tTable do
   checkprefix(a)
end
the result=
[1.5Mbit]Nick
[1.5Mbit]

[0,5Mbit]Nick
[0,5Mbit]

[10Mbit]Nick
[10Mbit]

[1,5Mbit]Nick
[1,5Mbit]

[0.5Mbit]Nick
[0.5Mbit]
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

NightLitch

Updated:

----------------------------------------
-----------------------------------------
--// 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
--// Added ProfileChecking
--// Registered UsersName is Case Sensitive...
--// Updated strfind, thx 2 Plop
-----------------------------------------
-----------------------------------------

--// Level Check ( Just fix it so your Profiles.dat is right for this table... )
ProfileCheck = {
[-1] = 1, -- User
[3] = 2, -- Reg
[2] = 3, -- Vip
[1] = 4, -- Operator
[0] = 5, --Master
}

--// User over This level is not Checked...
CheckLevel = 3

-----------------------------------------
-----------------------------------------
RegT = {}
RegF = "../RegisteredUsers.dat"

function Main()
	LoadRegistredFile()
end

function DataArrival(sUser, sData)
	if strsub(sData, 1, 13) == "$ValidateNick" then
		local s,e,Nick = strfind(sData, "k (.*)%|$")
		if Nick then
			Profile = LevelCheck(Nick)
			if ProfileCheck[tonumber(Profile)] <= tonumber(CheckLevel) 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
end

function LevelCheck(nick)
	if RegT[nick] then
		return RegT[nick][2]
	else
		return -1
	end
end

function LoadRegistredFile()
	local handle = openfile(RegF, "r")
	if (handle) then
    		local line = read(handle)
    		while line do
			s,e,nick,password,status = strfind(line, "(.+)|(.+)|(%d+)")
			RegT[nick] = {password, status}
			line = read(handle)
    		end
  		closefile(handle)
	end
end
-----------------------------------------
-----------------------------------------

Enjoy / NL
//NL

[G-T-E]Gate?

On to testing ..................
Thanks NL & Plop

Gate

belea

Hi there,

Can someone modify that script to let only the ppl with nomebrs in the last part of the nickname.. and ppl that have nombers at the begining of the nickname to be kicked ?

like: '1980Nick' to be out and 'Nick1980' to be let alone ?

Thx

SMF spam blocked by CleanTalk