--> Devil-Bot ( Advertising / Spamming Bot)
 

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

--> Devil-Bot ( Advertising / Spamming Bot)

Started by NightLitch, 09 June, 2004, 00:54:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

Bot is updated...

-----------------------------------------------------------
-- Devil - Bot v. 0.6
--
-- Anti Advertising and Spamming bot.
--
-- MyInfo source from Chilla
-- Timer source from Opium_Volage
-- Spam source from DirtyFingers
--
-- Set PtokaX Chat Limit to 0 in chat msg and private to 0.
--
-- Changes:
-- 2004-06-08 - v0.1 - released
-- 2004-06-09 - v0.2 - forgot to add extension check in advercheck
-- 2004-06-09 - v0.3 - changed Disconnect to TimeBan, added time values
-- 2004-06-09 - v0.4 - added if typed lines in msg is the same then timebanned
-- 2004-06-09 - v0.5 - added min/max lenght on nickname's, added so ops is not affected by the script
-- 2004-06-09 - v0.6 - fixed the advertising part so ex. no-ip works and other addy's with -
--
-- By NightLitch
-----------------------------------------------------------
Bot = {
Version = "v. 0.6",
Author = "NightLitch",
-----------------------------------------------------------
-----------------------------------------------------------
--// Editable data starts here
-----------------------------------------------------------
-----------------------------------------------------------
-- Set Botname
Name = "-DEViL-",

-- TimeBan time
--------------------
Time = {
-- Set minutes
Min = 20,
-- Set hours
Hour = 0,
-- Set days
Day = 0,
},

-- Nickname Settings
-------------------------
Nick = {
-- Min lenght of characters
MinLenght = 6,
-- Max lenght of characters
MaxLenght = 30,
},

-- Spamming Settings
--------------------------
Spam = {
-- Set max messages sent in Mainchat in a row in 10sec before kicked
MaxMain = 10,
-- Set kick message
MainString = "You have been Timebanned for [TIME]  for Spamming the Mainchat...",
-- Set max messages sent in PM in a row in 10sec before kicked
MaxPm = 10,
-- Set kick message
PmString = "You have been Timebanned for [TIME] for Spamming  to ",
-- Set max number of characters in Mainchat to be typed before kicked
MaxMainLine = 350,
-- Set max number of characters in PM to be typed before kicked
MaxPmLine = 500,
-- Set max number of MyInfoString before kick
MaxMyInfos = 5, 
-- Set kick message
MyInfoString = "You have been Timebanned for [TIME] for Spamming with $MyINFO...",

StoreMain = {},
StorePm = {},
MyInfos = {},
},

-- Advertising Settings
---------------------------
Adver = {
-- Set Bad Trigs such as: no-ip, myftp kickass etc.
BadTrigs = {"myftp", "no-ip","myip","sytes"},
-- Set Ext Trigs, such as: com, net, biz etc.
ExtTrigs = {"org", "com", "net","hu"},
-- Set Ok Trigs, such as: ok hubs, webbsites etc.
OkTrigs = {"swenorth","www","ploppy","dippers","echoes-hub.sytes.net",},
-- Set kick message
AdvString = "You have been Timebanned for [TIME] for Advertising...",
-- Set Character changing, try mixing with these if you're unhappy with the result.
Change = {["%(dot%)"]=".",["dot"]=".",["%(%-%)"]="-",["#"]="",["*"]="",["/"]="",["%s+"]=""},
},
-----------------------------------------------------------
-----------------------------------------------------------
--// Don't edit Bellow this point if you don't now what you're doing
-----------------------------------------------------------
-----------------------------------------------------------
Ctrl = {
["$MyINFO"]=1,
["$To:"]=1,
["<"]=1,
},
}

TimeLine = Bot.Time.Day.." day(s), "..Bot.Time.Hour.." hour(s) and "..Bot.Time.Min.." min(s)"
BanTime = Bot.Time.Day * 1440 + Bot.Time.Hour * 60 + Bot.Time.Min

Sec  = 1000
Min  = 60*Sec
Hour = 60*Min
Day  = 24*Hour
TmrFreq = 1000
tabTimers = {n=0}

