PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: BBD on 12 March, 2005, 20:51:10

Title: Converting Lucifer Anti Advert Script
Post by: BBD on 12 March, 2005, 20:51:10
Could anyone convert this script please?  :D



--Lucifer 6.6.6-- updated version



--This is a Powerful AntiAdvertising Script

--Powered by Demone.Astaroth and OpiumVolage



--History: Base='multiline antiadvertise' by OpiumVolage (your tables simplify the work I did until that moment). Here its features:

--             1)Script can block this types of advertisement: A) example.no-ip.com

--       B) e x a m p l e . n o - i p . c o m

--       C)example.

--          no-

--          ip.

--          com

--       D)e

--          x

--          a

--          m

--          p

--          l

--          e

--          .

--          n

--          o

--          -      

--          i

--          p

--          .

--          c

--          o

--          m

--             2)You can insert valid addresses (like yours) in trigs, so bot won't kick you

--             3)Users conversating with ops don't get kicked

--             4)Why the Timer? It cleans memory.



--             Demone.Astaroth addons: 1)added an huge list of addresses

--        2)When advertising: user advised on Pm before disconnection; Bot sends to all in main chat the kicking message (without IP);

--                                         advertise-infos send to Op-chat directly without troubling any Op with Pms! Infos contain user's IP, user To(if PM) and last message

--         Just replace INSERT.HERE.YOUR.OP-CHAT.NAME fields with yours.

--                          3)inserted Disconnect and TimeBan (15 minutes) instead of gagging user

--        4)Prevented very splitted addresses (with more tabAdvert lines)

--                                      5)added Control-addresses: user isn't kicked for these addresses but Ops are informed in any case.

--                                                                                   this is useful for friend-hubs addresses, if u also want to control them

--                                      6)added ControlUser status: if u're scary about your vips advertising their hubs and stealing you user,

--                                                                                    you can't insert the tag [VIP] or anything else in the specific space: they will not

--                                                                                      get kicked for any addresses, but in case of typing a Control-address, Ops will be

--                                                                                          informed.

--                                      7)Fixed some bug (Thanks Opium)

--      8)Added a new string-pieces find way to catch advertises



BotName = "TheBoss"


advtrigs = {"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"}



