PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: LoTeK_ on 07 May, 2005, 14:56:40

Title: banned ip remover
Post by: LoTeK_ on 07 May, 2005, 14:56:40
Hi, does anyone have a script for Ptokax 17.03 to remove permanently banned ip after xx time automatically?

Title:
Post by: Typhoon on 07 May, 2005, 15:15:51
This should do what you want..



-- Auto Clear Perm Banlist by Typhoon?
-- Request by LoTek
-- hope it does what you need



--// Time Units
sTime = {}
sTime["Sec"]  = 1000
sTime["Min"]  = 60*sTime.Sec
sTime["Hour"] = 60*sTime.Min
sTime["Day"]  = 24*sTime.Hour
sTime["Week"]  = 7*sTime.Day
sTime["Month"]  = 30*sTime.Day
sTime["Year"]  = 365*sTime.Day
sTime["Interval"] = 2 -- changed interval here

function Main()
SetTimer(sTime.Interval*sTime.Day) -- change Day with different choice, default is cleared everu 2 days
StartTimer()
end

function OnTimer()
SendToOps("BanList was cleared")
ClearPermBan()
end


Typhoon?
Title:
Post by: LoTeK_ on 07 May, 2005, 17:31:40
QuoteOriginally posted by Typhoon?
This should do what you want..



-- Auto Clear Perm Banlist by Typhoon?
-- Request by LoTek
-- hope it does what you need



--// Time Units
sTime = {}
sTime["Sec"]  = 1000
sTime["Min"]  = 60*sTime.Sec
sTime["Hour"] = 60*sTime.Min
sTime["Day"]  = 24*sTime.Hour
sTime["Week"]  = 7*sTime.Day
sTime["Month"]  = 30*sTime.Day
sTime["Year"]  = 365*sTime.Day
sTime["Interval"] = 2 -- changed interval here

function Main()
SetTimer(sTime.Interval*sTime.Day) -- change Day with different choice, default is cleared everu 2 days
StartTimer()
end

function OnTimer()
SendToOps("BanList was cleared")
ClearPermBan()
end


Typhoon?

Watching the code, it looks like this clears out all permbanlist, I would like to leave nicks banned, but not ips, is possibile to do so?
Title:
Post by: 6Marilyn6Manson6 on 07 May, 2005, 18:26:20
QuoteOriginally posted by LoTeK_
QuoteOriginally posted by Typhoon?
This should do what you want..



-- Auto Clear Perm Banlist by Typhoon?
-- Request by LoTek
-- hope it does what you need



--// Time Units
sTime = {}
sTime["Sec"]  = 1000
sTime["Min"]  = 60*sTime.Sec
sTime["Hour"] = 60*sTime.Min
sTime["Day"]  = 24*sTime.Hour
sTime["Week"]  = 7*sTime.Day
sTime["Month"]  = 30*sTime.Day
sTime["Year"]  = 365*sTime.Day
sTime["Interval"] = 2 -- changed interval here

function Main()
SetTimer(sTime.Interval*sTime.Day) -- change Day with different choice, default is cleared everu 2 days
StartTimer()
end

function OnTimer()
SendToOps("BanList was cleared")
ClearPermBan()
end


Typhoon?

Watching the code, it looks like this clears out all permbanlist, I would like to leave nicks banned, but not ips, is possibile to do so?

Not is possible LoteK_ ... not exist option for Clear only nick sorry :P
Title:
Post by: LoTeK_ on 08 May, 2005, 04:56:36
no, not nick, ips, i would like to leave nicks banned, but to clears ips every xx time automatically.
Title:
Post by: NightLitch on 08 May, 2005, 12:53:32
Ok this should work then:

--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// Clear PermBanList on IPs by NightLitch
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
interval_time = 1
interval_value  = "month"
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
sTime = {}
sTime["sec"]  = 1000
sTime["min"]  = 60*sTime.sec
sTime["hour"] = 60*sTime.min
sTime["day"]  = 24*sTime.hour
sTime["week"]  = 7*sTime.day
sTime["month"]  = 30*sTime.day
sTime["year"]  = 365*sTime.day
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function Main()
SetTimer(tonumber(interval_time) * sTime[string.lower(interval_value)])
StartTimer()
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function OnTimer()
local c = 0
local list = frmHub:GetPermBanList()
for i = 1,table.getn(list) do
if string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
end
end
SendToOps(frmHub:GetHubBotName(), "*** "..c.." IPs has been unbanned from Banlist")
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// NightLitch