function Main()
	SendToAll(Bot.Name.." Bot "..Bot.Version.." by "..Bot.Author)
	SetTimer(TmrFreq)
	StartTimer()
	RegTimer(Null_MyInfo, 1*Sec)
	RegTimer(Null_Spam, 10*Sec)
end

function OnTimer()
	for i=1, getn(tabTimers) do
		tabTimers[i].count = tabTimers[i].count + 1
		if tabTimers[i].count > tabTimers[i].trig then
			tabTimers[i].count=1
			tabTimers[i]:func()
		end
	end
end

function RegTimer(f, Interval)
	local tmpTrig = Interval / TmrFreq
	assert(Interval >= TmrFreq , "RegTimer(): Please Adjust TmrFreq")
	local Timer = {n=0}
	Timer.func=f
	Timer.trig=tmpTrig
	Timer.count=1
	tinsert(tabTimers, Timer)
end

function Null_MyInfo()
	foreach(Bot.Spam.MyInfos, function(i,v)
		if v == 0 then
			Bot.Spam.MyInfos[i] = nil
		else
			Bot.Spam.MyInfos[i] = Bot.Spam.MyInfos[i] - 1
		end
	end)
end

function Null_Spam()
	Bot.Spam.StorePm = {} 
	Bot.Spam.StoreMain = {} 
end

function NewUserConnected(cUser)
	if strlen(cUser.sName) <= Bot.Nick.MinLenght then
		cUser:SendData(Bot.Name, "You're nickname is to short, min amount of characters is: "..Bot.Nick.MinLenght.." char(s)")
		cUser:Disconnect()
	elseif strlen(cUser.sName) >= Bot.Nick.MaxLenght then
		cUser:SendData(Bot.Name, "You're nickname is to long, max amount of characters is: "..Bot.Nick.MaxLenght.." char(s)")
		cUser:Disconnect()
	end
end

function UserDisconnected(cUser)
	if Bot.Spam.MyInfos[cUser.sName] then
		Bot.Spam.MyInfos[cUser.sName] = nil
	end
end

function DataArrival(cUser,cData)
	if Bot.Ctrl[strsub(cData, 1, 7)] and not cUser.bOperator then
		Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] or 1 
		Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] + 1 
		if Bot.Spam.MyInfos[cUser.sName] >= Bot.Spam.MaxMyInfos then
			Bot.Spam.MyInfos[cUser.sName] = nil
			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MyInfoString))
			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming with $MyInfo "))
			cUser:TimeBan(tonumber(BanTime))
		end
	elseif Bot.Ctrl[strsub(cData, 1,1)] and not cUser.bOperator then
		local s,e,str = strfind(cData, "^%b<>%s+(.*)%|")
		if str then
			local s,e,d1,d2,d3 = strfind(str, "(.*)\r\n(.*)\r\n(.*)")
			if d1==d2 and d3 then
				cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))
				SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
				cUser:TimeBan(tonumber(BanTime))
			end
		end
		if str and strlen(str) >= Bot.Spam.MaxMainLine then
			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))
			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
			cUser:TimeBan(tonumber(BanTime))
		end
		Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] or 1
		Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] +1
		if Bot.Spam.StoreMain[cUser.sName] >= Bot.Spam.MaxMain then
			Bot.Spam.StoreMain[cUser.sName] = nil
			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))
			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
			cUser:TimeBan(tonumber(BanTime))
		end
		if AdvCheck(cUser,str)==1 then
			return 1
		end
	elseif Bot.Ctrl[strsub(cData, 1,4)] and not cUser.bOperator then
		local s,e,to,from,str = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$^%b<>%s+(.*)%|$")
		if str then
			local s,e,d1,d2,d3 = strfind(str, "(.*)\r\n(.*)\r\n(.*)")
			if d1==d2 and d3 then
				cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))
				SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
				cUser:TimeBan(tonumber(BanTime))
			end
		end
		if str and strlen(str) >= Bot.Spam.MaxPmLine then
			cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))
			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
			cUser:TimeBan(tonumber(BanTime))
		end
		Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] or 1
		Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] +1
		if Bot.Spam.StorePm[cUser.sName] >= Bot.Spam.MaxPm then
			Bot.Spam.StorePm[cUser.sName] = nil
			cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))
			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))
			cUser:TimeBan(tonumber(BanTime))
		end
		if AdvCheck(cUser,str)==1 then
			return 1
		end
	end