validtrigs = {"nu-grime.no-ip.com","ultimate-grime.no-ip.com", "greatfriend.no-ip.com"} --insert here your addresses (like yours or multihub ones or great friend's hub ;) )



controltrigs={["boi"]=1,["speed"]=2,["eski"]=3, ["grime"]=4, ["bbv"]=5, ["bigboi"]=6} --insert here addresses you want to be informed (no kick)



tabAdvert = {}



function Main()

frmHub:RegBot(BotName)

SetTimer(60000)

StartTimer()

end



function OnTimer()

for key, value in tabAdvert do

if (tabAdvert[key].iClock > clock()+60) then

tabAdvert[key]=nil

end

end

end



function DataArrival(user, data)

if not user.bOperator then

if strsub(data, 1, 1) == "<" then

local _, _, msg = strfind(data, "^%b<>%s+(.*)|")

if Verify(user.sName, msg) then

catch=strsub(user.sName,1,5)         --5 is counting chars of the tag below: if u change [VIP], change it!

if catch=="[VIP]" then                  --ControlUser status : insert users Tag u don't want to get kicked

else

tabAdvert[user.sName]=nil

SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")

user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")

user:Disconnect();

user:TimeBan(15);

s,e,onlymes = strfind(data, "%b<> (.*)")

SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")

end

end

for key, value in controltrigs do

if( strfind( strlower(data), key) ) then

s,e,onlymes = strfind(data, "%b<> (.*)")

SendPmToOps ("TheGullie", "Control: User "..user.sName.." with IP "..user.sIP.." told in main: "..onlymes.."")

end

end



spam=0

if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip.",1,1) ) then

if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then

spam=spam+1; end; end;



if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then

spam=spam+1; end



if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then

if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then

spam=spam+1;end; end



if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then

spam=spam+1;end


if spam>0 then

SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")

user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")

user:Disconnect();

user:TimeBan(15);

s,e,onlymes = strfind(data, "%b<> (.*)")

SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")

end













elseif strsub(data, 1, 4) == "$To:" then

local _, _, to, from, msg = strfind(data, "^%$To:%s+(%S+)%s+From:%s+(%S+)%s-%$%b<>%s+(.*)|")

local nick = GetItemByName(to)

if not nick.bOperator then

local userdata = to.." "..from

if Verify(userdata, msg) then

catch=strsub(user.sName,1,16)

if catch=="['??SemiDeus??']" then

else

tabAdvert[userdata] = nil

SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")

user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")

user:Disconnect();

user:TimeBan(15);

s,e,whoTo,from,mes = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  

SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")

end

end

for key, value in controltrigs do

if( strfind( strlower(data), key) ) then

s,e,whoTo,from,mes = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  

SendPmToOps ("TheGullie", "Control: User "..user.sName.." with IP "..user.sIP.." said to "..whoTo.." this: "..mes.."")

end

end



spam=0

if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip.",1,1) ) then

if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then

spam=spam+1; end; end;



if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then

spam=spam+1; end


if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then

if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then

spam=spam+1;end; end


if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then

spam=spam+1;end


if spam>0 then

SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")

user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")

user:Disconnect();

user:TimeBan(15);

s,e,whoTo,from,mes = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  

SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")

end

end

end

end

end



function Verify(userdata, msg)

if not msg then return end

tmp =""

gsub(strlower(msg), "([a-z0-9.:%-])", function(x) tmp = tmp..x end)

if not tabAdvert[userdata] then

tabAdvert[userdata] = { iClock = clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp}

else

tabAdvert[userdata].iClock = clock()

tabAdvert[userdata].l1 = tabAdvert[userdata].l2

tabAdvert[userdata].l2 = tabAdvert[userdata].l3

tabAdvert[userdata].l3 = tabAdvert[userdata].l4

tabAdvert[userdata].l4 = tabAdvert[userdata].l5

tabAdvert[userdata].l5 = tabAdvert[userdata].l6

tabAdvert[userdata].l6 = tabAdvert[userdata].l7

tabAdvert[userdata].l7 = tabAdvert[userdata].l8

tabAdvert[userdata].l8 = tabAdvert[userdata].l9

tabAdvert[userdata].l9 = tmp

end

local Lines = tabAdvert[userdata].l1..tabAdvert[userdata].l2..tabAdvert[userdata].l3..tabAdvert[userdata].l4..tabAdvert[userdata].l5..tabAdvert[userdata].l6..tabAdvert[userdata].l7..tabAdvert[userdata].l8..tabAdvert[userdata].l9

for key, value in advtrigs do

if (strfind(Lines, strlower(value), 1, 1)) then

for key2, value2 in validtrigs do

if (strfind(Lines, strlower(value2), 1, 1)) then

return nil

end

end

return 1

end

end

end
Title:
Post by: BBD on 14 March, 2005, 23:47:48
no one fancy this one?

If anyone could give it a go i would appreciate it  8)
Title:
Post by: jiten on 15 March, 2005, 09:57:21
Try this:

--Lucifer 6.6.6-- updated version
--converted to LUA 5 by jiten
--This is a Powerful AntiAdvertising Script
--Powered by Demone.Astaroth and OpiumVolage
--History: Base='multiline antiadvertise' by OpiumVolage (your tables simplify the work I did until that moment). Here its features:
--             1)Script can block this types of advertisement: A) example.no-ip.com
--       B) e x a m p l e . n o - i p . c o m
--       C)example.
--          no-
--          ip.
--          com
--       D)e
--          x
--          a
--          m
--          p
--          l
--          e
--          .
--          n
--          o
--          -      
--          i
--          p
--          .
--          c
--          o
--          m
--             2)You can insert valid addresses (like yours) in trigs, so bot won't kick you
--             3)Users conversating with ops don't get kicked
--             4)Why the Timer? It cleans memory.

