Anti adverising script v2.0b
 

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

Anti adverising script v2.0b

Started by Light, 20 July, 2006, 15:01:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Light

This:
-- Anti adverising script v2.0b
-- Code from? A.I. Anti Advertising v1.1 
-- Made by Light (light@eriga.lv)

--------------------- 
-- Global Settings --
--------------------- 

Bot = frmHub:GetHubBotName()

safeadd = {
["sharecreator.no-ip.com"]=1, 
["samsungx100.no-ip.org"]=2, 
["studio-69.sytes.net:432"]=3,
["olaine.no-ip.com"]=4,
["gangsters-paradise.no-ip.info"]=5,
["dragon-hub.no-ip.info:4111"]=6,
["hub.technonet.lv"]=7,
["www"]=8,
["http://"]=9,
["ftp://"]=10,
["mailto://"]=11
} 

refuseadd = {
["ath.cx"]=1,
["bounceme"]=2,
["dnsalias"]=3,
["d2g.biz"]=4,
["dns2go"]=5,
["dyndns"]=6,
["dynip"]=7,
["flamenap"]=8,
["homeip"]=9,
["homeunix"]=10,
["hopto"]=11,
["idlegames"]=12,
["ipactive"]=13,
["kicks-ass"]=14,
["lysekil"]=15,
["math.mine.nu"]=16,
["myftp"]=17,
["myftpsite"]=18,
["orgdns"]=19,
["servebeer"]=20,
["serveftp"]=21,
["servegame"]=22,
["staticip"]=23,
["xs4all"]=24,
["sytes"]=25,
["uni.cc"]=26,
["zapto"]=27,
["ip.biz"]=28,
["no-ip"]=30,
["no - ip"]=31,
["no ip"]=32,
["no.ip"]=33,
["no .ip"]=34,
["no -ip"]=35,
["c o m"]=36,
["valsts.lv"]=37,
[".com"]=38,
[".info"]=39,
[".org"]=40,
["62."]=41,
["68."]=42,
["80."]=43,
["81."]=44,
["82."]=45,
["84."]=46,
["151."]=47,
["195."]=48,
["213."]=49,
["217."]=50,
["159."]=51,
["hub."]=52,
["c_o_m"]=53,
[". n e t"]=54,
["off.lv"]=55,
["off . lv"]=56,
["no.lv"]=57,
["top.tc"]=58,
[".co"]=59,
[".nr"]=60,
[".biz"]=61,
[".it"]=62,
[".cc"]=63,
[".ru"]=64,
["live.lv"]=65,
} 

------------------ 
-- Data Arrival -- 
------------------ 

allowedadd = 0 
refusedadd = 0 

safedata = ""
safecount = 0


function Main()
	local DayTime = tonumber(os.date("%H"))
	local HrTime = tonumber(os.date("%M"))
	local SecTime = tonumber(os.date("%S"))
	local Hrs = 24 - DayTime
	local Mins = 60 - HrTime
	local Secs = 60 - SecTime
	SetTimer(Hrs * 3600000 + ((Mins - 1) * 60000) + (Secs * 1000))
	StartTimer()
end


function OnTimer()
	StopTimer()
	allowedadd = 0 
	refusedadd = 0 
	StartTimer()
end


function ChatArrival(user, data) 

	local founded = 0 
	local safe = 0 
	local value = 0
	if (string.sub(data,1,1)=="<") then 
		local data = string.sub(data,1,-2) 
		local s,e,cmd = string.find(data, "%b<>%s+[%!%-%+](%S+)" ) 
		if cmd then 
			if user.bOperator then
				local tCmds = { 
					["cinfo"] = function(user,data) 
						user:SendData(Bot, allowedadd.." allowed and "..refusedadd.." refused addresses has been sended")? 
					end,
				}
				if tCmds[cmd] then 
				return tCmds[cmd](user,data), 1
				end 
			end
		end
		if (user.bOperator or user.iProfile == 4 or user.iProfile == 2) then? 
		else
			for key, value in refuseadd do 
				if (string.find(string.lower(data),key,5,1)) then 
					founded = 1 
					break 
				end 
			end 
			if founded == 1 then 
				for safekey, a in safeadd do 
					if (string.find(string.lower(data),safekey,5,1))? or user.iProfile == 2 then 
						safe = 1 
						break 
					end 
				end 
			end 
			if founded == 1 then 
				if safe == 1 then
					if safedata ~= value then
						safedata = value
						safecount = 1
						allowedadd=allowedadd+1
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data ) 
						SendToOps(Bot, safecount.." times" )
					else
						if safecount < 2 then
							safecount = safecount+1
							safedata = value
							allowedadd=allowedadd+1
							SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data ) 
							SendToOps(Bot, safecount.." times" ) 
						else
							safedata = 0
							safecount = 0
							refusedadd=refusedadd+1 
							SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
							user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
							user:TempBan(129600, "Advertising", Bot, 0)
							safecount = 1
						end
					end
				else 
					refusedadd=refusedadd+1 
					SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
					user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
					user:TempBan(43200, "Advertising", Bot, 0)
				end 
			end 
		end 
	end 
