illegal VIP scripts - Page 2
 

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

illegal VIP scripts

Started by Ubikk, 20 December, 2004, 10:38:47

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Herodes

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-%[]()]*")

blackwings

#26
*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


imby

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?

imby

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)

blackwings

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


Ubikk

So, the script works fine as long as I dont have Operators with name "reg" or "vip"? :)

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!

blackwings

#32
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


Ubikk

And I thought this was an easy script :D

blackwings

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


bastya_elvtars

#35
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
Everything could have been anything else and it would have just as much meaning.

blackwings

#36
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.


bastya_elvtars

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...
Everything could have been anything else and it would have just as much meaning.

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
Everything could have been anything else and it would have just as much meaning.

blackwings

#39
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


imby

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?  ;(

imby

the Lua manual is really complicated for me, it's made for people who are already advanced at coding i think.

Ubikk

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? :)

bastya_elvtars

#43
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
Everything could have been anything else and it would have just as much meaning.

Ubikk

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

blackwings

#45
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


6Marilyn6Manson6

#46
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 ;)

blackwings

#47
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  :)


6Marilyn6Manson6

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

Ubikk

I hope your last script works, blakcwings, cause I'm tired of my hub members complaints :(

SMF spam blocked by CleanTalk