--             Demone.Astaroth addons: 1)added an huge list of addresses
--        2)When advertising: user advised on Pm before disconnection; Bot sends to all in main chat the kicking message (without IP);
--                                         advertise-infos send to Op-chat directly without troubling any Op with Pms! Infos contain user's IP, user To(if PM) and last message
--         Just replace INSERT.HERE.YOUR.OP-CHAT.NAME fields with yours.
--                          3)inserted Disconnect and TimeBan (15 minutes) instead of gagging user
--        4)Prevented very splitted addresses (with more tabAdvert lines)
--                                      5)added Control-addresses: user isn't kicked for these addresses but Ops are informed in any case.
--                                                                                   this is useful for friend-hubs addresses, if u also want to control them
--                                      6)added ControlUser status: if u're scary about your vips advertising their hubs and stealing you user,
--                                                                                    you can't insert the tag [VIP] or anything else in the specific space: they will not
--                                                                                      get kicked for any addresses, but in case of typing a Control-address, Ops will be
--                                                                                          informed.
--                                      7)Fixed some bug (Thanks Opium)
--      8)Added a new string-pieces find way to catch advertises

BotName = "TheBoss"

advtrigs = {"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"}

validtrigs = {"nu-grime.no-ip.com","ultimate-grime.no-ip.com", "greatfriend.no-ip.com"} --insert here your addresses (like yours or multihub ones or great friend's hub ;) )

controltrigs={["boi"]=1,["speed"]=2,["eski"]=3, ["grime"]=4, ["bbv"]=5, ["bigboi"]=6} --insert here addresses you want to be informed (no kick)

tabAdvert = {}

function Main()
frmHub:RegBot(BotName)
SetTimer(60000)
StartTimer()
end

function OnTimer()
for key, value in tabAdvert do
if (tabAdvert[key].iClock > os.clock()+60) then
tabAdvert[key]=nil
end
end
end


function ChatArrival(user, data)
if not user.bOperator then
if string.sub(data, 1, 1) == "<" then
local _, _, msg = string.find(data, "^%b<>%s+(.*)|")
if Verify(user.sName, msg) then
catch=string.sub(user.sName,1,5)         --5 is counting chars of the tag below: if u change [VIP], change it!
if catch=="[VIP]" then                  --ControlUser status : insert users Tag u don't want to get kicked
else
tabAdvert[user.sName]=nil
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")
end
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps ("TheGullie", "Control: User "..user.sName.." with IP "..user.sIP.." told in main: "..onlymes.."")
end
end

spam=0
if( string.find( string.lower(data), "no",1,1) ) and ( string.find( string.lower(data), "ip.",1,1) ) then
if ( string.find( string.lower(data), "com",1,1) ) or ( string.find( string.lower(data), "org",1,1) ) or ( string.find( string.lower(data), "info",1,1) ) then
spam=spam+1; end; end;

if( string.find( string.lower(data), "dns",1,1) ) and ( string.find( string.lower(data), "2",1,1) ) and ( string.find( string.lower(data), "go",1,1) ) then
spam=spam+1; end

if( string.find( string.lower(data), "dy",1,1) ) and ( string.find( string.lower(data), "nu",1,1) ) then
if( string.find( string.lower(data), ".net",1,1) ) or ( string.find( string.lower(data), ".com",1,1) ) then
spam=spam+1;end; end

if( string.find( string.lower(data), "d n s a",1,1) ) or ( string.find( string.lower(data), "d n s .",1,1) ) or ( string.find( string.lower(data), "d n s 2",1,1) ) or ( string.find( string.lower(data), "o d s .",1,1) ) or ( string.find( string.lower(data), "d y n",1,1) ) then
spam=spam+1;end
if spam>0 then
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")
end
end
end
end

function ToArrival(user, data)
if not user.bOperator then
if string.sub(data, 1, 4) == "$To:" then
local _, _, to, from, msg = string.find(data, "^%$To:%s+(%S+)%s+From:%s+(%S+)%s-%$%b<>%s+(.*)|")
local nick = GetItemByName(to)
if not nick.bOperator then
local userdata = to.." "..from
if Verify(userdata, msg) then
catch=string.sub(user.sName,1,16)
if catch=="['??SemiDeus??']" then
else
tabAdvert[userdata] = nil
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")
end
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps ("TheGullie", "Control: User "..user.sName.." with IP "..user.sIP.." said to "..whoTo.." this: "..mes.."")
end
end

spam=0
if( string.find( string.lower(data), "no",1,1) ) and ( string.find( string.lower(data), "ip.",1,1) ) then
if ( string.find( string.lower(data), "com",1,1) ) or ( string.find( string.lower(data), "org",1,1) ) or ( string.find( string.lower(data), "info",1,1) ) then
spam=spam+1; end; end;

if( string.find( string.lower(data), "dns",1,1) ) and ( string.find( string.lower(data), "2",1,1) ) and ( string.find( string.lower(data), "go",1,1) ) then
spam=spam+1; end

if( string.find( string.lower(data), "dy",1,1) ) and ( string.find( string.lower(data), "nu",1,1) ) then
if( string.find( string.lower(data), ".net",1,1) ) or ( string.find( string.lower(data), ".com",1,1) ) then
spam=spam+1;end; end

if( string.find( string.lower(data), "d n s a",1,1) ) or ( string.find( string.lower(data), "d n s .",1,1) ) or ( string.find( string.lower(data), "d n s 2",1,1) ) or ( string.find( string.lower(data), "o d s .",1,1) ) or ( string.find( string.lower(data), "d y n",1,1) ) then
spam=spam+1;end

if spam>0 then
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps ("TheGullie", "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")
end
end
end
end
end

function Verify(userdata, msg)
if not msg then return end
tmp =""
string.gsub(string.lower(msg), "([a-z0-9.:%-])", function(x) tmp = tmp..x end)
if not tabAdvert[userdata] then
tabAdvert[userdata] = { iClock = os.clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp}
else
tabAdvert[userdata].iClock = os.clock()
tabAdvert[userdata].l1 = tabAdvert[userdata].l2
tabAdvert[userdata].l2 = tabAdvert[userdata].l3
tabAdvert[userdata].l3 = tabAdvert[userdata].l4
tabAdvert[userdata].l4 = tabAdvert[userdata].l5
tabAdvert[userdata].l5 = tabAdvert[userdata].l6
tabAdvert[userdata].l6 = tabAdvert[userdata].l7
tabAdvert[userdata].l7 = tabAdvert[userdata].l8
tabAdvert[userdata].l8 = tabAdvert[userdata].l9
tabAdvert[userdata].l9 = tmp
end
local Lines = tabAdvert[userdata].l1..tabAdvert[userdata].l2..tabAdvert[userdata].l3..tabAdvert[userdata].l4..tabAdvert[userdata].l5..tabAdvert[userdata].l6..tabAdvert[userdata].l7..tabAdvert[userdata].l8..tabAdvert[userdata].l9
for key, value in advtrigs do
if (string.find(Lines, string.lower(value), 1, 1)) then
for key2, value2 in validtrigs do
if (string.find(Lines, string.lower(value2), 1, 1)) then
return nil
end
end
return 1
end
end
end


Best regards,

jiten
Title:
Post by: BBD on 15 March, 2005, 18:25:12
Cheers Dude - Works Perfect (so far)

 :D
Title:
Post by: jiten on 15 March, 2005, 19:14:49
yw :)
Title: Error ?
Post by: davnis on 17 March, 2005, 20:45:49
when I try to load this script on ptokaX 0.3.3.0 buold 16.06
I got this error :