end


function ToArrival(user, data) 

	local founded = 0 
	local safe = 0 

	if (string.sub(data,1,4)=="$To:") then 
		if (user.bOperator or user.iProfile == 4 or user.iProfile == 2) then? 
		else
			for key, a in refuseadd do 
				if (string.find(string.lower(data),key,17,1)) then 
					founded = 1 
					break 
				end 
			end 
			if founded == 1 then 
				for safekey,a in safeadd do
					if (string.find(string.lower(data),safekey,17,1)) then 
						safe = 1 
						break 
					end 
				end 
			end 
			if founded == 1 then 
				if safe == 1 then
					local ret,c,to,from,text = string.find( data, "^%$To: ([^ ]+) From: ([^ ]+) %$(.*)$" )
					local value = from,text
					if safedata ~= value then
						safedata = value
						safecount = 1
						allowedadd=allowedadd+1
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data )
						SendToOps(Bot, safecount.." times" )
					else
						if safecount < 2 then
							safedata = value
							safecount = safecount+1
							allowedadd=allowedadd+1
							SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data)
							SendToOps(Bot, safecount.." times" )
						else
							safedata = 0
							safecount = 0
							refusedadd=refusedadd+1 
							SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
							user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
							user:TempBan(129600, "Advertising", Bot, 0)

						end
					end
				else 
					refusedadd=refusedadd+1 
					SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
					user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
					user:TempBan(43200, "Advertising", Bot, 0)
				end 
			end 
		end 
	end 
end

bastya_elvtars

I don't think it is necessary Are there errors showing up?
Everything could have been anything else and it would have just as much meaning.

Markitos

Quote from: bastya_elvtars on 20 July, 2006, 15:24:50
I don't think it is necessary Are there errors showing up?
Since it has a table, the loops shouldn't have pairs?

Light

[20:00] Syntax C:\Program Files\Ptokax\scripts\ad_v2.0.lua:145: attempt to call a table value

Madman

-- Anti adverising script v2.0b
-- Code fromA.I. Anti Advertising v1.1 
-- Made by Light (light@eriga.lv)
-- Lua 5.1 by Madman

--------------------- 
-- Global Settings --
--------------------- 

Bot = frmHub:GetHubBotName()

safeadd = {
["sharecreator.no-ip.com"]=1, 
["samsungx100.no-ip.org"]=2, 
["studio-69.sytes.net:432"]=3,
["olaine.no-ip.com"]=4,
["gangsters-paradise.no-ip.info"]=5,
["dragon-hub.no-ip.info:4111"]=6,
["hub.technonet.lv"]=7,
["www"]=8,
["http://"]=9,
["ftp://"]=10,
["mailto://"]=11
} 

refuseadd = {
["ath.cx"]=1,
["bounceme"]=2,
["dnsalias"]=3,
["d2g.biz"]=4,
["dns2go"]=5,
["dyndns"]=6,
["dynip"]=7,
["flamenap"]=8,
["homeip"]=9,
["homeunix"]=10,
["hopto"]=11,
["idlegames"]=12,
["ipactive"]=13,
["kicks-ass"]=14,
["lysekil"]=15,
["math.mine.nu"]=16,
["myftp"]=17,
["myftpsite"]=18,
["orgdns"]=19,
["servebeer"]=20,
["serveftp"]=21,
["servegame"]=22,
["staticip"]=23,
["xs4all"]=24,
["sytes"]=25,
["uni.cc"]=26,
["zapto"]=27,
["ip.biz"]=28,
["no-ip"]=30,
["no - ip"]=31,
["no ip"]=32,
["no.ip"]=33,
["no .ip"]=34,
["no -ip"]=35,
["c o m"]=36,
["valsts.lv"]=37,
[".com"]=38,
[".info"]=39,
[".org"]=40,
["62."]=41,
["68."]=42,
["80."]=43,
["81."]=44,
["82."]=45,
["84."]=46,
["151."]=47,
["195."]=48,
["213."]=49,
["217."]=50,
["159."]=51,
["hub."]=52,
["c_o_m"]=53,
[". n e t"]=54,
["off.lv"]=55,
["off . lv"]=56,
["no.lv"]=57,
["top.tc"]=58,
[".co"]=59,
[".nr"]=60,
[".biz"]=61,
[".it"]=62,
[".cc"]=63,
[".ru"]=64,
["live.lv"]=65,
} 