end

function AdvCheck(cUser,str)
	local org = str
	for i,v in Bot.Adver.Change do
	 	str = gsub(str, i, v)
	end
	if tSearch(str,Bot.Adver.BadTrigs)==1 and tSearch(str,Bot.Adver.ExtTrigs)==1 then
		if tSearch(str,Bot.Adver.OkTrigs)==1 then return 0 	end
		cUser:SendData(Bot.Name, cMsg(Bot.Adver.AdvString))
		SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Advertising: "..org))
		cUser:TimeBan(tonumber(BanTime))
		return 1
	end
end

function cMsg(msg)
	msg = gsub(msg, "%[TIME%]", TimeLine)
	return msg
end

function tSearch(string,table)
	for i,v in table do
		_,_,a,b = strfind(v, "(%S+)%-(%S+)")
		if a and b then
			if strfind(string, a.."%-"..b) then
				return 1
			end
		end
		if strfind(string, v) then
			return 1
		end
	end
	return 0
end

/NightLitch
//NL

Cp6uja

Go0oD Script NightLitch.!.

NightLitch

Bot updated again.
//NL

bastya_elvtars

Rewrote it, so it only disconnects for pasting big crap (kick would b 2 hard lol) - any1 who rewrites it, so it only sends user a PM and notifies OPs? (else it would be too automated)

-- Devil - Bot v. 0.6

--

-- Anti Advertising and Spamming bot.

--

-- MyInfo source from Chilla

-- Timer source from Opium_Volage

-- Spam source from DirtyFingers

--

-- Set PtokaX Chat Limit to 0 in chat msg and private to 0.

--

-- Changes:

-- 2004-06-08 - v0.1 - released

-- 2004-06-09 - v0.2 - forgot to add extension check in advercheck

-- 2004-06-09 - v0.3 - changed Disconnect to TimeBan, added time values

-- 2004-06-09 - v0.4 - added if typed lines in msg is the same then timebanned

-- 2004-06-09 - v0.5 - added min/max lenght on nickname's, added so ops is not affected by the script

-- 2004-06-09 - v0.6 - fixed the advertising part so ex. no-ip works and other addy's with -

--

-- By NightLitch

-----------------------------------------------------------

Bot = {

Version = "v. 0.6",

Author = "NightLitch",

-----------------------------------------------------------

-----------------------------------------------------------

--// Editable data starts here

-----------------------------------------------------------

-----------------------------------------------------------

-- Set Botname

Name = "-Echo-",



-- TimeBan time

--------------------

Time = {

-- Set minutes

Min = 5,

-- Set hours

Hour = 0,

-- Set days

Day = 0,

},



-- Nickname Settings

-------------------------

Nick = {

-- Min lenght of characters

MinLenght = 4,

-- Max lenght of characters

MaxLenght = 30,

},



-- Spamming Settings

--------------------------

Spam = {

-- Set max messages sent in Mainchat in a row in 10sec before kicked

MaxMain = 10,

-- Set kick message

MainString = "You have been Timebanned for [TIME]  for Spamming the Mainchat...",

-- Set max messages sent in PM in a row in 10sec before kicked

MaxPm = 10,

-- Set kick message

PmString = "You have been Timebanned for [TIME] for Spamming  to ",

-- Set max number of characters in Mainchat to be typed before kicked

MaxMainLine = 350,

-- Set max number of characters in PM to be typed before kicked

MaxPmLine = 500,

-- Set max number of MyInfoString before kick

MaxMyInfos = 5, 

-- Set kick message

MyInfoString = "You have been Timebanned for [TIME] for Spamming with $MyINFO...",



StoreMain = {},

StorePm = {},

MyInfos = {},

},



-- Advertising Settings

---------------------------

Adver = {

-- Set Bad Trigs such as: no-ip, myftp kickass etc.

BadTrigs = {"myftp", "no-ip","myip","sytes"},

-- Set Ext Trigs, such as: com, net, biz etc.

ExtTrigs = {"org", "com", "net","hu"},

-- Set Ok Trigs, such as: ok hubs, webbsites etc.

OkTrigs = {"swenorth","www","ploppy","dippers","echoes-hub.sytes.net",},

-- Set kick message

AdvString = "You have been Timebanned for [TIME] for Advertising...",

-- Set Character changing, try mixing with these if you're unhappy with the result.

Change = {["%(dot%)"]=".",["dot"]=".",["%(%-%)"]="-",["#"]="",["*"]="",["/"]="",["%s+"]=""},

},

-----------------------------------------------------------

-----------------------------------------------------------

--// Don't edit Bellow this point if you don't now what you're doing

-----------------------------------------------------------

-----------------------------------------------------------

Ctrl = {

["$MyINFO"]=1,

["$To:"]=1,

["<"]=1,

},

}



