PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: Hemarr on 31 December, 2007, 15:19:59

Title: English speaking only hub
Post by: Hemarr on 31 December, 2007, 15:19:59
Hi I would like to request 1 or maybe 2 scripts for new API


One that checks all users signing in to see if their nick contains any letter not in english keyboard and if it does it will not allow them access to hub and Send them message that only English letter nicks allowed

Also one thats reads main chat and everytime someone types in a word not in english keyboard, i will not type it in but instead sends a pm back to user to user that says English only hub and so on

Happy New Year Everyone
Thankyou in advance
Title: Re: English speaking only hub
Post by: Thor on 31 December, 2007, 15:37:18
Try this:
sNickMsg = "Please correct your nickname, use just english letters in it."
sMsgMsg = "In the mainchat you can't use non-english characters."

ChatArrival = function(user, data)
if user.iProfile == -1 then
local _,_,msg = data:find("%b<>%s(.*)|")
if msg:find("[^%w]") then
Core.SendPmToUser(user,SetMan.GetString(21),sMsgMsg.."|")
end
end
end

UserConnected = function(user)
if user.iProfile == -1 then
if user.sNick:find("[^%w%[%]]") then
Core.SendPmToUser(user,SetMan.GetString(21),sNickMsg.."|")
end
end
end

And Happy New Year to You and Everybody Else :)
Title: Re: English speaking only hub
Post by: Hemarr on 31 December, 2007, 15:39:35
Thanks wow that was fast  I'll try it and let you know how it works
Title: Re: English speaking only hub
Post by: Hemarr on 31 December, 2007, 16:22:33
Nope Does not work

still allowing these nicks in

?????13
????????
????????????
????

I need these kind of nicks not allowed into hub or allowed to speak in that language in main

i dont mind if they use it in pm to each other
Title: Re: English speaking only hub
Post by: Hemarr on 31 December, 2007, 16:48:36
Ok awesome Typhoon modified your script for me and now it works flawless
here it is


sNickMsg = "Please correct your nickname, use just english letters in it. use these characters. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#&()<>+=_-"
sMsgMsg = "In the mainchat you can't use non-english characters. use these characters. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#&()<>+=_-"

ChatArrival = function(user, data)
if user.iProfile == -1 then
local _,_,msg = data:find("%b<>%s(.*)|")
if not msg:find("[a-zA-Z0-9!@#&()<>+=_-]") then
Core.SendPmToUser(user,SetMan.GetString(21),sMsgMsg.."|")
return true
end
end
end

UserConnected = function(user)
if user.iProfile == -1 then
if not user.sNick:find("[a-zA-Z0-9!@#&()<>+=_-]") then
Core.SendPmToUser(user,SetMan.GetString(21),sNickMsg.."|")
Core.Disconnect(user.sNick)
return true
end
end
end







Thanks For the original Idea
Title: Re: English speaking only hub
Post by: Hemarr on 31 December, 2007, 20:24:42
Thanks Mutor

Quote"Does it? It appears than any English character in either nick or chat will null the trigger."


Your 100% right one user got in with a 61 added to his nick


Thanks for the revision
Happy New Year
Title: Re: English speaking only hub
Post by: Hemarr on 02 January, 2008, 20:06:42
For the most part the script is working but some still talk in main in non english
and script does not catch

like this Guy       [RU] <D0Z0R>  ??? ? ?? 


Don't want non english speaking in hub
Title: Re: English speaking only hub
Post by: Hemarr on 04 January, 2008, 13:54:58
Yes I am using your script and yes i use english characters
It does block i would say 99% of those characters  ( ??? ? ??  )
but some do still talk like that in main so some do get through

could be another script might haver beem writting at same time.  \

it does Happen.

Anyway its 99% effective and thats more than good enough for me

Thankyou for the Modification. :D

I wish more scripts could be that effective.
Title: Re: English speaking only hub
Post by: Hemarr on 05 January, 2008, 04:01:53
Man your awesome . I wish i could write script like you .

Thanks

only check non operators is fine
guests ,regs and vip
Title: Re: English speaking only hub
Post by: Hemarr on 05 January, 2008, 04:17:59
Yes i'm installing now very nice thanks again