hmmm this script check and banns ops and vips to. and i don't know how to stopp it doing it. canb some one help?
-- SpamBan
---------------------------------------
-- version: 1.2 (06.2.2003)
-- author: DirtyFinger
-- email: [EMAIL]DirtyFinger@gmx.net[/EMAIL]
-- ICQ : 145873101
-- HomePage: [URL]http://mitglied.lycos.de/dirtyfinger01/[/URL]
-- (Yes, i know i still suck as Web Designer)
--=====================================
--This script automatically bans pm-spammers and mainchat-spammers.
--
--This does not protect from spam, but at least the spammer can't come back (at least not with the same ip)
--For the script to work you might have to change the PtokaX flood-protection values (chat limit in the 'Rules and bots' section)
--The script bans by default after 20 pms are being sent within 10 seconds.
-- But if the hub disconnects BEFORE the script triggers, no banning is possible and the spammer can come back.
--So choose some quite generous settings, e.g. the first line of the above spam contains about 400 characters.
--For the script to trigger you have to allow the users to send 8000 characters per second so the script can trigger.
--
--Don't worry, real flooders send much much more so you'll be fine.
--
-- Version Changes :
--1.2 : bans mainchat flooder too. I didn't implement it in previous versions because i thought ptokax dealt with it.
--1.1 : removed the mainchat flooding of ban notifications
--1.0 : first version
sBotName = "(-Alexandra-)"
PMCount = {}
MainCount = {}
MaxPM = 4 -- more than 4 pms within 10 seconds cause a ban
MaxMain = 4 -- more than 4 mainchat msgs within 10 seconds cause a ban
timeslice = 10*1000 -- 10 seconds
function Main()
frmHub:RegBot(sBotName)
SendToAll(sBotName.." "..date(" launched at %B %d %Y %X "))
SetTimer(timeslice)
StartTimer()
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
function OnTimer()
--for k,v in PMCount do
--SendToAll("---------",k.."\t"..v)
--end
PMCount = {}
MainCount = {}
end
function FloodDetected (curUser,sData)
local message = " -= Spam Warning =-"
local name,ip = curUser.sName,curUser.sIP
SendToAll ("# "..sBotName.."-Alert #--> "..name .. " has been banned for spamming.")
message = message .."\r\n\t\t"
.. "Violation detected by: " .. name .."\r\n\t\t"
.. "IP: " .. ip .. "\t\r\n\t\t"
.. "Last packet : \t" .. sData
SendPmToOps (sBotName,message)
curUser:Ban()
curUser:Disconnect()
end
i hope you understand :)
hehe i been banned for like 40 times i chat to much lol
:D 8)
-- SpamBan
---------------------------------------
-- version: 1.2 (06.2.2003)
-- author: DirtyFinger
-- email: [EMAIL]DirtyFinger@gmx.net[/EMAIL]
-- ICQ : 145873101
-- HomePage: [URL]http://mitglied.lycos.de/dirtyfinger01/[/URL]
-- (Yes, i know i still suck as Web Designer)
--=====================================
--This script automatically bans pm-spammers and mainchat-spammers.
--
--This does not protect from spam, but at least the spammer can't come back (at least not with the same ip)
--For the script to work you might have to change the PtokaX flood-protection values (chat limit in the 'Rules and bots' section)
--The script bans by default after 20 pms are being sent within 10 seconds.
-- But if the hub disconnects BEFORE the script triggers, no banning is possible and the spammer can come back.
--So choose some quite generous settings, e.g. the first line of the above spam contains about 400 characters.
--For the script to trigger you have to allow the users to send 8000 characters per second so the script can trigger.
--
--Don't worry, real flooders send much much more so you'll be fine.
--
-- Version Changes :
--1.2 : bans mainchat flooder too. I didn't implement it in previous versions because i thought ptokax dealt with it.
--1.1 : removed the mainchat flooding of ban notifications
--1.0 : first version
sBotName = "(-Alexandra-)"
PMCount = {}
MainCount = {}
MaxPM = 4 -- more than 4 pms within 10 seconds cause a ban
MaxMain = 4 -- more than 4 mainchat msgs within 10 seconds cause a ban
timeslice = 10*1000 -- 10 seconds
function Main()
frmHub:RegBot(sBotName)
SendToAll(sBotName.." "..date(" launched at %B %d %Y %X "))
SetTimer(timeslice)
StartTimer()
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
function OnTimer()
--for k,v in PMCount do
--SendToAll("---------",k.."\t"..v)
--end
PMCount = {}
MainCount = {}
end
function FloodDetected (curUser,sData)
if curUser.bOperator then
return 1
else
local message = " -= Spam Warning =-"
local name,ip = curUser.sName,curUser.sIP
SendToAll ("# "..sBotName.."-Alert #--> "..name .. " has been banned for spamming.")
message = message .."\r\n\t\t"
.. "Violation detected by: " .. name .."\r\n\t\t"
.. "IP: " .. ip .. "\t\r\n\t\t"
.. "Last packet : \t" .. sData
SendPmToOps (sBotName,message)
curUser:Ban()
curUser:Disconnect()
end
Im still a newbie
if curUser.bOperator then
return 1
else
If it dosen't help don't blame me :P
how do i put that code in there?
plz help :)
anyone plz help me with this one ;(
?nake
if i,m right you put it after this line
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if curUser.bOperator then
return 1
else
now you have it this way
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
dont blame me if it isnt working as i,m still trying to learn.
QuoteOriginally posted by [NL]trucker
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if curUser.bOperator then
return 1
else
now you have it this way
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
dont blame me if it isnt working as i,m still trying to learn.
gone be a hub with nice quiet OP's if you do it like that. lol
the location is correct trucker, but return 1 stops all data going out.
you can guess the result. lol
now he also wanted a bypase for VIP's.
so better 2 use:
if user.iProfile==-1 or user.iProfile == 3 then
up 2 you trucker 2 insert it in the script.
plop
okej thnks for the help but .... :)
i am kind of lost hehe cold you remake it?
for me plz
:)
QuoteOriginally posted by ?nake
okej thnks for the help but .... :)
i am kind of lost hehe cold you remake it?
for me plz
:)
i'm hoping trucker or maby kepp are gone fix it as they wanne learn it.
i hope you can understand this, if they don't just post here again 2morrow and i'll fix it.
plop
I will leave this one to trucker, :)
Trucker Whanna help me with this one?
ore somebody plz :)
:)
here is a solusion:
if strfind(sData,"$To:") and not curUser.bOperator then
and
elseif strfind(sData,curUser.sName,1,plain) == 2 and not curUser.bOperator then
play with it... but this will do what you want.
thanks m8 but where shoul i put them in witch line?
sorry to bugg you again :) :P
Well look at the lines and look in the script...
just exchange the lines with the one above.
if you not get it. I'll post the function l8r.
ok i will give it a try thnks
?(
nope i couldent figure it out.
can you help me?
ore somebody plz
replace the DataArival function in the script for this 1.
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if user.iProfile==-1 or user.iProfile == 3 then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if user.iProfile==-1 or user.iProfile == 3 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
end
plop
thnks plop.
just in case is this right??
Quote-- SpamBan
---------------------------------------
-- version: 1.2 (06.2.2003)
-- author: DirtyFinger
-- email: DirtyFinger@gmx.net
-- ICQ : 145873101
-- HomePage: http://mitglied.lycos.de/dirtyfinger01/
-- (Yes, i know i still suck as Web Designer)
--=====================================
--This script automatically bans pm-spammers and mainchat-spammers.
--
--This does not protect from spam, but at least the spammer can't come back (at least not with the same ip)
--For the script to work you might have to change the PtokaX flood-protection values (chat limit in the 'Rules and bots' section)
--The script bans by default after 20 pms are being sent within 10 seconds.
-- But if the hub disconnects BEFORE the script triggers, no banning is possible and the spammer can come back.
--So choose some quite generous settings, e.g. the first line of the above spam contains about 400 characters.
--For the script to trigger you have to allow the users to send 8000 characters per second so the script can trigger.
--
--Don't worry, real flooders send much much more so you'll be fine.
--
-- Version Changes :
--1.2 : bans mainchat flooder too. I didn't implement it in previous versions because i thought ptokax dealt with it.
--1.1 : removed the mainchat flooding of ban notifications
--1.0 : first version
sBotName = "(-Alexandra-)"
PMCount = {}
MainCount = {}
MaxPM = 4 -- more than 4 pms within 10 seconds cause a ban
MaxMain = 4 -- more than 4 mainchat msgs within 10 seconds cause a ban
timeslice = 10*1000 -- 10 seconds
function Main()
frmHub:RegBot(sBotName)
SendToAll(sBotName.." "..date(" launched at %B %d %Y %X "))
SetTimer(timeslice)
StartTimer()
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if user.iProfile==-1 or user.iProfile == 3 then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if user.iProfile==-1 or user.iProfile == 3 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
end
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
function OnTimer()
--for k,v in PMCount do
--SendToAll("---------",k.."\t"..v)
--end
PMCount = {}
MainCount = {}
end
function FloodDetected (curUser,sData)
local message = " -= Spam Warning =-"
local name,ip = curUser.sName,curUser.sIP
SendToAll ("# "..sBotName.."-Alert #--> "..name .. " has been banned for spamming.")
message = message .."\r\n\t\t"
.. "Violation detected by: " .. name .."\r\n\t\t"
.. "IP: " .. ip .. "\t\r\n\t\t"
.. "Last packet : \t" .. sData
SendPmToOps (sBotName,message)
curUser:Ban()
curUser:Disconnect()
end
nope, you left a piece of the old function.
-- SpamBan
---------------------------------------
-- version: 1.2 (06.2.2003)
-- author: DirtyFinger
-- email: [EMAIL]DirtyFinger@gmx.net[/EMAIL]
-- ICQ : 145873101
-- HomePage: [URL]http://mitglied.lycos.de/dirtyfinger01/[/URL]
-- (Yes, i know i still suck as Web Designer)
--=====================================
--This script automatically bans pm-spammers and mainchat-spammers.
--
--This does not protect from spam, but at least the spammer can't come back (at least not with the same ip)
--For the script to work you might have to change the PtokaX flood-protection values (chat limit in the 'Rules and bots' section)
--The script bans by default after 20 pms are being sent within 10 seconds.
-- But if the hub disconnects BEFORE the script triggers, no banning is possible and the spammer can come back.
--So choose some quite generous settings, e.g. the first line of the above spam contains about 400 characters.
--For the script to trigger you have to allow the users to send 8000 characters per second so the script can trigger.
--
--Don't worry, real flooders send much much more so you'll be fine.
--
-- Version Changes :
--1.2 : bans mainchat flooder too. I didn't implement it in previous versions because i thought ptokax dealt with it.
--1.1 : removed the mainchat flooding of ban notifications
--1.0 : first version
sBotName = "(-Alexandra-)"
PMCount = {}
MainCount = {}
MaxPM = 4 -- more than 4 pms within 10 seconds cause a ban
MaxMain = 4 -- more than 4 mainchat msgs within 10 seconds cause a ban
timeslice = 10*1000 -- 10 seconds
function Main()
frmHub:RegBot(sBotName)
SendToAll(sBotName.." "..date(" launched at %B %d %Y %X "))
SetTimer(timeslice)
StartTimer()
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if user.iProfile==-1 or user.iProfile == 3 then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if user.iProfile==-1 or user.iProfile == 3 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
end
function OnTimer()
--for k,v in PMCount do
--SendToAll("---------",k.."\t"..v)
--end
PMCount = {}
MainCount = {}
end
function FloodDetected (curUser,sData)
local message = " -= Spam Warning =-"
local name,ip = curUser.sName,curUser.sIP
SendToAll ("# "..sBotName.."-Alert #--> "..name .. " has been banned for spamming.")
message = message .."\r\n\t\t"
.. "Violation detected by: " .. name .."\r\n\t\t"
.. "IP: " .. ip .. "\t\r\n\t\t"
.. "Last packet : \t" .. sData
SendPmToOps (sBotName,message)
curUser:Ban()
curUser:Disconnect()
end
just a msg 2 every1, if you post a script place it between [ C O D E ] script here [ / C O D E ] (but without the spaces).
and try 2 leave it in tabbed state so it stays readable.
thx
plop
ohh thanks
oki will do ;)
sorry to bother again but i keep getting this error
Syntax error: attempt to index global `user' (a nil value)
stack traceback:
1: function `DataArrival' at line 56 [file `...nistrat?r\Skrivbord\dc HUB\scripts\aspamban.lua']
:(
PLZ IM BEGGING YOU *CRYES* *cryes*
this line is wrong to what you have:
if user.iProfile==-1 or user.iProfile == 3 then
should be:
if curUser.iProfile==-1 or curUser.iProfile == 3 then
look here on dataarrival:
function DataArrival(curUser, sData)
it says curUser not user.
Called curUser with user
-- SpamBan
---------------------------------------
-- version: 1.2 (06.2.2003)
-- author: DirtyFinger
-- email: [EMAIL]DirtyFinger@gmx.net[/EMAIL]
-- ICQ : 145873101
-- HomePage: [URL]http://mitglied.lycos.de/dirtyfinger01/[/URL]
-- (Yes, i know i still suck as Web Designer)
--=====================================
--This script automatically bans pm-spammers and mainchat-spammers.
--
--This does not protect from spam, but at least the spammer can't come back (at least not with the same ip)
--For the script to work you might have to change the PtokaX flood-protection values (chat limit in the 'Rules and bots' section)
--The script bans by default after 20 pms are being sent within 10 seconds.
-- But if the hub disconnects BEFORE the script triggers, no banning is possible and the spammer can come back.
--So choose some quite generous settings, e.g. the first line of the above spam contains about 400 characters.
--For the script to trigger you have to allow the users to send 8000 characters per second so the script can trigger.
--
--Don't worry, real flooders send much much more so you'll be fine.
--
-- Version Changes :
--1.2 : bans mainchat flooder too. I didn't implement it in previous versions because i thought ptokax dealt with it.
--1.1 : removed the mainchat flooding of ban notifications
--1.0 : first version
sBotName = "(-Alexandra-)"
PMCount = {}
MainCount = {}
MaxPM = 4 -- more than 4 pms within 10 seconds cause a ban
MaxMain = 4 -- more than 4 mainchat msgs within 10 seconds cause a ban
timeslice = 10*1000 -- 10 seconds
function Main()
frmHub:RegBot(sBotName)
SendToAll(sBotName.." "..date(" launched at %B %d %Y %X "))
SetTimer(timeslice)
StartTimer()
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
if strfind(sData,"$To:") then
if curUser.iProfile==-1 or curUser.iProfile == 3 then
if PMCount[curUser.sIP] ~= nil then
PMCount[curUser.sIP] = PMCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if PMCount[curUser.sIP] > MaxPM then
FloodDetected (curUser, sData)
PMCount[curUser.sIP] = -100
end
else
PMCount[curUser.sIP] = 1
end
end
elseif strfind(sData,curUser.sName,1,plain) == 2 then
if curUser.iProfile==-1 or curUser.iProfile == 3 then
if MainCount[curUser.sIP] ~= nil then
MainCount[curUser.sIP] = MainCount[curUser.sIP] +1
--SendToAll("----",PMCount[curUser.sIP])
if MainCount[curUser.sIP] > MaxMain then
FloodDetected (curUser, sData)
MainCount[curUser.sIP] = -100
end
else
MainCount[curUser.sIP] = 1
end
end
end
end
function OnTimer()
--for k,v in PMCount do
--SendToAll("---------",k.."\t"..v)
--end
PMCount = {}
MainCount = {}
end
function FloodDetected (curUser,sData)
local message = " -= Spam Warning =-"
local name,ip = curUser.sName,curUser.sIP
SendToAll ("# "..sBotName.."-Alert #--> "..name .. " has been banned for spamming.")
message = message .."\r\n\t\t"
.. "Violation detected by: " .. name .."\r\n\t\t"
.. "IP: " .. ip .. "\t\r\n\t\t"
.. "Last packet : \t" .. sData
SendPmToOps (sBotName,message)
curUser:Ban()
curUser:Disconnect()
end
Nice, but wanted him to learn to change it himself.
no hard feelings... :-D hehe
Oups... :(
Ah well, More trains are comming
was way 2 late yesterday, stupid error i made. lol
plop
i love you all can i kiss you?
hehe
now lets test it. thanks m8s :)
WORKS GREAT THANKS FOLKS FOR ALL YOOURE HELP.
IM A HAPPY MAN NOW :)