AntiAdvertising translation to 5.1.x
 

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

AntiAdvertising translation to 5.1.x

Started by zung, 10 July, 2006, 22:22:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zung

Can somebody please help me translating the scipt bellow to 5.1.x ? :  )
btw.. This script works perfect for my hub except cause advertisers dont receive
the reason they was ban and it's post only to main chat ... Other way it's light and fast

botname = "AntiAdvertising" 
trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}
	function Main() 
		frmHub:RegBot(botname) 
	end 
	function DataArrival(user, data) 
		if (not user.bOperator) then
			if (( strsub(data, 1, 1) == "<" ) or ( strsub(data, 1, 4) == "$To:" )) then 
				for key,a in trigs do 
					if( strfind( strlower(data), key) ) then 
					SendToAll( botname, user.sName.." has been ban 'cause of advertising !" ) 
					user:Ban() 
				end 
			end 
		end
	end 
end




really thx in advance

UwV

#1
make :
" strsub "  be  " string.sub "
" strfind "  be  " string.find "
" strlower "   be  " string.lower "
and :
" for key,a in trigs do "  be  " for key,a in pairs(trigs) do "

then see what it does ..

Oops..

" function DataArrival(user, data) "  be  " function ChatArrival(user, data) "
and add this line  :
" ToArrival = ChatArrival  "

aah.. what the h*** ..

botname = "AntiAdvertising"
trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}
function Main()
   frmHub:RegBot(botname)
end
function ChatArrival(user, data)
	if (not user.bOperator) then
		if (( string.sub(data, 1, 1) == "<" ) or ( string.sub(data, 1, 4) == "$To:" )) then
			for key,a in pairs(trigs) do
				if( string.find( string.lower(data), key) ) then
					SendToAll( botname, user.sName.." has been ban 'cause of advertising !" )
					user:Ban()
				end
			end
		end
	end
end
ToArrival = ChatArrival

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

6Marilyn6Manson6

#2
Now is OK LOL

UwV

hihi

you fast clicking you ..
posting while i am editing ... hehe
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

6Marilyn6Manson6

Yeah and I'm sorry for this... I have delete my post ^_^

UwV

Quote from: 6Marilyn6Manson6 on 10 July, 2006, 23:57:16
Yeah and I'm sorry for this... I have delete my post ^_^

no need to be sorry no need to delete .. all cool  imo
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

6Marilyn6Manson6

Quote

no need to be sorry no need to delete .. all cool? imo

Oh thanks, im happy for this :p

UwV

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

zung

Thx pretty much : )))))

It works pretty well : )

Markitos

if (( string.sub(data, 1, 1) == "<" ) or ( string.sub(data, 1, 4) == "$To:" )) then

This is useless...

UwV

Quote from: Markitos on 11 July, 2006, 07:27:11
if (( string.sub(data, 1, 1) == "<" ) or ( string.sub(data, 1, 4) == "$To:" )) then

This is useless...
sure is..
botname = "AntiAdvertising"

trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}

function Main()
   frmHub:RegBot(botname)
end

function ChatArrival(user, data)
   if (not user.bOperator) then
      for key,a in pairs(trigs) do
         if( string.find( string.lower(data), key) ) then
            SendToAll( botname, user.sName.." has been ban 'cause of advertising !" )
            user:Ban()
         end
      end
   end
end

ToArrival = ChatArrival
   
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

Snooze

I've found that those doing spam are getting smarter and using IPs for their advertising ..
So perhaps add:
if string.find(data, "(%d+)(%.)(%d+)(%.)(%d+)(%.)(%d+)") then
>

Just a suggestion..

Regards,
Snooze

Markitos

sBot = "AntiAdvertising"
trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}

ChatArrival = function(user,data)
    if not user.bOperator then
		for v,k in pairs(trigs) do
			if string.find(string.lower(data), v) then
				SendToAll(sBot, user.sName.." has been ban 'cause of advertising !" )
				user:SendData(sBot, "You fool!!! No advertising here")
				user:Ban()
			else
				if string.find(data, "(%d+)(%.)(%d+)(%.)(%d+)(%.)(%d+)") then
				SendToAll(sBot, user.sName.."has been ban because of advertising!")
				user:SendData(sBot, "You fool!!! No advertising here")
				user:Ban()
				end
			end
		end
	end
end

ToArrival = ChatArrival

No tested...

achiever

hi,

i was searching for an antiadvertise script and saw this fit for my requirements but this script is not blocking the advertise even if the person gets banned.
Quote
[17:50:49] <Fusion> You fool!!! No advertising here
[17:50:49] <Fusion> achie  has been ban 'cause of advertising !
[17:50:49] <achie> login to my hub
also if some 1 tries to send an ip across it sends the banned messege 2 or 3 time i.e.
Quote
[17:58:37] <Fusion> You fool!!! No advertising here
[17:58:37] <Fusion> You fool!!! No advertising here
[17:58:37] <Fusion> You fool!!! No advertising here
[17:58:37] <Fusion> You fool!!! No advertising here
[17:58:37] <Fusion> achie has been ban because of advertising!
[17:58:37] <Fusion> achie has been ban because of advertising!
[17:58:37] <Fusion> achie has been ban because of advertising!
[17:58:37] <Fusion> achie has been ban because of advertising!
[17:58:37] <achie> 172.19.40.41

so can this be done with?
or is there already a better version of anti advertise scripts that blocks the main and pm ads, which i have misssed then plzz inform me so.

thks,
achiever.
thks,
achiever.

Cêñoßy†ê

#14
mayby like this ;)
Code: lua
sBot = "AntiAdvertising"
trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}
 
ChatArrival = function(user,data)
	if not user.bOperator then
		for v,k in pairs(trigs) do
			if string.find(string.lower(data), v) or data:find("(%d+)(%.)(%d+)(%.)(%d+)(%.)(%d+)")  then
				SendToAll(sBot, user.sName.." has been ban 'cause of advertising !" )
				user:SendData(sBot, "You fool!!! No advertising here")
				user:Ban()
				return 1
			end
		end
	end
end
 
ToArrival = ChatArrival
Powered By Leviathan™ 2nd Generation v. 1.9

achiever

hi,

giving error
[20:57] Syntax D:\0.3.5.1.lua5.1.1\scripts\antiadvertise.lua:7: unexpected symbol near '%'

thks,
achiever.
thks,
achiever.

Cêñoßy†ê

Quote from: achiever on 10 April, 2007, 17:35:18
hi,

giving error
[20:57] Syntax D:\0.3.5.1.lua5.1.1\scripts\antiadvertise.lua:7: unexpected symbol near '%'

thks,
achiever.

post updated sry missed one "
Powered By Leviathan™ 2nd Generation v. 1.9

achiever

woking fine thks.
can u also make a change to the script, such that when a user gets banned his advertise should get added to a text file which could be seen on cammand.

thks for help,
achiever.
thks,
achiever.

Naithif

Quote from: C??o?y?? on 10 April, 2007, 16:13:37
mayby like this ;)
Code: lua
sBot = "AntiAdvertising"
trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4}
 
ChatArrival = function(user,data)
	if not user.bOperator then
		for v,k in pairs(trigs) do
			if string.find(string.lower(data), v) or data:find("%d+)(%.)(%d+)(%.)(%d+)(%.)(%d+)")  then
				SendToAll(sBot, user.sName.." has been ban 'cause of advertising !" )
				user:SendData(sBot, "You fool!!! No advertising here")
				user:Ban()
				return 1
			end
		end
	end
end
 
ToArrival = ChatArrival



%d+) ?

(first one, line 7, IP finder)

Cêñoßy†ê

Quote from: Naithif on 10 April, 2007, 20:57:27

%d+) ?

(first one, line 7, IP finder)

hehe... this happens when you do many thing at same time :P
post updated again ;)
Powered By Leviathan™ 2nd Generation v. 1.9

achiever

hi,

can this script also made to work for pm ads??

thks,
achiever.
thks,
achiever.

achiever

still it needs the change to stop pm ads  :-\
thks,
achiever.

achiever

working fine.
thks,
achiever.
Quote[ 156 ]   On April 14 2007 19:33:25  [ fido_x-36 ] wrote: any 1 wanna join Volcano hub Pm Me.....................

lol now ppl r using message board to post their advertise..
can u help me.
should this be reported on the message board topic?

thks,
achiever.
thks,
achiever.

achiever

#23
well yes, did catch the ad when placed the script above message board script.

Quote from: Mutor on 14 April, 2007, 17:13:54
Yes that's probably best.
do u still want me report this in messageboard topic?

thks,
achiever.
thks,
achiever.

SMF spam blocked by CleanTalk