------------------ 
-- Data Arrival -- 
------------------ 

allowedadd = 0 
refusedadd = 0 

safedata = ""
safecount = 0


function Main()
	local DayTime = tonumber(os.date("%H"))
	local HrTime = tonumber(os.date("%M"))
	local SecTime = tonumber(os.date("%S"))
	local Hrs = 24 - DayTime
	local Mins = 60 - HrTime
	local Secs = 60 - SecTime
	SetTimer(Hrs * 3600000 + ((Mins - 1) * 60000) + (Secs * 1000))
	StartTimer()
end


function OnTimer()
	StopTimer()
	allowedadd = 0 
	refusedadd = 0 
	StartTimer()
end


function ChatArrival(user, data) 

	local founded = 0 
	local safe = 0 
	local value = 0
	local data = string.sub(data,1,-2) 
	local s,e,cmd = string.find(data, "%b<>%s+[%!%-%+](%S+)" ) 
	if cmd then 
		if user.bOperator then
			local tCmds = { 
				["cinfo"] = function(user,data) 
					user:SendData(Bot, allowedadd.." allowed and "..refusedadd.." refused addresses has been sended")
				end,
			}
			if tCmds[cmd] then 
			return tCmds[cmd](user,data), 1
			end 
		end
	end
	if (user.bOperator or user.iProfile == 4 or user.iProfile == 2) then
	else
		for key, value in pairs(refuseadd) do 
			if (string.find(string.lower(data),key,5,1)) then 
				founded = 1 
				break 
			end 
		end 
		if founded == 1 then 
			for safekey, a in pairs(safeadd) do 
				if (string.find(string.lower(data),safekey,5,1)) or user.iProfile == 2 then 
					safe = 1 
					break 
				end 
			end 
		end 
		if founded == 1 then 
			if safe == 1 then
				if safedata ~= value then
					safedata = value
					safecount = 1
					allowedadd=allowedadd+1
					SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data ) 
					SendToOps(Bot, safecount.." times" )
				else
					if safecount < 2 then
						safecount = safecount+1
						safedata = value
						allowedadd=allowedadd+1
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data ) 
						SendToOps(Bot, safecount.." times" ) 
					else
						safedata = 0
						safecount = 0
						refusedadd=refusedadd+1 
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
						user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
						user:TempBan(129600, "Advertising", Bot, 0)
						safecount = 1
					end
				end
			else 
				refusedadd=refusedadd+1 
				SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
				user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
				user:TempBan(43200, "Advertising", Bot, 0)
			end 
		end 
	end 
end


function ToArrival(user, data) 

	local founded = 0 
	local safe = 0 

	if (user.bOperator or user.iProfile == 4 or user.iProfile == 2) then
	else
		for key, a in pairs(refuseadd) do 
			if (string.find(string.lower(data),key,17,1)) then 
				founded = 1 
				break 
			end 
		end 
		if founded == 1 then 
			for safekey,a in pairs(safeadd) do
				if (string.find(string.lower(data),safekey,17,1)) then 
					safe = 1 
					break 
				end 
			end 
		end 
		if founded == 1 then 
			if safe == 1 then
				local ret,c,to,from,text = string.find( data, "^%$To: ([^ ]+) From: ([^ ]+) %$(.*)$" )
				local value = from,text
				if safedata ~= value then
					safedata = value
					safecount = 1
					allowedadd=allowedadd+1
					SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data )
					SendToOps(Bot, safecount.." times" )
				else
					if safecount < 2 then
						safedata = value
						safecount = safecount+1
						allowedadd=allowedadd+1
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been sended safe adress: "..data)
						SendToOps(Bot, safecount.." times" )
					else
						safedata = 0
						safecount = 0
						refusedadd=refusedadd+1 
						SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
						user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
						user:TempBan(129600, "Advertising", Bot, 0)

					end
				end
			else 
				refusedadd=refusedadd+1 
				SendToOps(Bot, user.sName.." with IP "..user.sIP.." has been kicked because of advertising: "..data ) 
				user:SendData(Bot, "You have been kicked because of advertising, if you have any questions please goto http://scforum.iceglow.com ... "..data ) 
				user:TempBan(43200, "Advertising", Bot, 0)
			end 
		end 
	end 
end


That should do the trick
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk