anti flooder/connection script
 

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

anti flooder/connection script

Started by [NL]trucker, 01 December, 2003, 11:52:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

hello you fine scripters.

i would like to have a script that prevents users to log in
more than a specific numbers of times .

the problem i have is that i get flooded by messages
like user xxx has connected
      user xxx  has been disconnected

so i want a script that allows users to log in 3-5 times per minut and after that he gets tempbanned for trying to do that more times.

with a message to the user why he is tempbanned.

like you have been tempbanned for trying to log in more then x times pro minut.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

please is someone gonna look into this request??

i reeeeeeeeaaaaaaaaly would like to have it :-)))
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


plop

QuoteOriginally posted by [NL]trucker
please is someone gonna look into this request??

i reeeeeeeeaaaaaaaaly would like to have it :-)))
it's allready in my future 2do list, odin also requested it.
but it's not in a hurry yet.
so maby some1 else can do it or wait for my version if/when it is released.
gotta find a decent way 2 do it 1st.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

pHaTTy

hmm not mucg time, one in G-5 will be so much bettr but here a qucik one ;)


--quick anti hammer v1 by Phatty
--will reset on scripts restart


function Main()
Bot = "GoD"
lucifer = {}
hammeramount = 5
end

function NewUserConnected(jesus)
	if lucifer[user.sName]==nil then
		lucifer[user.sName]=1
	elseif lucifer[user.sName]==hammeramount then
		user:Ban()
		SendPmToOps(Bot,user.sName.." has been lucified for hammering the server")
	else
		lucifer[user.sName]=lucifer[user.sName]+1
	end
end

l8rr,,

-phatz
Resistance is futile!

plop

i gues in G-5 there whill be a timer 2 reset the count, because this version whill ban every1 after 5 attempts  even if it's over a 5 day period.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

pHaTTy

he he he yep like i said it quick he he he


G-5 if the user has been in hub for over 10mins they will be reset, but, only thing, im having lots a truble with huge timer.................:/
Resistance is futile!

plop

how about this. ??
--quick anti hammer v1 by Phatty
--will reset on scripts restart
-- reset every 10 mins without timer by plop

function Main()
Bot = "GoD"
lucifer = {}
hammeramount = 5
end

function NewUserConnected(jesus)
	if lucifer[user.sName]==nil then
		lucifer[user.sName]=1
	elseif lucifer[user.sName]==hammeramount then
		user:Ban()
		SendPmToOps(Bot,user.sName.." has been lucified for hammering the server")
	else
		lucifer[user.sName]=lucifer[user.sName]+1
	end
end

function DataArrival(user, data) 
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
end
works as a timer 2 reset every 10 mins.
you can also move it 2 the NewUserConnected so it's procest a bit less.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

[NL]trucker

thnx folks

one question left how to make sure he gets a message to with the reason?

is it with :
SendPmToUser(Bot,user.sName..") "you have been tempbanned for connecting more than x times pro min."
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


plop

is this like you want it ??
--quick anti hammer v1 by Phatty
--will reset on scripts restart


function Main()
Bot = "GoD"
lucifer = {}
hammeramount = 5
time = 20 -- mins duration of the ban
end

function NewUserConnected(jesus)
	if lucifer[user.sName]==nil then
		lucifer[user.sName]=1
	elseif lucifer[user.sName]==hammeramount then
		SendPmToOps(Bot,user.sName.." has been lucified for hammering the server")
      user:SendPM(Bot, "you have been tempbanned for "..time.." min, because of connecting more than "..hammeramount.." times in 10 min. |")
      user:TimeBan(time)
	else
		lucifer[user.sName]=lucifer[user.sName]+1
	end
end

function DataArrival(user, data) 
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
end
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

[NL]trucker

yep you hit the spot plop


but i get this error message in ptotax

Syntax error: attempt to index global `user' (a nil value)
stack traceback:
   1:  function `NewUserConnected' at line 12 [file `E:\ptotaxbuild15.16\scripts\anti-hammer.lua']
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


