[Help] Anti Flood 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

[Help] Anti Flood Script

Started by nEgativE, 17 April, 2004, 07:50:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nEgativE

Hi there, is this script reseting ok ?!
I had TempBan for 20, and when the user get in after that, the script is still banning the user.

--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(user)
	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

[NL]trucker

luso

if i,m right this script is only banning folks who hammer or connect to much to the server.

when he comes back after the tempban and the script is banning again it mostly means he is still hammering .
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


nEgativE

Hum.. my idea of this script was kind of.. if the user join and part for a long time the script will ban him for x time.. with a reason, then after x time he could get in.. and if he still flood connecting for some reason, then he get banned again (tempban). so that reset i think it's needed to, becouse the script is banning as soon as the user get in. sorry the english !! :)

plop

user:Ban()
thats no tempban, it's a permanent ban.
what gets reset is the login counter.

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

nEgativE

QuoteOriginally posted by plop
user:Ban()
thats no tempban, it's a permanent ban.
what gets reset is the login counter.

plop

Yep, i know plop, i have changed to user:TempBan()
but the login counter is not reseting i think, when the tempban expires and the user get in, he will be banned at first login.

plop

the timer isn't very precise, it's about 10 mins +.
the smaller the hub the less precise it is.
but this version should do a lot better on those small hub's.
added a reset on userconnected.
--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(user)
   if HomeMadeTimer ~= strfind(date("%M"), "^%d") then 
      HomeMadeTimer = strfind(date("%M"), "^%d") 
      lucifer = nil
      lucifer = {}
   end
	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
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 <----<<

SMF spam blocked by CleanTalk