TimeLine = Bot.Time.Day.." day(s), "..Bot.Time.Hour.." hour(s) and "..Bot.Time.Min.." min(s)"

BanTime = Bot.Time.Day * 1440 + Bot.Time.Hour * 60 + Bot.Time.Min



Sec  = 1000

Min  = 60*Sec

Hour = 60*Min

Day  = 24*Hour

TmrFreq = 1000

tabTimers = {n=0}



function Main()

	SendToAll(Bot.Name.." Bot "..Bot.Version.." by "..Bot.Author)

	SetTimer(TmrFreq)

	StartTimer()

	RegTimer(Null_MyInfo, 1*Sec)

	RegTimer(Null_Spam, 10*Sec)

end



function OnTimer()

	for i=1, getn(tabTimers) do

		tabTimers[i].count = tabTimers[i].count + 1

		if tabTimers[i].count > tabTimers[i].trig then

			tabTimers[i].count=1

			tabTimers[i]:func()

		end

	end

end



function RegTimer(f, Interval)

	local tmpTrig = Interval / TmrFreq

	assert(Interval >= TmrFreq , "RegTimer(): Please Adjust TmrFreq")

	local Timer = {n=0}

	Timer.func=f

	Timer.trig=tmpTrig

	Timer.count=1

	tinsert(tabTimers, Timer)

end



function Null_MyInfo()

	foreach(Bot.Spam.MyInfos, function(i,v)

		if v == 0 then

			Bot.Spam.MyInfos[i] = nil

		else

			Bot.Spam.MyInfos[i] = Bot.Spam.MyInfos[i] - 1

		end

	end)

end



function Null_Spam()

	Bot.Spam.StorePm = {} 

	Bot.Spam.StoreMain = {} 

end



function NewUserConnected(cUser)

	if strlen(cUser.sName) <= Bot.Nick.MinLenght then

		cUser:SendData(Bot.Name, "R?vid nick! Legal?bb "..Bot.Nick.MinLenght.." karakter hossz?s?g? nicket v?lassz!")

		cUser:Disconnect()

	elseif strlen(cUser.sName) >= Bot.Nick.MaxLenght then

		cUser:SendData(Bot.Name, "Hossz? nick! A nick hossza max. "..Bot.Nick.MaxLenght.." karakter lehet!")

		cUser:Disconnect()

	end

end



function UserDisconnected(cUser)

	if Bot.Spam.MyInfos[cUser.sName] then

		Bot.Spam.MyInfos[cUser.sName] = nil

	end

end