Syntax [string "code:
..."]:50: function arguments expected near `='
Title:
Post by: jiten on 17 March, 2005, 21:05:03
I tried it with PtokaX 16.06 and it's working perfectly  ?(
Have u copied all the code well? Or did some mistake typing the advtrigs?
Title:
Post by: davnis on 17 March, 2005, 21:08:24
I select the whole text that you  (  jiten  )  convert and just paste into txt file with the lua extension .. :(
Title:
Post by: jiten on 17 March, 2005, 21:15:40
Can u copy all the syntax error?

Btw, the code to copy is the one inside the



Best regards.
Title:
Post by: davnis on 17 March, 2005, 22:11:48
thank you !!!!
my fault !! I copy wrong !!

}}}}}{{{{{
Title:
Post by: davnis on 17 March, 2005, 22:19:57
is anyway posible to make this script to send once an message to the Op Chat and the message to be seen in Op Chat by the Operators and not like is now ?

Now any Op receive an private message from "BootName"

thank you
davnis
Title:
Post by: jiten on 18 March, 2005, 07:23:44
Try this one:
Btw, edit the OpChat value, according to ur OpChat name.

--Lucifer 6.6.6-- updated version
--converted to LUA 5 by jiten
--This is a Powerful AntiAdvertising Script
--Powered by Demone.Astaroth and OpiumVolage
--History: Base='multiline antiadvertise' by OpiumVolage (your tables simplify the work I did until that moment). Here its features:
--             1)Script can block this types of advertisement: A) example.no-ip.com
--       B) e x a m p l e . n o - i p . c o m
--       C)example.
--          no-
--          ip.
--          com
--       D)e
--          x
--          a
--          m
--          p
--          l
--          e
--          .
--          n
--          o
--          -      
--          i
--          p
--          .
--          c
--          o
--          m
--             2)You can insert valid addresses (like yours) in trigs, so bot won't kick you
--             3)Users conversating with ops don't get kicked
--             4)Why the Timer? It cleans memory.

