PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Dessamator on 23 March, 2005, 23:06:50

Title: 3x Bad Pass cleaner
Post by: Dessamator on 23 March, 2005, 23:06:50
--Requested by blackwings
--Made by nErBoS
--lua 5 by Dessamator
sBot = "Bad Password Cleaner"

fPermBan = "../PermBan.dat"
arrAux = {}
sec = 1000
min = 60*sec
hour = 60*min
iTime = 15*min-- Checking Time

function Main()
frmHub:RegBot(sBot)
SetTimer(iTime)
StartTimer()
end

function OnTimer()
CheckForBan()
CleanBan()
end

function CheckForBan()
local file = io.input(fPermBan)
for sLine in file:lines() do
if (sLine == nil) then
break
else
local s,e,ip,reason = string.find(sLine, "(%S+)|(%S+%s+%S+%s+%S+)")
if (ip ~= nil and reason ~= nil and reason == "3x bad password") then
arrAux[ip] = 1
end
end
end
file:close()
end

function CleanBan()
local ip,aux
for ip, aux in arrAux do
Unban(ip)
end
end
 
Title: nice but dont work
Post by: dragos_sto on 25 March, 2005, 02:51:53
dont work whit ptoka server 0.3.3.0  build 16.06
error
)
Syntax \scripts\passwordcleaner.lua:25: bad argument #1 to `input' (../PermBan.dat: Permission denied
)
Title:
Post by: Typhoon on 25 March, 2005, 03:16:49
check the Lua 5 script database at

             http://ptokaxscripts.sytes.net


Typhoon?
Title:
Post by: Dessamator on 25 March, 2005, 13:55:00
yaps i had fixed that error before, but i think i was kinda tired when i posted that, :D, error corrected, post edited up there, or u can,
Quotecheck the Lua 5 script database at     http://ptokaxscripts.sytes.net       Typhoon

more specifically::
Quotehttp://ptokaxscripts.sytes.net/e107_files/public/baddpassbanremover.lua