Cheers
Title:
Post by: NightLitch on 08 May, 2005, 13:01:10
Updated:

--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// Clear PermBanList by NightLitch
--// Version:
--//     0.1 - Created Bot
--//     0.2 - Added Unban mode. Unban Nick(s) or IP(s)
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
interval_time = 1 -- enter a number
interval_value  = "month" -- enter sec, min, hour, day, week, month, year
unban_mode = 1 -- 1 = unban IPs  /  0 = unban Nicks
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
sTime = {}
sTime["sec"]  = 1000
sTime["min"]  = 60*sTime.sec
sTime["hour"] = 60*sTime.min
sTime["day"]  = 24*sTime.hour
sTime["week"]  = 7*sTime.day
sTime["month"]  = 30*sTime.day
sTime["year"]  = 365*sTime.day
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function Main()
SetTimer(tonumber(interval_time) * sTime[string.lower(interval_value)])
StartTimer()
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function OnTimer()
local c = 0
local list = frmHub:GetPermBanList()
for i = 1,table.getn(list) do
if tonumber(unban_mode) == 1 and string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
elseif tonumber(unban_mode) == 0 and not string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
end
end
if tonumber(unban_mode) == 1 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." IP(s) have been unbanned from Banlist")
elseif tonumber(unban_mode) == 0 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." Nick(s) have been unbanned from Banlist")
end
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// NightLitch
Title:
Post by: 6Marilyn6Manson6 on 08 May, 2005, 13:04:59
QuoteOriginally posted by NightLitch
Updated:

--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// Clear PermBanList by NightLitch
--// Version:
--//     0.1 - Created Bot
--//     0.2 - Added Unban mode. Unban Nick(s) or IP(s)
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
interval_time = 1 -- enter a number
interval_value  = "month" -- enter sec, min, hour, day, week, month, year
unban_mode = 1 -- 1 = unban IPs  /  0 = unban Nicks
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
sTime = {}
sTime["sec"]  = 1000
sTime["min"]  = 60*sTime.sec
sTime["hour"] = 60*sTime.min
sTime["day"]  = 24*sTime.hour
sTime["week"]  = 7*sTime.day
sTime["month"]  = 30*sTime.day
sTime["year"]  = 365*sTime.day
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function Main()
SetTimer(tonumber(interval_time) * sTime[string.lower(interval_value)])
StartTimer()
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function OnTimer()
local c = 0
local list = frmHub:GetPermBanList()
for i = 1,table.getn(list) do
if tonumber(unban_mode) == 1 and string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
elseif tonumber(unban_mode) == 0 and not string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
end
end
if tonumber(unban_mode) == 1 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." IP(s) have been unbanned from Banlist")
elseif tonumber(unban_mode) == 0 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." Nick(s) have been unbanned from Banlist")
end
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// NightLitch

NightLitch is king of LUA :D.. i'm you're best fan LOL
Title:
Post by: NightLitch on 08 May, 2005, 13:09:40
QuoteOriginally posted by 6Marilyn6Manson6
NightLitch is king of LUA :D.. i'm you're best fan LOL

Well thank you...  :D

Been a while since I posted something here now...

Though I would try and start helping out again...

When I have some time over  :P

Cheers // NL
Title:
Post by: 6Marilyn6Manson6 on 08 May, 2005, 13:18:57
Eheeheheh NightLitch no prob.. you're the king and we wait new release of Thor in LUA 5... Go Go NightLitch ;)
Title:
Post by: LoTeK_ on 09 May, 2005, 02:36:18
QuoteOriginally posted by NightLitch
Updated:

