Aloha to all.. a little bug with this cul script..
-- * * * NXS-3 Advertising Part * * *
-- By: NightLitch 2004/02/10
---------------------------------------------------
-- Verify Function from Lucifer.
---------------------------------------------------
-- Set BotName
BotName = "NXS-3"
-- Set HubAddress that will be shown instead of the ADVER advertising's.
HubAddress = "my.hub.org"
-- Ok Hubs that are allowed to be entered in hub
OKHUBS = {
["my.hub.no-ip.info"] = 1,
["my.hub.org"] = 1,
}
-- Advertising Trigs
ADVER = {
["myftpsite"]=1,["dns2go"]=2,["ip.com"]=3,["pornstarguru.com/page.php?x=37516&m=3"]=4,["ip.org"]=5,["ip.biz"]=6,["dynip.com"]=7,["d2g.com"]=8,["dyndns.org"]=9,["dynu.com"]=10,
["mine.org"]=11,["kick-ass.net"]=12,["darkdata.net"]=13,["ipme.net"]=14,["udgnet.com"]=15,["sytes.net"]=16,["d2g.biz"]=17,["homeip.net"]=18,["mine.nu"]=19,["depecheconnect.com"]=20,
["e-net.lv"]=21,["newgnr.com"]=22,["serveftp.com"]=23,["evildc.com"]=24,["bst.net"]=25,["bsd.net"]=26,["ods.org"]=27,["dnsalias.org"]=28,["x-host.net"]=29,["x-host.org"]=30,
["bounceme.net"]=31,["myvnc.com"]=32,["sytes.net"]=33,["xs4all.net"]=34,["xs4all.nl"]=35,["kyed.com"]=36,["finx.org"]=37,["ath.cx"]=38,["sheckie.net"]=39,["vizvaz.net"]=40,
["servebeer.com"]=41,["65.61.153.217/page.php?x=906228"]=42,["kicks-ass.com"]=43,["nerdcamp.net"]=44,["gotdns.org"]=45,["homeip.net"]=46,["cicileu.org"]=47,["cicileu.com"]=48,["3utilities.com"]=49,["bounceme.net"]=50,
["myftp.biz"]=51,["myftp.org"]=52,["myvnc.com"]=53,["no-ip.biz"]=54,["no-ip.com"]=55,["no-ip.info"]=56,["no-ip.org"]=57,["redirectme.net"]=58,["servebeer.com"]=59,["servecounterstrike.com"]=60,
["serveftp.com"]=61,["servegame.com"]=62,["servehalflife.com"]=63,["servehttp.com"]=64,["serveirc.com"]=65,["servemp3.com"]=66,["servepics.com"]=67,["servequake.com"]=68,["sytes.net"]=69,["zapto.org"]=70,
["ciscofreak.com"]=71,["damnserver.com"]=72,["ditchyourip.com"]=73,["dnsiskinky.com"]=74,["geekgalaxy.com"]=75,["net-freaks.com"]=76,["no-ip.ca"]=77,["no-ip.co.uk"]=78,["no-ip.net"]=79,["point2this.com"]=80,
["securityexploits.com"]=81,["securitytactics.com"]=82,["servehumour.com"]=83,["servep2p.com"]=84,["servesarcasm.com"]=85,["stufftoread.com"]=86,["unusualperson.com"]=87,["workisboring.com"]=88,["hopto"]=89,["pornstarguru.com"]=90,
["hub."]=91,[".dyn.ro"]=92,
}
-- Acceptable trigs
SITES = { "www.","http://","ftp://","irc.","cs." }
--DON'T EDIT FROM HERE--
tabAdvert = {}
function Main()
frmHub:RegBot(BotName)
end
function SiteCheck(msg)
for value,index in SITES do
if strfind(msg,index) then
return 1
end
end
end
function FindAdver(adver)
for v2,i2 in OKHUBS do
if strfind(adver,v2) then
return "K"
end
end
end
function DataArrival(curUser, data)
if ( strsub(data, 1, 1) == "<" ) then
if not curUser.bOperator then
local _, _, msg = strfind(data, "^%b<>%s+(.*)|")
if SiteCheck(msg)==1 then
return 0
else
if Verify(curUser.sName, msg) then
local Lines = Verify(curUser.sName, msg)
tabAdvert = nil
tabAdvert = {}
local s,e, adver = strfind(Lines, "[^#]#(%S+)$")
if (FindAdver(adver) == "K") then
return 0
else
curUser:SendPM(BotName,"Aceste cuvinte ne doare...")
SendToOps("",curUser.sName.." e cu muja si face reclama la: "..msg)
return 1
end
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), "my",1,1) ) and ( strfind( strlower(data), "ftp",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
s,e,msg = strfind(data, "%b<> (.*)")
curUser:SendPM(BotName,"Aceste cuvinte ne doare..")
SendToOps("",curUser.sName.." e cu muja si face reclama la: "..msg)
end
end
elseif ( strsub(data, 1, 4) == "$To:" ) then
local s,e,to,text = strfind(data, "%$To:%s(%S+)%sFrom:%s%S+%s$(.*)$")
if(to == nil) then return 0 end
to = GetItemByName(to)
if not curUser.bOperator then
local _, _, msg = strfind(data, "^%b<>%s+(.*)|")
if SiteCheck(msg)==1 then
return 0
else
if Verify(curUser.sName, msg) then
local Lines = Verify(curUser.sName, msg)
tabAdvert = nil
tabAdvert = {}
local s,e, adver = strfind(Lines, "[^#]#(%S+)$")
if (FindAdver(adver) == "K") then
return 0
else
curUser:SendPM(BotName,"Aceste cuvinte ne doare..")
SendToOps("",curUser.sName.." e cu muja si face reclama la: "..msg)
return 1
end
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), "my",1,1) ) and ( strfind( strlower(data), "ftp",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
s,e,msg = strfind(data, "%b<> (.*)")
curUser:SendPM(BotName,"Aceste cuvinte ne doare..")
SendToOps("",curUser.sName.." e cu muja si face reclama la: "..msg)
end
end
end
end
function Verify(userdata, msg)
if not msg then return end
tmp =""
gsub(strlower(msg), "([a-?0-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 value, key in ADVER do
if (strfind(Lines, strlower(value), 1, 1)) then
return Lines
end
end
end
And i have this error:
Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
1: function `strfind' [C]
2: function `SiteCheck' at line 46 [file `C:\PtokaX_0.330_15.25_\scripts\advertise.lua']
3: function `DataArrival' at line 107 [file `C:\PtokaX_0.330_15.25_\scripts\advertise.lua']
Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
1: function `strfind' [C]
2: function `SiteCheck' at line 46 [file `C:\PtokaX_0.330_15.25_\scripts\advertise.lua']
3: function `DataArrival' at line 107 [file `C:\PtokaX_0.330_15.25_\scripts\advertise.lua']
And in the Advanced Options its show me like i loaded 2 times one single file.. 'advertise.lua'' with the same name.. and that its weird.. :)
Regards,
please post in the correct thread for NXS-3 , and not in the PtokaX bug report thread ...
Typhoon?
Hi there
Can u move my post there ? i dont find the right thread..
Regards Belea
Here is the link ... (http://board.univ-angers.fr/thread.php?threadid=2186&boardid=12&page=4#67)
Thx Herodes.. and now someone should delete this thread.. :)