--             Demone.Astaroth addons: 1)added an huge list of addresses
--        2)When advertising: user advised on Pm before disconnection; Bot sends to all in main chat the kicking message (without IP);
--                                         advertise-infos send to Op-chat directly without troubling any Op with Pms! Infos contain user's IP, user To(if PM) and last message
--         Just replace INSERT.HERE.YOUR.OP-CHAT.NAME fields with yours.
--                          3)inserted Disconnect and TimeBan (15 minutes) instead of gagging user
--        4)Prevented very splitted addresses (with more tabAdvert lines)
--                                      5)added Control-addresses: user isn't kicked for these addresses but Ops are informed in any case.
--                                                                                   this is useful for friend-hubs addresses, if u also want to control them
--                                      6)added ControlUser status: if u're scary about your vips advertising their hubs and stealing you user,
--                                                                                    you can't insert the tag [VIP] or anything else in the specific space: they will not
--                                                                                      get kicked for any addresses, but in case of typing a Control-address, Ops will be
--                                                                                          informed.
--                                      7)Fixed some bug (Thanks Opium)
--      8)Added a new string-pieces find way to catch advertises

BotName = "TheBoss"
OpChat = "OpChat" -- Insert here your OpChat name. The default one is OpChat

advtrigs = {"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"}

validtrigs = {"nu-grime.no-ip.com","ultimate-grime.no-ip.com", "greatfriend.no-ip.com"} --insert here your addresses (like yours or multihub ones or great friend's hub ;) )

controltrigs={["boi"]=1,["speed"]=2,["eski"]=3, ["grime"]=4, ["bbv"]=5, ["bigboi"]=6} --insert here addresses you want to be informed (no kick)

tabAdvert = {}

function Main()
frmHub:RegBot(BotName)
SetTimer(60000)
StartTimer()
end

function OnTimer()
for key, value in tabAdvert do
if (tabAdvert[key].iClock > os.clock()+60) then
tabAdvert[key]=nil
end
end
end


function ChatArrival(user, data)
if not user.bOperator then
if string.sub(data, 1, 1) == "<" then
local _, _, msg = string.find(data, "^%b<>%s+(.*)|")
if Verify(user.sName, msg) then
catch=string.sub(user.sName,1,5)         --5 is counting chars of the tag below: if u change [VIP], change it!
if catch=="[VIP]" then                  --ControlUser status : insert users Tag u don't want to get kicked
else
tabAdvert[user.sName]=nil
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps (OpChat, "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")
end
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps (OpChat, "Control: User "..user.sName.." with IP "..user.sIP.." told in main: "..onlymes.."")
end
end

spam=0
if( string.find( string.lower(data), "no",1,1) ) and ( string.find( string.lower(data), "ip.",1,1) ) then
if ( string.find( string.lower(data), "com",1,1) ) or ( string.find( string.lower(data), "org",1,1) ) or ( string.find( string.lower(data), "info",1,1) ) then
spam=spam+1; end; end;

if( string.find( string.lower(data), "dns",1,1) ) and ( string.find( string.lower(data), "2",1,1) ) and ( string.find( string.lower(data), "go",1,1) ) then
spam=spam+1; end

if( string.find( string.lower(data), "dy",1,1) ) and ( string.find( string.lower(data), "nu",1,1) ) then
if( string.find( string.lower(data), ".net",1,1) ) or ( string.find( string.lower(data), ".com",1,1) ) then
spam=spam+1;end; end

if( string.find( string.lower(data), "d n s a",1,1) ) or ( string.find( string.lower(data), "d n s .",1,1) ) or ( string.find( string.lower(data), "d n s 2",1,1) ) or ( string.find( string.lower(data), "o d s .",1,1) ) or ( string.find( string.lower(data), "d y n",1,1) ) then
spam=spam+1;end
if spam>0 then
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,onlymes = string.find(data, "%b<> (.*)")
SendPmToOps (OpChat, "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying: "..onlymes.."")
end
end
end
end

function ToArrival(user, data)
if not user.bOperator then
if string.sub(data, 1, 4) == "$To:" then
local _, _, to, from, msg = string.find(data, "^%$To:%s+(%S+)%s+From:%s+(%S+)%s-%$%b<>%s+(.*)|")
local nick = GetItemByName(to)
if not nick.bOperator then
local userdata = to.." "..from
if Verify(userdata, msg) then
catch=string.sub(user.sName,1,16)
if catch=="['??SemiDeus??']" then
else
tabAdvert[userdata] = nil
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (OpChat, "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")
end
end
for key, value in controltrigs do
if( string.find( string.lower(data), key) ) then
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (OpChat, "Control: User "..user.sName.." with IP "..user.sIP.." said to "..whoTo.." this: "..mes.."")
end
end

spam=0
if( string.find( string.lower(data), "no",1,1) ) and ( string.find( string.lower(data), "ip.",1,1) ) then
if ( string.find( string.lower(data), "com",1,1) ) or ( string.find( string.lower(data), "org",1,1) ) or ( string.find( string.lower(data), "info",1,1) ) then
spam=spam+1; end; end;

if( string.find( string.lower(data), "dns",1,1) ) and ( string.find( string.lower(data), "2",1,1) ) and ( string.find( string.lower(data), "go",1,1) ) then
spam=spam+1; end

if( string.find( string.lower(data), "dy",1,1) ) and ( string.find( string.lower(data), "nu",1,1) ) then
if( string.find( string.lower(data), ".net",1,1) ) or ( string.find( string.lower(data), ".com",1,1) ) then
spam=spam+1;end; end

if( string.find( string.lower(data), "d n s a",1,1) ) or ( string.find( string.lower(data), "d n s .",1,1) ) or ( string.find( string.lower(data), "d n s 2",1,1) ) or ( string.find( string.lower(data), "o d s .",1,1) ) or ( string.find( string.lower(data), "d y n",1,1) ) then
spam=spam+1;end

if spam>0 then
SendToAll( BotName, user.sName.." get slaughtered by Lucifer for advertising!")
user:SendPM(BotName, "I slaughtered you! Don't try again to advertise!")
user:Disconnect();
user:TimeBan(15);
s,e,whoTo,from,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")  
SendPmToOps (OpChat, "User "..user.sName.." with IP "..user.sIP.." advertised in main chat saying to "..whoTo.." this: "..mes.."")
end
end
end
end
end

function Verify(userdata, msg)
if not msg then return end
tmp =""
string.gsub(string.lower(msg), "([a-z0-9.:%-])", function(x) tmp = tmp..x end)
if not tabAdvert[userdata] then
tabAdvert[userdata] = { iClock = os.clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp}
else
tabAdvert[userdata].iClock = os.clock()
tabAdvert[userdata].l1 = tabAdvert[userdata].l2
tabAdvert[userdata].l2 = tabAdvert[userdata].l3
tabAdvert[userdata].l3 = tabAdvert[userdata].l4
tabAdvert[userdata].l4 = tabAdvert[userdata].l5
tabAdvert[userdata].l5 = tabAdvert[userdata].l6
tabAdvert[userdata].l6 = tabAdvert[userdata].l7
tabAdvert[userdata].l7 = tabAdvert[userdata].l8
tabAdvert[userdata].l8 = tabAdvert[userdata].l9
tabAdvert[userdata].l9 = tmp
end
local Lines = tabAdvert[userdata].l1..tabAdvert[userdata].l2..tabAdvert[userdata].l3..tabAdvert[userdata].l4..tabAdvert[userdata].l5..tabAdvert[userdata].l6..tabAdvert[userdata].l7..tabAdvert[userdata].l8..tabAdvert[userdata].l9
for key, value in advtrigs do
if (string.find(Lines, string.lower(value), 1, 1)) then
for key2, value2 in validtrigs do
if (string.find(Lines, string.lower(value2), 1, 1)) then
return nil
end
end
return 1
end
end
end


Best regards,

jiten