Hey guys :)
I need a screept that kicks unregistered users with nickname [-VIP-]. I have a lot of people in my hub who enter as VIP (and they aren't registered ) and I want to get rid of them ;)
Can someone help me, please? :)
Hava a nice day.
robocop do that
This isn't tested, but I think it should work =
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "vip") then
User:Disconnect()
end
end
end
QuoteOriginally posted by blackwings
This isn't tested, but I think it should work =
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "vip") then
User:Disconnect()
end
end
end
Let them know, why they are disconnected! :)
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "vip") then
User:SendData(" Remove Vip from your nick!")
User:Disconnect()
end
end
end
Darn, you guys are fast :P
Is it possible for the script to PM someone with the reason they were kicked? :P I wouldnt want someone to not know why was he/she kicked :)
I think it should be =
User:SendData(," Remove Vip from your nick!")
Code with the change in it =
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "vip") then
User:SendData(," Remove Vip from your nick!")
User:Disconnect()
end
end
end
If you want this message be sent in PM, change User:SendData(," Remove Vip from your nick!")
to User:SendPM(," Remove Vip from your nick!")
should work ;)
Thanks a lot :)
I also have another question related to PtokaX.
Can anyone tell me why in the mainchat these things appear:
[12:38] va
[12:38] va merge netu?
[12:38] <[Xana][dacia]ssir_kon> nuuuuuuuuuuuuuuuuuuuuu
[12:38] acuma
[12:38] acuma a picat?
[12:38] <[Xana][dacia]ssir_kon> da ce draq are
[12:39] mda
[12:39] mda
[12:39] astas
[12:39] astas e
[12:39] :)
[12:39] :)
Each and everytime I write something I get an echo or something like that. I think it's from one of my scripts... but I'm not sure :(
If u use robocop, then someone is playing with !talk command (should be another OP or something)
Although, there are other possibilities to write something in main without nick
I found the problem... It was from plop's banner scripts :(
Here is the code:
Quote
string = " Welcome to Heaven "
stringloop = string
length = 20
speed = 1300
function Main()
SetTimer(speed)
StartTimer()
stringloop = gsub(stringloop, " ", " ")
end
function OnTimer()
if T == nil then
T = strsub(stringloop, 1, length)
frmHub:RegBot("< "..T.." >")
else
frmHub:UnregBot("< "..T.." >")
stringloop = strsub(stringloop, 2, -1)
if strlen(stringloop) < length then
stringloop = stringloop.." "..string
end
T = strsub(stringloop, 1, length)
frmHub:RegBot("< "..T.." >")
end
end
function OnExit()
frmHub:UnregBot("< "..T.." >")
end
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
if user.iProfile == 0 then
local s,e,cmd,onoff = strfind(data,"^%b<>%s+(%S+)%s*(%S*)")
user:SendData(cmd)
if cmd == "!restartscripts" then
frmHub:UnregBot("-->"..T.."<--")
StopTimer()
elseif cmd == "!light" then
user:SendData(onoff)
if onoff == "on" then
--SetTimer(speed)
T = nil
StartTimer()
User:SendData(" started")
return 1
elseif onoff == "off" then
StopTimer()
frmHub:UnregBot("-->"..T.."<--")
T = nil
User:SendData(" stopped")
return 1
end
end
--else
--user:SendData(" user level 2 low")
end
end
end
[/quote]
Maybe someone can help me in eliminating my problem ;)
Btw, the VIP scripts you sent me dont know how to do their job :(
An intruder already entered my hub :P
this one is tested and it works =
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strlen(data, "vip") then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
end
Weiiird @_o
When I restarted the scripts it disconected me saying "remove VIP from your nick" The only way I could logon to the hub was by deleting the script .... what happened\?
sorry, bug in the script, now it does really work = --##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "vip") then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
end
it works now... thanks my friends :)
Another script, maybe usefull for others:
--## PREFIX CHECKER BOT
--## Requested (and a little modified) by TTB
--## Made by nErBoS
sBot = "[BOT]PLAY"
function Main()
frmHub:RegBot(sBot)
end
function NewUserConnected(user)
if (strlen(user.sName) > 5 and strlower(strsub(user.sName,1,6)) == "[dump]" and user.iProfile ~= 2) then
user:SendData(sBot, "----------------> You aren't a DUMP, so you can't use a dump prefix.")
user:Disconnect()
end
if (strlen(user.sName) > 4 and strlower(strsub(user.sName,1,5)) == "[vip]" and user.iProfile ~= 2) then
user:SendData(sBot, "----------------> You aren't a VIP, so you can't use a vip prefix.")
user:Disconnect()
elseif (strlen(user.sName) > 4 and strlower(strsub(user.sName,1,5)) == "[reg]" and user.iProfile ~= 3) then
user:SendData(sBot, "----------------> You aren't a REG, so you can't use a reg prefix.")
user:Disconnect()
end
end
TTB, that script would be fast if it was in dataArrival and the tags/prefix in a table
some optimisation ..
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
bot="Nick_cheker"
vip_profile = 2
function DataArrival(user , data)
--- if (strfind(user.sMyInfoString, "[VvIiPp]*") and (user.iProfile > vip_profile) then ---- uncommented because see the comment in this post ...
if (strfind(user.sName, "[VvIiPp-]*") and (user.iProfile > vip_profile) ) then
user:SendData(bot," Remove Vip from your nick!")
user:Disconnect()
end
end
usually even one "if" less pays off ;)
NOTE: I uncommented the part that would disconnect when the users $MyINFO has any of 'vip' ..
it is much much safer to use the uncommented 'if' since it is the nickname we are interested in ...
herodes, dunno really, but your script looks wierd and it's specific("I think" ),
I had it to look for "vip" becaue people might have tag like this == [vip], [-vip-] or (vip).
+ is your script really optimized? I think extra code/calculation will only make it slower :P
strfind(user.sName, "[VvIiPp-]*")
I am using regular expressions ...
[VvIiPp-]* means if there is any case of any of the leters V I P and a dash ( - ) it will even get -v-I-P- ...
also better to make more configurable than to be slow and not configurable .. a global variable is making slow only memory wise .. I dont see this issue (memory) arising anywhere near this script's process ..
QuoteOriginally posted by Herodes
strfind(user.sName, "[VvIiPp-]*")
I am using regular expressions ...
[VvIiPp-]* means if there is any case of any of the leters V I P and a dash ( - ) it will even get -v-I-P- ...
this seems to work=
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
--##Added dynamic VIP prefix check
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(User.sName, "[VvIiPp-]*") then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
end
So I don't really need those other calculation that you made to make it check dynamiclly :)
Or am I wrong??
hmm .. you are checking only when they shoot Myinfo ..and you are taking more steps to get there ... the first if that you are doing isnt what you are supp to look for ..
as soon as the user sends a myinfo ptx has a user.sName for him .. no need to check if it is a myinfo arriving ..
doh, how do I do so it will only check in the beginning of the username, I have tried to use = strlower(strsub(user.sName,1,5) in many different ways, but I can't get it to work T-T
QuoteOriginally posted by Herodes
as soon as the user sends a myinfo ptx has a user.sName for him .. no need to check if it is a myinfo arriving ..
Ok, but how do I in a simple way make it only do the dynamic search in the beginning?
QuoteOriginally posted by blackwings
QuoteOriginally posted by Herodes
strfind(user.sName, "[VvIiPp-]*")
I am using regular expressions ...
[VvIiPp-]* means if there is any case of any of the leters V I P and a dash ( - ) it will even get -v-I-P- ...
this seems to work= --##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
--##Added dynamic VIP prefix check
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and
if strfind(User.sName, "[VvIiPp-]*") then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
end
So I don't really need those other calculation that you made to make it check dynamiclly :)
Or am I wrong??
This could be changed to work for reg by changing these bits right?
User.iProfile ~= 3 then
if strfind(User.sName, "[RrEeGg-]*")
User:SendData(bot," Remove Reg from your nick! You are not registered here.")
ya, imby, but I noticed a problem with my dynamic search, it check the whole username for those letters >_>
QuoteOriginally posted by blackwings
doh, how do I do so it will only check in the beginning of the username, I have tried to use = strlower(strsub(user.sName,1,5) in many different ways, but I can't get it to work T-T
QuoteOriginally posted by Herodes
as soon as the user sends a myinfo ptx has a user.sName for him .. no need to check if it is a myinfo arriving ..
Ok, but how do I in a simple way make it only do the dynamic search in the beginning?
this should do .. strfind(User.sName, "^[VvIiPp-%[]()]*")
*EDIT*ignore the message I wrote here before I edited this post.*EDIT*
This one works, it's search for vip dynamically in the the beginning of the username, it's simple and fast.
= --##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
bot="Nick_cheker"
function DataArrival(User , data)
if strfind(User.sName, "^[VvIiPp-%[]()]*") and User.iProfile ~= 2 then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
QuoteOriginally posted by blackwings
*EDIT*ignore the message I wrote here before I edited this post.*EDIT*
This one works, it's search for vip dynamically in the the beginning of the username, it's simple and fast.
= --##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
bot="Nick_cheker"
function DataArrival(User , data)
if strfind(User.sName, "^[VvIiPp-%[]()]*") and User.iProfile ~= 2 then
User:SendData(bot," Remove Vip from your nick!")
User:Disconnect()
end
end
This is the one I should use then?
eh, i'm not sure you got the regular expressions just right. I modded it to:
--##Simple blocking of users that has VIP in username, but isn't a VIP
--##Made by blackwings
--##Fixed the little bug
--##Fixed another bug
bot="Nick_cheker"
function DataArrival(User , data)
if strfind(User.sName, "^[RrEeGg-%[]()]*") and User.iProfile ~= 3 then
User:SendData(bot," Remove Reg from your nick! You are not registered here.")
User:Disconnect()
end
end
An op got disconnected, "Remove Reg from your nick! You are not registered here."
But the op didn't have the word Reg in his nick never mind all the letters of 'reg' in his nick. The ops nick was: "RudolftheFilelistChecker" (don't ask)
lol, I found the problem, it seems like it's only the first letter of for example vip that needs to be at the beginning, the rest can be anywhere in the username :P Until I or Herodes solve the problem, do this if it's only causing problem for one Operator =
Change this line =
if strfind(User.sName, "^[VvIiPp-%[]()]*") and User.iProfile ~= 2 then
TO this line =
if strfind(User.sName, "^[VvIiPp-%[]()]*") and User.iProfile ~= 2 and not User.bOperator then
So, the script works fine as long as I dont have Operators with name "reg" or "vip"? :)
Caused a problem with someone with [ at the start of his name to. A vip.
Ubikk - best to wait till someone sorts this, assuming everyone doesn't ignore it!
QuoteOriginally posted by imby
Caused a problem with someone with [ at the start of his name to. A vip.
Ubikk - best to wait till someone sorts this, assuming everyone doesn't ignore it!
well, we need someone that has more skills then me in lua :P
what it currently do the script is to see if any off those
letters is in the first in the username, so with other words a person called viper and isn't a vip will get blocked
And I thought this was an easy script :D
QuoteOriginally posted by Ubikk
And I thought this was an easy script :D
if you want to have a exact search yes, but this dynamix thingie is more complexed then you think :P
Yea, i was bothering for a week when i found the right pattern matching
This checks:
(prefix)
[prefix]
{prefxi}
and the combos of these brackets: {prefix] for example
more exact search is almost impossible
-- BadPrefixCheck by bastya_elvtars (the rock n' roll doctor)
-- based on AllowNick by Mutor
-- checks the prefix, it must be in right the beginning of the nick
-- checks only unregged users. if they log i with a bad account it means they are guests
-- // config
badpref ={ -- use lowercase please
"[vip]",
"[op]",
"[su]",
"(vip)", -- etc lost patience here :P
}
-- // end of config
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
local sdata=strsub(data,1,strlen(data)-1)
local _,_,nm=strfind(sdata,"$ValidateNick%s+(%S+)")
determineprefix(nm)
end
end
function NewUserConnected(user)
if user.iProfile == -1 then
if checkprefix(user)=="shit" then return 1 end
end
end
function determineprefix(data)
local _,_,pr = strfind(data, "^([%[%{%(]%S+[%)%}%]])%S+")
prefix=strlower(pr)
end
function checkprefix(user)
local prefixes={}
for a=1,getn(badpref) do
prefixes[badpref[a]]=1
end
if not prefixes[prefix] then
user:SendData("NickNameCheck", "\r\nYou are not allowed to use this prefix::"..prefix)
user:Disconnect() prefixes=nil return "shit"
end prefixes={}
end
if it does not work, someone might fix it, cause i will soon start home and cone only back on 28th
my first version of my script does already do the thinge with checking for vip with different brackets and mine is much simplier bastya ;) What we are trying to do is a dynamix search for VIP in the beginning of the username.
QuoteOriginally posted by blackwings
my first version of my script does already do the thinge with checking for vip with different brackets and mine is much simplier bastya ;) What we are trying to do is a dynamix search for VIP in the beginning of the username.
bah here u can add anything
btw this 1 disconnects user before getting MOTD etc >>> less b/w intensive
but as u think...
btw to give u a hint: search for alphabet chars only, the others may be gsubbed with ""
if my script aint good... :S
QuoteOriginally posted by bastya_elvtars
btw to give u a hint: search for alphabet chars only, the others may be gsubbed with ""
if my script aint good... :S
well, my knowledge isn't good enough, and the lua4 manuals doesn't help so much, their should be more like = Lua4 manual for ptokax lua programmers :P What I learn is through seeing others scripts :P
blackwings' version does disconnect before the MOTD and i like his version because it's simple!
Are none of the really advanced scripters reading this? ;(
the Lua manual is really complicated for me, it's made for people who are already advanced at coding i think.
Well, I dont want such complicated scripts :D
I just want a script that disconnects a user with tag [-VIP-], [VIP], [-Vip-] or [Vip]
That's all ;)
Now, can someone tell me wich of the shown scripts is good for that? :)
into mine you can add anything, it detects
but if you prefer small scripts use blackwings' one
*** edit ***
an advice to ppl wanting 2 make scripts:
open existing scripts and try finding out what it is doing. if you cannot, open the lua manual
and if somebody wants to help atleast refuse him kindly, bw
QuoteOriginally posted by bastya_elvtars
Yea, i was bothering for a week when i found the right pattern matching
This checks:
(prefix)
[prefix]
{prefxi}
and the combos of these brackets: {prefix] for example
more exact search is almost impossible
-- BadPrefixCheck by bastya_elvtars (the rock n' roll doctor)
-- based on AllowNick by Mutor
-- checks the prefix, it must be in right the beginning of the nick
-- checks only unregged users. if they log i with a bad account it means they are guests
-- // config
badpref ={ -- use lowercase please
"[vip]",
"[op]",
"[su]",
"(vip)", -- etc lost patience here :P
}
-- // end of config
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
local sdata=strsub(data,1,strlen(data)-1)
local _,_,nm=strfind(sdata,"$ValidateNick%s+(%S+)")
determineprefix(nm)
end
end
function NewUserConnected(user)
if user.iProfile == -1 then
if checkprefix(user)=="shit" then return 1 end
end
end
function determineprefix(data)
local _,_,pr = strfind(data, "^([%[%{%(]%S+[%)%}%]])%S+")
prefix=strlower(pr)
end
function checkprefix(user)
local prefixes={}
for a=1,getn(badpref) do
prefixes[badpref[a]]=1
end
if not prefixes[prefix] then
user:SendData("NickNameCheck", "\r\nYou are not allowed to use this prefix::"..prefix)
user:Disconnect() prefixes=nil return "shit"
end prefixes={}
end
if it does not work, someone might fix it, cause i will soon start home and cone only back on 28th
This script isn't good at all.
Every user with prefixe [] before his name is disconnected
Hmm, it hasn't the dynamic blocking of VIP. But it will block people with this =
[VIP], [Vip], [vip]
(VIP), (Vip), (vip)
{VIP}, {Vip}, {vip}
etc etc etc
Made it like this until somone more skilled solve the dynamic blocking issue--##Simple Non-VIP Blocking 1.1
--##Made by blackwings
--##If a non-VIP has these in the username = VIP,Vip or vip, the user will get disconnected
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "VIP") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "vip") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "Vip") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
end
end
end
For all combinations:
--##Simple Non-VIP Blocking 1.1
--##Made[SIZE=1]9[/SIZE] by blackwings
--##If a non-VIP has these in the username = VIP,Vip or vip, the user will get disconnected
--##Modified by 6Marilyn6Manson6 at 12-22-2004 14:00 for: VIP, vip, Vip, vIp, viP, VIp, ViP, or vIP
bot="Nick_cheker"
function DataArrival(User , data)
if strsub(data, 1, 7) == "$MyINFO" and User.iProfile ~= 2 then
if strfind(data, "VIP") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "vip") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "Vip") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "vIp") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "viP") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "VIp") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "ViP") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
elseif strfind(data, "vIP") then
User:SendData(bot," Remove VIP from your nick!")
User:Disconnect()
end
end
end
bye bye ;)
QuoteOriginally posted by 6Marilyn6Manson6
For all combinations:
well, I just took the 3 most common ones :P
You know, to just have it simple and if anyone wants to add more, then they are welcome to do it :)
QuoteOriginally posted by blackwings
QuoteOriginally posted by 6Marilyn6Manson6
For all combinations:
well, I just took the 3 most common ones :P
You know, to just have it simple and if anyone wants to add more, then they are welcome to do it :)
;) lol
I hope your last script works, blakcwings, cause I'm tired of my hub members complaints :(
QuoteOriginally posted by Ubikk
I hope your last script works, blakcwings, cause I'm tired of my hub members complaints :(
It should work without a problem, because this is a exact search, not dynamic, so there won't be problems with users username.
QuoteOriginally posted by blackwings
QuoteOriginally posted by Ubikk
I hope your last script works, blakcwings, cause I'm tired of my hub members complaints :(
It should work without a problem, because this is a exact search, not dynamic, so there won't be problems with users username.
It works just fine and this is all I needed. Thanx again :D
Why create such a big script that could be so small...
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
--###############################################--
BotName = "TagCheck"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
if strfind(strlower(sData), "[%p+vip]") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
end
end
end
--###############################################--
--// NightLitch
Mery Christmas // NightLitch
NL, does your script do a dynamic search for VIP? (I mean different combination of big and small letters?)
EDIT: %p punctuation characters o.O
why did you choose to use that NL?
QuoteOriginally posted by blackwings
NL, does your script do a dynamic search for VIP? (I mean different combination of big and small letters?)
EDIT: %p punctuation characters o.O
why did you choose to use that NL?
blackwing I suggest you try it and find a way through it with diff. VIp setups...
Ex:
[_(V-I-P)_]
[ViP]
[-v-I-p]
[.,V-I-P,.]
just a few...
/NL
another thing... check the code REALLY hard it is not that big...
you will se I do strlower on sData.... duhh...
/NL
%p is for every symbol char. as I understand it...
if you can break thourgh my VIP Check plz tell me how...
/NL
QuoteOriginally posted by NightLitch
%p is for every symbol char. as I understand it...
if you can break thourgh my VIP Check plz tell me how...
/NL
right now I'm really tired and tomorrow it's xmas, but the day after I will test....hmm, or should I test it now....
EDIT: hmm, ya its impossible, it blocks everyone, even if you don't have vip in the username, not even one of the letters v, i or p.
EDIT 2: Maybe it finds something else in the MyInfo that has the letter combination vip :P
EDIT 3: This also happend me when I earlier tried to solve the problem. It seems like something doesn't like strlower/strsub in the script.
maybe there is no simple way to solve it >_>
this should be ok...
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
--###############################################--
BotName = "TagCheck"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
if strfind(strlower(sData), "%p*v%p*i%p*p%p*") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
end
end
end
--###############################################--
--// NightLitch
Merry Christmas // NightLitch
"%p*v%p*i%p*p%p*"
so i guess this bit is changing to:
"%p*r%p*e%p*g%p*"
for me eh? cool, gonna do some testing.
NL, now it works perfectly, a simple and dynamic blocking of fake VIP's :). And yes imby, that should work.
For those that have both VIP and REG tags in the hub, this might be good for you = --###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Added: Blocking against fake REG users - by blackwings 2004-12-25
--###############################################--
BotName = "TagCheck"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
if strfind(strlower(sData), "%p*v%p*i%p*p%p*") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
elseif strfind(strlower(sData), "%p*r%p*e%p*g%p*") and sUser.iProfile ~= 3 then
sUser:SendData(BotName, "Remove REG Tag from your nickname!")
sUser:Disconnect()
end
end
end
--###############################################--
--// NightLitch
Ok, I noticed that people with username like reggie or viper
will get blocked, so I created a dynamic search of VIP within the signs = [], (), or {}
and as before it will check for combination like =
VIP, vip, Vip, -VIP-, -V-I-P-
And other combinations with other signs then - .
(I wonder if = %c control characters, means that it will try all these signs = [], (), or {})
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Added: Blocking against fake REG users - by blackwings 2004-12-25
-- Fixed: Users with a name like = reggie or viper, won't get blocked - by blackwings 2004-12-25
--###############################################--
BotName = "TagCheck"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
--VIP--------------------------------------------------------------------------------------------
if strfind(strlower(sData), "%[%p*v%p*i%p*p%p*%]") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
elseif strfind(strlower(sData), "%(%p*v%p*i%p*p%p*%)") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
elseif strfind(strlower(sData), "%{%p*v%p*i%p*p%p*%}") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname!")
sUser:Disconnect()
end
--REG--------------------------------------------------------------------------------------------
if strfind(strlower(sData), "%[%p*r%p*e%p*g%p*%]") and sUser.iProfile ~= 3 then
sUser:SendData(BotName, "Remove REG Tag from your nickname!")
sUser:Disconnect()
elseif strfind(strlower(sData), "%(%p*r%p*e%p*g%p*%)") and sUser.iProfile ~= 3 then
sUser:SendData(BotName, "Remove REG Tag from your nickname!")
sUser:Disconnect()
elseif strfind(strlower(sData), "%{%p*r%p*e%p*g%p*%}") and sUser.iProfile ~= 3 then
sUser:SendData(BotName, "Remove REG Tag from your nickname!")
sUser:Disconnect()
end
end
end
--###############################################--
--// NightLitch
Try to keep it small blackwings :-)
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Updated:
-- - Checks for users that should not have [VIP] or [REG]
-- in the Nickname.
-- Advanced Tags: [__V--i--P__}, {_V_]i[_P_}
--###############################################--
BotName = "TagCheck"
--###############################################--
sVipTag = "%p*v%p*i%p*p%p*"
sRegTag = "%p*r%p*e%p*g%p*"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
local _,_,sTag = strfind(strlower(sData), "[%[%{%(](%S+)[%]%}%)]")
if sTag then
if strfind(strlower(sTag), sVipTag) or strfind(strlower(sTag), sRegTag) and sUser.iProfile ~= 3 or sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP / REG Tag from your nickname! Tag: "..sTag)
sUser:Disconnect()
end
end
end
end
--###############################################--
--// NightLitch
Happy New Year // NightLitch
I haven't test it, but it seems very nice, but personally, I think this would be better
(better control with the profile/message thingie. And without the global varibles, the script is almost as short as yours) = --###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Updated:
-- - Checks for users that should not have [VIP] or [REG]
-- in the Nickname.
-- Advanced Tags: [__V--i--P__}, {_V_]i[_P_}
-- Modded by blackwings
--###############################################--
BotName = "TagCheck"
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
local _,_,sTag = strfind(strlower(sData), "[%[%{%(](%S+)[%]%}%)]")
if sTag then
if strfind(strlower(sTag), "%p*v%p*i%p*p%p*") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "Remove VIP Tag from your nickname! Tag: "..sTag)
sUser:Disconnect()
elseif strfind(strlower(sTag), "%p*r%p*e%p*g%p*") and sUser.iProfile ~= 3 then
sUser:SendData(BotName, "Remove REG Tag from your nickname! Tag: "..sTag)
sUser:Disconnect()
end
end
end
end
--###############################################--
--// NightLitch
Here this is a the final piece you will ever need.
You can put in more Tags you don't want...
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Updated:
-- - Checks for users that should not have [VIP] or [REG]
-- in the Nickname.
-- Advanced Tags: [__V--i--P__}, {_V_]i[_P_}
--###############################################--
BotName = "TagCheck"
--###############################################--
iTags = {
["vip"] = "Remove VIP Tag from your nickname !!",
["reg"] = "Remove REG Tag from your nickname !!",
}
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
local _,_,sTag = strfind(strlower(sData), "[%[%{%(](%S+)[%]%}%)]")
if sTag then
local _,_,p1,p2,p3 = strfind(sTag, "%p*(%a*)%p*(%a*)%p*(%a*)%p*")
sTag = p1..p2..p3
if iTags[sTag] then
sUser:SendData(BotName, iTags[sTag])
sUser:Disconnect()
end
end
end
end
--###############################################--
--// NightLitch
//NL
QuoteOriginally posted by NightLitch
Here this is a the final piece you will ever need.
You can put in more Tags you don't want...
--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Updated:
-- - Checks for users that should not have [VIP] or [REG]
-- in the Nickname.
-- Advanced Tags: [__V--i--P__}, {_V_]i[_P_}
--###############################################--
BotName = "TagCheck"
--###############################################--
iTags = {
["vip"] = "Remove VIP Tag from your nickname !!",
["reg"] = "Remove REG Tag from your nickname !!",
}
--###############################################--
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
local _,_,sTag = strfind(strlower(sData), "[%[%{%(](%S+)[%]%}%)]")
if sTag then
local _,_,p1,p2,p3 = strfind(sTag, "%p*(%a*)%p*(%a*)%p*(%a*)%p*")
sTag = p1..p2..p3
if iTags[sTag] then
sUser:SendData(BotName, iTags[sTag])
sUser:Disconnect()
end
end
end
end
--###############################################--
--// NightLitch
//NL
This script keeps those out with a tag which they shouldn't have, but unfortunately it also keeps out the genuine users with a correct tag/profile.
if you just want to stop non-VIP/REG users to have VIP/REG tag, then use the script I posted just before NightLitch last post.
QuoteOriginally posted by blackwings
if you just want to stop non-VIP/REG users to have VIP/REG tag, then use the script I posted just before NightLitch last post.
I did, it works good, but... now we're on LUA 5 :D
*hint hint*
QuoteOriginally posted by imby
QuoteOriginally posted by blackwings
if you just want to stop non-VIP/REG users to have VIP/REG tag, then use the script I posted just before NightLitch last post.
I did, it works good, but... now we're on LUA 5 :D
*hint hint*
heh, you have the ptokax beta :P you found out what the adress to the hub where PPK is >_>
QuoteOriginally posted by blackwings
QuoteOriginally posted by imby
QuoteOriginally posted by blackwings
if you just want to stop non-VIP/REG users to have VIP/REG tag, then use the script I posted just before NightLitch last post.
I did, it works good, but... now we're on LUA 5 :D
*hint hint*
heh, you have the ptokax beta :P you found out what the adress to the hub where PPK is >_>
Just used some common sense to find him :) Gonna be tough though as I don't even have a simple !kick script. Maybe I should put more effort into learning scripting myself, or maybe ask optimus if i can beta test the new robocop. - Aint gonna happen :))