function DataArrival(cUser,cData)

	if Bot.Ctrl[strsub(cData, 1, 7)] and not cUser.bOperator then

		Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] or 1 

		Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] + 1 

		if Bot.Spam.MyInfos[cUser.sName] >= Bot.Spam.MaxMyInfos then

			Bot.Spam.MyInfos[cUser.sName] = nil

			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MyInfoString))

			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming with $MyInfo "))

			cUser:TimeBan(tonumber(BanTime))

		end

	elseif Bot.Ctrl[strsub(cData, 1,1)] and not cUser.bOperator then

		local s,e,str = strfind(cData, "^%b<>%s+(.*)%|")

		if str then

			local s,e,d1,d2,d3 = strfind(str, "(.*)\r\n(.*)\r\n(.*)")

			if d1==d2 and d3 then

				cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))

				SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

				cUser:TimeBan(tonumber(BanTime))

			end

		end

		if str and strlen(str) >= Bot.Spam.MaxMainLine then

			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))

			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

			cUser:Disconnect()

		end

		Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] or 1

		Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] +1

		if Bot.Spam.StoreMain[cUser.sName] >= Bot.Spam.MaxMain then

			Bot.Spam.StoreMain[cUser.sName] = nil

			cUser:SendData(Bot.Name, cMsg(Bot.Spam.MainString))

			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

			cUser:TimeBan(tonumber(BanTime))

		end

		if AdvCheck(cUser,str)==1 then

			return 1

		end

	elseif Bot.Ctrl[strsub(cData, 1,4)] and not cUser.bOperator then

		local s,e,to,from,str = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$^%b<>%s+(.*)%|$")

		if str then

			local s,e,d1,d2,d3 = strfind(str, "(.*)\r\n(.*)\r\n(.*)")

			if d1==d2 and d3 then

				cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))

				SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

				cUser:TimeBan(tonumber(BanTime))

			end

		end

		if str and strlen(str) >= Bot.Spam.MaxPmLine then

			cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))

			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

			cUser:Disconnect

		end

		Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] or 1

		Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] +1

		if Bot.Spam.StorePm[cUser.sName] >= Bot.Spam.MaxPm then

			Bot.Spam.StorePm[cUser.sName] = nil

			cUser:SendData(Bot.Name, cMsg(Bot.Spam.PmString))

			SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Spamming: "..str))

			cUser:TimeBan(tonumber(BanTime))

		end

		if AdvCheck(cUser,str)==1 then

			return 1

		end

	end

end



function AdvCheck(cUser,str)

	local org = str

	for i,v in Bot.Adver.Change do

	 	str = gsub(str, i, v)

	end

	if tSearch(str,Bot.Adver.BadTrigs)==1 and tSearch(str,Bot.Adver.ExtTrigs)==1 then

		if tSearch(str,Bot.Adver.OkTrigs)==1 then return 0 	end

		cUser:SendData(Bot.Name, cMsg(Bot.Adver.AdvString))

		SendToOps(Bot.Name, cMsg("ALERT: "..cUser.sName.." is Timebanned for [TIME] for Advertising: "..org))

		cUser:TimeBan(tonumber(BanTime))

		return 1

	end

end



function cMsg(msg)

	msg = gsub(msg, "%[TIME%]", TimeLine)

	return msg

end



function tSearch(string,table)

	for i,v in table do

		_,_,a,b = strfind(v, "(%S+)%-(%S+)")

		if a and b then

			if strfind(string, a.."%-"..b) then

				return 1

			end

		end

		if strfind(string, v) then

			return 1

		end

	end

	return 0

end
Everything could have been anything else and it would have just as much meaning.

Cp6uja

10-- New update by Cp6uja  :]

