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.
please is someone gonna look into this request??
i reeeeeeeeaaaaaaaaly would like to have it :-)))
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
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
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
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.................:/
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
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."
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
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']
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
hmm im not to sure about the homemade timer it tho....:/
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
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
hmm thx i will sure take a close look :)
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
hello plop and phatty
it seems the last update did it:-))
working good now thanks all.
your welcome m8 :)
You don't mind if i implente this do ya? :)
well sure i certainly dont mind at all dont think plop does neither if you take his version yep :))
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
Thanks, Just to be sure....
Ofcorse i'll make a comment that i got the idea or that it was based on yours :D