PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Peura on 04 August, 2004, 07:20:57

Title: Check nick names in Ptokax
Post by: Peura on 04 August, 2004, 07:20:57
Ptokax has nick check... it use COUNTRY_CODE check... but i would like it to check user nick like this....

[10Mbit];[5Mbit];[1Mbit];[0.5Mbit];[0.2Mbit]

How i can to this?
Title:
Post by: Snooze on 04 August, 2004, 08:20:12
have a look at this script by nErBoS


--Requested by Manonmoon72
--Show Country Prefix Accept by (uk-kingdom)pH?tt?
--Made by nErBoS

showacceptions = 1 --1 will show country codes they can use
sRedAddy = "1.1.1." --Address that users will be redirect if not have the allowed prefix

countrycode = {
"[UK]",
"[USA]",
"[PT]",
} --Write in this Table The Country Code Accepted in your Hub

sBot = "Country-Code"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user, data)
if (CheckCountryCode(user) == 0) then
user:SendData(sBot, "You don't have a Country Code or a Strange Country Code.")
user:SendData(sBot, "Please write in your nick your Country Code. eg [Country_Code]your_nick")
if (showacceptions == 1) then
local cod = "\n\n"
user:SendData(sBot, "Current country codes accepted are as follows: ")
for country,code in countrycode do
cod = cod.."\t"..code.."\n"
end
user:SendData(sBot,cod)
end
user:SendData(sBot,"Rederecting...")
user:SendData("$ForceMove "..sRedAddy.."|")
end
end

function CheckCountryCode(user)
local found = 0
for i=1, getn(countrycode) do
if (strsub(strlower(user.sName),1,strlen(countrycode[i])) == strlower(countrycode[i])) then
found = 1
break
end
end
return found
end
Title: No vip check
Post by: Peura on 04 August, 2004, 19:20:21
QuoteOriginally posted by Snooze
have a look at this script by nErBoS


--Requested by Manonmoon72
--Show Country Prefix Accept by (uk-kingdom)pH?tt?
--Made by nErBoS

showacceptions = 1 --1 will show country codes they can use
sRedAddy = "1.1.1." --Address that users will be redirect if not have the allowed prefix

countrycode = {
"[UK]",
"[USA]",
"[PT]",
} --Write in this Table The Country Code Accepted in your Hub

sBot = "Country-Code"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user, data)
if (CheckCountryCode(user) == 0) then
user:SendData(sBot, "You don't have a Country Code or a Strange Country Code.")
user:SendData(sBot, "Please write in your nick your Country Code. eg [Country_Code]your_nick")
if (showacceptions == 1) then
local cod = "\n\n"
user:SendData(sBot, "Current country codes accepted are as follows: ")
for country,code in countrycode do
cod = cod.."\t"..code.."\n"
end
user:SendData(sBot,cod)
end
user:SendData(sBot,"Rederecting...")
user:SendData("$ForceMove "..sRedAddy.."|")
end
end

function CheckCountryCode(user)
local found = 0
for i=1, getn(countrycode) do
if (strsub(strlower(user.sName),1,strlen(countrycode[i])) == strlower(countrycode[i])) then
found = 1
break
end
end
return found
end

This script is great...! THX

one more thing... how i can change it like that it wont check vip users.
Title: someone?
Post by: Peura on 05 August, 2004, 21:19:06
someone? please!
Title:
Post by: nErBoS on 12 August, 2004, 17:19:53
Hi,

Done...

--Requested by Manonmoon72
--Show Country Prefix Accept by (uk-kingdom)pH?tt?
--Made by nErBoS

showacceptions = 1 --1 will show country codes they can use
sRedAddy = "1.1.1." --Address that users will be redirect if not have the allowed prefix

countrycode = {
"[UK]",
"[USA]",
"[PT]",
} --Write in this Table The Country Code Accepted in your Hub

sBot = "Country-Code"

function Main()
frmHub:RegBot(sBot)
end

function NewUserConnected(user)
if (user.iProfile ~= 2 and CheckCountryCode(user) == 0) then
user:SendData(sBot, "You don't have a Country Code or a Strange Country Code.")
user:SendData(sBot, "Please write in your nick your Country Code. eg [Country_Code]your_nick")
if (showacceptions == 1) then
local cod = "\n\n"
user:SendData(sBot, "Current country codes accepted are as follows: ")
for country,code in countrycode do
cod = cod.."\t"..code.."\n"
end
user:SendData(sBot,cod)
end
user:SendData(sBot,"Rederecting...")
user:SendData("$ForceMove "..sRedAddy.."|")
end
end

function CheckCountryCode(user)
local found = 0
for i=1, getn(countrycode) do
if (strsub(strlower(user.sName),1,strlen(countrycode[i])) == strlower(countrycode[i])) then
found = 1
break
end
end
return found
end

Best regards, nErBoS

Back to my vacations :)
Title: thx
Post by: Peura on 23 August, 2004, 12:25:07
thx...  :))