6
-- Devil - Bot v. 0.4 Update version !
--
-- Anti Advertising and Spamming bot.
--
-- MyInfo source taken from Chilla's Flooder Protection script
-- Timer source taken from Opium_Volage's MultiTimers script
-- Spam source taken from DirtyFingers SpamBan script
--
--==>> !!! Set PtokaX Chat Limit to 0 in chat msg and private to 0 !!! <<==--
--
-- By NightLitch & Cp6uja{Small FIX}
-----------------------------------------------------------
Bot = {
Version = "v. 0.4,
Author = "NightLitch",
-----------------------------------------------------------
-----------------------------------------------------------
--// Editable data starts here
-----------------------------------------------------------
-----------------------------------------------------------
-- Set Botname
Name = "??????????V???l???????",

-- Spamming Settings
--------------------------
Spam = {
-- Set max messages sent in Mainchat in a row in 10 sec. before kicked
MaxMain = 10,
-- Set kick message
MainString = "You have been Kicked for Spamming the Mainchat...",
-- Set max messages sent in PM in a row in 10 sec. before kicked
MaxPm = 10,
-- Set kick message
PmString = "You have been Kicked for Spamming  to ",
-- Set max number of characters in Mainchat to be typed before kicked
MaxMainLine = 350,
-- Set max number of characters in PM to be typed before kicked
MaxPmLine = 500,
-- Set max number of MyInfoString before kick
MaxMyInfos = 5,
-- Set kick message
MyInfoString = "You have been Kicked for Spamming with $MyINFO... No Spam here !!!",

StoreMain = {},
StorePm = {},
MyInfos = {},
},

-- Advertising Settings
---------------------------
Adver = {
-- Set Bad Trigs such as: no-ip, myftp,kickass etc.
BadTrigs = {
        "dns2go","myftpsite","servebeer","mine.nu","ip.com","dynip","depecheconnect.com","zapto.org",
   "staticip","serveftp","ipactive","ip.org","no-ip","servegame","gotdns.org","ip.net","ip.co.uk",
   "ath.cx","dyndns","68.67.18.75","clanpimp","idlegames","sytes","unusualperson.com",
   "24.184.64.48","uni.cc","151.198.149.60","homeunix","24.209.232.97","ciscofreak.com",
   "deftonzs.com","24.187.50.121","flamenap","xs4all","serveftp","point2this.com","ip.info",
   "myftp","d2g","151.198.149.60","24.184.64.48","orgdns","myip.org","stufftoread.com",
   "ip.biz","dynu.com","mine.org","kick-ass.net","darkdata.net","ipme.net","udgnet.com","homeip.net",
   "e-net.lv","newgnr.com","bst.net","bsd.net","ods.org","x-host","bounceme.net","myvnc.com",
   "kyed.com","lir.dk","finx.org","sheckie.net","vizvaz.net","snygging.net","kicks-ass.com","nerdcamp.net",
   "cicileu.","3utilities.com","myftp.biz","redirectme.net","servebeer.com","servecounterstrike.com",
   "servehalflife.com","servehttp.com","serveirc.com","servemp3.com","servepics.com","servequake.com",
   "damnserver.com","ditchyourip.com","dnsiskinky.com","geekgalaxy.com","net-freaks.com","ip.ca",
   "securityexploits.com","securitytactics.com","servehumour.com","servep2p.com","servesarcasm.com",
   "workisboring.com","hopto","64.246.26.135","213.145.29.222","dnsalias"  },

-- Set Ok Trigs, such as: ok hubs, webbsites, e-mail address etc.
OkTrigs = {"hotmail.com","www","ploppy","msn.com","yahoo.com",},
-- Set kick message
AdvString = "You have been Kicked for Advertising.Dont advertise here.Byee !!!",
-- Set ok Hubs:
OkHubs = {"myhub.no-ip.com","multihub2.no-ip.com", "greatfriend.no-ip.com"} -- Insert here your addresses or friend hub addresses
},
-----------------------------------------------------------
-----------------------------------------------------------
--// Don't edit Bellow this point if you don't now what you're doing
-----------------------------------------------------------
-----------------------------------------------------------
Ctrl = {
["$MyINFO"]=1,
["$To:"]=1,
["<"]=1,
},
}
Sec  = 1000
Min  = 60*Sec
Hour = 60*Min
Day  = 24*Hour
TmrFreq = 1000
tabTimers = {n=0}

function Main()
   SetTimer(TmrFreq)
   StartTimer()
   RegTimer(Null_MyInfo, 1*Sec)
   RegTimer(Null_Spam, 10*Sec)
end

function OnTimer()
   for i=1, getn(tabTimers) do
      tabTimers.count = tabTimers.count + 1
      if tabTimers.count > tabTimers.trig then
         tabTimers.count=1
         tabTimers:func()
      end
   end
end

function RegTimer(f, Interval)
   local tmpTrig = Interval / TmrFreq
   assert(Interval >= TmrFreq , "RegTimer(): Please Adjust TmrFreq")
   local Timer = {n=0}
   Timer.func=f
   Timer.trig=tmpTrig
   Timer.count=1
   tinsert(tabTimers, Timer)
end

