I have script that check every newuser that their nickname include a proper ISP. The format is [ISP]NickName. But I only know how to check the string for the word (example) [TELIA] and _not_ that it really begins with it.
--->
for key, value in GOODISP do
if (strfind(strlower(curUser.sName), strlower(value),1,1)) then
x=1
break
else
x=0
end
end
--->
so if a user logs-in with EvilTerry[TELIA] he will be accepted :(
So how can I check that a nickname BEGINS with [ISP] ?
"GOODISP" is a string containing about 15 different ISP names.
GOODISP looks more like a table..
if it were associative this could be easier
local s, e, tag = strfind(user.sName, "^(%b[])")
if tag then
tag = strlower(tag)
for id, name in GOODISP do
if tag == name then return end
end user:SendData("*** Invalid tag")
end user:SendData("*** No tag")
user:Disconnect()