pHaTTy

loool

--quick anti hammer v1 by Phatty
--will reset on scripts restart


function Main()
Bot = "GoD"
lucifer = {}
hammeramount = 5
time = 20 -- mins duration of the ban
end

function NewUserConnected(user)
	if lucifer[user.sName]==nil then
		lucifer[user.sName]=1
	elseif lucifer[user.sName]==hammeramount then
		SendPmToOps(Bot,user.sName.." has been lucified for hammering the server")
      		user:SendPM(Bot, "you have been tempbanned for "..time.." min, because of connecting more than "..hammeramount.." times in 10 min. |")
      		user:TimeBan(time)
	else
		lucifer[user.sName]=lucifer[user.sName]+1
	end
end

function DataArrival(user, data) 
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
end
Resistance is futile!

pHaTTy

hmm im not to sure about the homemade timer it tho....:/
Resistance is futile!

pHaTTy

hmmm

--quick anti hammer v1 by Phatty
--will reset on scripts restart


function Main()
	Bot = "GoD"
	lucifer = {}
	hammeramount = 5
	time = 20
	SetTimer(10*60000)
end

function OnTimer()
	ResetCounter()
	StopTimer()
end

function ResetCounter()
	lucifer = {}
	SendPmToOps(Bot,"Hammer counter has been reset")
end

function NewUserConnected(user)
	if lucifer[user.sName]==nil then
		lucifer[user.sName]=1
	elseif lucifer[user.sName]==hammeramount then
		SendPmToOps(Bot,user.sName.." has been lucified for hammering the server")
      		user:SendPM(Bot, "you have been tempbanned for "..time.." min, because of connecting more than "..hammeramount.." times in 10 min. |")
      		user:TimeBan(time)
		StartTimer()
	else
		lucifer[user.sName]=lucifer[user.sName]+1
	end
end
Resistance is futile!

plop

QuoteOriginally posted by [NL]trucker
yep you hit the spot plop


but i get this error message in ptotax

Syntax error: attempt to index global `user' (a nil value)
stack traceback:
   1:  function `NewUserConnected' at line 12 [file `E:\ptotaxbuild15.16\scripts\anti-hammer.lua']
loooooooooooooooooooool
blame phatty.
function NewUserConnected(jesus)
jesus instead of user

phatty give it a try, i'm using the same here on my registered user cleaner and it's working great.
had 2 find something as freeslots used the timer alllready.
[00:00] <-Bure-> The cleaner has been called. Every registered user who hasn't been in the hub for 4 weeks will be deleted. (contact the OP's if your gone be away for a period longer then that)
as you can see it triggers on midnight there as i use the change of date.
programing = 80% creativety and 20% knowledge.
if you don't got an idea... you don't get to the programming.
%M minute (48) [00?59]
as you can see it always returns 2 numbers, i'm using the 1st number wich as everybody knows changes every 10 minutes.
try it, maby it can solve your problems on G-5.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

pHaTTy

hmm thx i will sure take a close look :)
Resistance is futile!

pHaTTy

well actually i can show you a trick, i am using my timer for many things loool, chatbot, freeslots, and sharechecker and some others, its about sending different data, and setting diferr settings,

if setting == 1 then


dataarival

if cmd = "freeslots" then
setting = 1
whatevr then at end of the freeslots you nil the setting ;)


l8r
Resistance is futile!

[NL]trucker

hello plop and phatty

it seems the last update did it:-))

working good now thanks all.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


pHaTTy

your welcome m8 :)
Resistance is futile!

kepp

You don't mind if i implente this do ya? :)
Guarding    

pHaTTy

well sure i certainly dont mind at all dont think plop does neither if you take his version yep :))
Resistance is futile!

plop

every piece of code i post here on the forum may be used by every1 on every way he/she likes.
no need 2 ask, if you like it use it, or modify it 2 your needs.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

Thanks, Just to be sure....
Ofcorse i'll make a comment that i got the idea or that it was based on yours :D
Guarding    

SMF spam blocked by CleanTalk