function Null_MyInfo()
   foreach(Bot.Spam.MyInfos, function(i,v)
      if v == 0 then
         Bot.Spam.MyInfos = nil
      else
         Bot.Spam.MyInfos = Bot.Spam.MyInfos - 1
      end
   end)
end

function Null_Spam()
   Bot.Spam.StorePm = {}
   Bot.Spam.StoreMain = {}
end

function UserDisconnected(cUser)
   if Bot.Spam.MyInfos[cUser.sName] then
      Bot.Spam.MyInfos[cUser.sName] = nil
   end
end

function DataArrival(cUser,cData)
   if Bot.Ctrl[strsub(cData, 1, 7)]then
      Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] or 1
      Bot.Spam.MyInfos[cUser.sName] = Bot.Spam.MyInfos[cUser.sName] + 1
      if Bot.Spam.MyInfos[cUser.sName] >= Bot.Spam.MaxMyInfos then
         Bot.Spam.MyInfos[cUser.sName] = nil
         cUser:SendData(Bot.Name, Bot.Spam.MyInfoString)
         SendToOps(Bot.Name, "ALERT: "..cUser.sName.." is Kicked for Spamming with $MyInfo ")
         cUser:Disconnect()
      end
   elseif Bot.Ctrl[strsub(cData, 1,1)] then
      local s,e,str = strfind(cData, "^%b<>%s+(.*)%|")
      if str and strlen(str) >= Bot.Spam.MaxMainLine then
         cUser:SendData(Bot.Name, Bot.Spam.MainString)
         cUser:Disconnect()
      end
      Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] or 1
      Bot.Spam.StoreMain[cUser.sName] = Bot.Spam.StoreMain[cUser.sName] +1
      if Bot.Spam.StoreMain[cUser.sName] >= Bot.Spam.MaxMain then
         Bot.Spam.StoreMain[cUser.sName] = nil
         cUser:SendData(Bot.Name, Bot.Spam.MainString)
         SendToOps(Bot.Name, "ALERT: "..cUser.sName.." is Kicked for Spamming: "..str)
         cUser:Disconnect()
      end
      if AdvCheck(cUser,str)==1 then
         return 1
      end
   elseif Bot.Ctrl[strsub(cData, 1,4)] then
      local s,e,to,from,str = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$^%b<>%s+(.*)%|$")
      if str and strlen(str) >= Bot.Spam.MaxPmLine then
         cUser:SendData(Bot.Name, Bot.Spam.PmString)
         cUser:Disconnect()
      end
      Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] or 1
      Bot.Spam.StorePm[cUser.sName] = Bot.Spam.StorePm[cUser.sName] +1
      if Bot.Spam.StorePm[cUser.sName] >= Bot.Spam.MaxPm then
         Bot.Spam.StorePm[cUser.sName] = nil
         cUser:SendData(Bot.Name, Bot.Spam.PmString)
         SendToOps(Bot.Name, "ALERT: "..cUser.sName.." is Kicked for Spamming: "..str)
         cUser:Disconnect()
      end
      if AdvCheck(cUser,str)==1 then
         return 1
      end
   end
end

function AdvCheck(cUser,str)
   local org = str
   for i,v in Bot.Adver.Change do
       str = gsub(str, i, v)
   end
   if tSearch(str,Bot.Adver.BadTrigs)==1 then
      if tSearch(str,Bot.Adver.OkTrigs)==1 then
         return 0
      end
      cUser:SendData(Bot.Name, Bot.Adver.AdvString)
      SendToOps(Bot.Name, "ALERT: "..cUser.sName.." is Kicked for Advertising: "..org)
      cUser:Disconnect()
      return 1
   end
end

function tSearch(string,table)
   for i,v in table do
      if strfind(string, v) then
         return 1
      end
   end
   return 0
end

10 /Cp6uja

Cp6uja

-- bastya_elvtars good idea !!!

  :D

NightLitch

Your version will not work very well Cp6uja.

Why do you think I split the adver into adv & ext.

now you have that . in there you only need to write the adv with out the .

ex: donald myftp org

and plzz.... learn to use the ['CODE'] code in here ['/CODE']

/NL
//NL

Cp6uja

Ok thx NightLitch !!!

SMF spam blocked by CleanTalk