--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// Clear PermBanList by NightLitch
--// Version:
--//     0.1 - Created Bot
--//     0.2 - Added Unban mode. Unban Nick(s) or IP(s)
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
interval_time = 1 -- enter a number
interval_value  = "month" -- enter sec, min, hour, day, week, month, year
unban_mode = 1 -- 1 = unban IPs  /  0 = unban Nicks
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
sTime = {}
sTime["sec"]  = 1000
sTime["min"]  = 60*sTime.sec
sTime["hour"] = 60*sTime.min
sTime["day"]  = 24*sTime.hour
sTime["week"]  = 7*sTime.day
sTime["month"]  = 30*sTime.day
sTime["year"]  = 365*sTime.day
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function Main()
SetTimer(tonumber(interval_time) * sTime[string.lower(interval_value)])
StartTimer()
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
function OnTimer()
local c = 0
local list = frmHub:GetPermBanList()
for i = 1,table.getn(list) do
if tonumber(unban_mode) == 1 and string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
elseif tonumber(unban_mode) == 0 and not string.find(list[i].sIP, "%d+%.%d+%.%d+%.%d+") then
c = c + 1
Unban(list[i].sIP)
end
end
if tonumber(unban_mode) == 1 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." IP(s) have been unbanned from Banlist")
elseif tonumber(unban_mode) == 0 then
SendToOps(frmHub:GetHubBotName(), "*** "..c.." Nick(s) have been unbanned from Banlist")
end
end
--//+++++++++++++++++++++++++++++++++++++++++++++++++++++++
--// NightLitch

thanks, you made me a very happy man :P
1 question, what is interval_time = 1 -- enter a number
thanks again.
Title:
Post by: jiten on 09 May, 2005, 08:00:00
If the values were: interval time = 2 and interval value = "day", the PermBanList check and cleaning would be done every 2 days.

Best regards
Title: Re: banned ip remover
Post by: Envinyatar on 12 March, 2006, 21:51:09
How do I get this script to clean both banned ip's and nick's?

Also just to make sure I got it right:
This script will delete the bans that are older then x time?
It wont clear the whole banlist when it starts up, right?
Title: Re: banned ip remover
Post by: Envinyatar on 23 March, 2006, 18:48:45
Is there really noone who can answer my q's?
Title: Re: banned ip remover
Post by: 6Marilyn6Manson6 on 23 March, 2006, 20:08:32
-- Auto Clear Perm Banlist by Typhoon?
-- Request by LoTek
-- hope it does what you need
--// Small Touched by 6Marilyn6Manson6 23/03/2006
BotName = frmHub:GetHubBotName()
Message = "Perm/Temp BanList Was Cleared"
--// Time Units
sTime = {}
sTime["Sec"]   = 1000
sTime["Min"]   = 60*sTime.Sec
sTime["Hour"]  = 60*sTime.Min
sTime["Day"]   = 24*sTime.Hour
sTime["Week"]  = 7*sTime.Day
sTime["Month"] = 30*sTime.Day
sTime["Year"]  = 365*sTime.Day
sTime["Interval"] = 2 -- changed interval here
--//

function Main()
SetTimer(sTime.Interval*sTime.Day) -- change Day with different choice, default is cleared everu 2 days
StartTimer()
end
function OnTimer()
ClearTempBan()
ClearPermBan()
SendToOps(BotName,Message)
end
--// 6Marilyn6Manson6


You like this?
Title: Re: banned ip remover
Post by: bastya_elvtars on 23 March, 2006, 20:19:33
I can look into it later, but it can be done, though it has to know the exact time of the ban.
6Marilyn6Manson6 it should NOT clearthe banlist, as previously stated.
Title: Re: banned ip remover
Post by: 6Marilyn6Manson6 on 23 March, 2006, 20:22:17
QuoteHow do I get this script to clean both banned ip's and nick's?

I have read this :D

and I have tested it...

[2006-03-23 | 20:27:18] <[666]-LawMaker-> Perm/Temp BanList Was Cleared
[2006-03-23 | 20:27:34] <[666]-LawMaker-> *** 82.59.84.79 is banned by 6Marilyn6Manson6
[2006-03-23 | 20:27:39] <[666]-LawMaker-> *** 82.59.84.80 is banned by 6Marilyn6Manson6
[2006-03-23 | 20:27:41] <[666]-LawMaker-> *** 82.59.84.81 is banned by 6Marilyn6Manson6
[2006-03-23 | 20:27:48] <[666]-LawMaker-> Perm/Temp BanList Was Cleared


here work ( i have set interval at 30seconds ) ^^