PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: zung on 10 July, 2006, 22:22:38

Title: AntiAdvertising translation to 5.1.x
Post by: zung on 10 July, 2006, 22:22:38
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
Title: Re: AntiAdvertising translation to 5.1.x
Post by: UwV on 10 July, 2006, 23:33:42
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

Title: Re: AntiAdvertising translation to 5.1.x
Post by: 6Marilyn6Manson6 on 10 July, 2006, 23:48:29
Now is OK LOL
Title: Re: AntiAdvertising translation to 5.1.x
Post by: UwV on 10 July, 2006, 23:55:38
hihi

you fast clicking you ..
posting while i am editing ... hehe
Title: Re: AntiAdvertising translation to 5.1.x
Post by: 6Marilyn6Manson6 on 10 July, 2006, 23:57:16
Yeah and I'm sorry for this... I have delete my post ^_^
Title: Re: AntiAdvertising translation to 5.1.x
Post by: UwV on 10 July, 2006, 23:59:29
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
Title: Re: AntiAdvertising translation to 5.1.x
Post by: 6Marilyn6Manson6 on 11 July, 2006, 00:01:26
Quote

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

Oh thanks, im happy for this :p
Title: Re: AntiAdvertising translation to 5.1.x
Post by: UwV on 11 July, 2006, 00:07:23
happy to read you're  happy  :op
Title: Re: AntiAdvertising translation to 5.1.x
Post by: zung on 11 July, 2006, 01:21:52
Thx pretty much : )))))

It works pretty well : )
Title: Re: AntiAdvertising translation to 5.1.x
Post by: 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...
Title: Re: AntiAdvertising translation to 5.1.x
Post by: UwV on 11 July, 2006, 14:22:48
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
   
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Snooze on 14 July, 2006, 16:28:20
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
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Markitos on 14 July, 2006, 18:12:47
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...
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 10 April, 2007, 14:37:05
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.
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Cêñoßy†ê on 10 April, 2007, 16:13:37
mayby like this ;)
Code (lua) Select

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
Title: Re: AntiAdvertising translation to 5.1.x
Post by: 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.
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Cêñoßy†ê on 10 April, 2007, 17:39:36
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 "
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 10 April, 2007, 17:59:42
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.
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Naithif on 10 April, 2007, 20:57:27
Quote from: C??o?y?? on 10 April, 2007, 16:13:37
mayby like this ;)
Code (lua) Select

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)
Title: Re: AntiAdvertising translation to 5.1.x
Post by: Cêñoßy†ê on 10 April, 2007, 21:01:13
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 ;)
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 14 April, 2007, 14:10:55
hi,

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

thks,
achiever.
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 14 April, 2007, 14:52:21
still it needs the change to stop pm ads  :-\
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 14 April, 2007, 16:48:42
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.
Title: Re: AntiAdvertising translation to 5.1.x
Post by: achiever on 14 April, 2007, 17:20:46
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.