PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: burro.oly on 03 December, 2004, 21:20:37

Title: anti scripts !kick
Post by: burro.oly on 03 December, 2004, 21:20:37
entren al hub ellolyhub.no-ip.info
entren al hub ellolyhub.no-ip.info
 8)  ;(  ?(

--====[ Advertising Shield ]====--
-- Version: 11
-- By: NightLitch
-- Date: 5/25/2004
----------------------------------------------------
-- Set Botname
BotName = "sensi"
-- Set action for advertising ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban)
Action = 0
-- Set OK hubs that are allowed to be entered.
OkHubs = {
"myaddy",
"myhub.myftp.org",
"myhub.myftp.org",
"myhub.myftp.org",
}
-- Accepted "sites" or triggers infront of the address
Sites = {
"www.",
"http://",
"ftp://",
"irc.",
"cs.",
}
-- Denyed/not allowed adver's sent in chat/pm
Adver = {
"info",
"no-ip",
"myftp",
"dyndns",
"dns2go",
"dynip",
"d2g",
"dynu",
"mine",
"kick-ass",
"sytes",
"homeip",
"mine",
"serveftp",
"servebeer",
"kicks-ass",
"gotdns",
"udgnet",
"myip",
}
-- Extentions belonging to Adver above.
Ext = {
"com",
"net",
"org",
"se",
"nu",
"hu",
}
-- Change characters.
CharCh = {
["%(dot%)"]=".",
["dot"]=".",
["%(%-%)"]="-",
["#"]="",
["!"]="",
["+"]="",
["%-"]="",
["*"]="",
["/"]="",
[" '"]="",
}
---------------------------------------------------------------
-- DON'T EDIT BELLOW --
tabAdvert = {}

function Main()
   frmHub:RegBot(BotName)
end

function DataArrival(curUser, data)
   local Msg = ""
   if strsub(data, 1, 1) == "<" and not strfind(data,"> !") and not curUser.bOperator then
      local _, _,line = strfind(data, "^%b<>%s+(.*)")
      Msg = line
      for i,v in CharCh do
             line=gsub(line, i, v)
      end
      if CheckAdver(curUser,line,"in Main-Chat, typing",Msg)==1 then
         return 1
      end
   elseif ( strsub(data, 1, 4) == "$To:" ) and not curUser.bOperator then
      local _,_,to,from,line = strfind(data,    "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      Msg = line
      for i,v in CharCh do
             line=gsub(line, i, v)
      end
      if CheckAdver(curUser,line,"in PM to "..to..", typing",Msg)==1 then
         return 1
      end
   elseif (strsub(data,1,7) == "$MyINFO") then
      local _,_,line = strfind(data, "%$MyINFO %$ALL %S+%s+(.*)<")
      Msg = line
      for i,v in CharCh do
             line=gsub(line, i, v)
      end
      if CheckAdver(curUser,line,"in Tag Description",Msg)==1 then
         return 1
      end
   end
end

function CheckAdver(curUser,line,msg,Msg)
   local adver,extension = Verify(curUser.sName, line,Adver), Verify(curUser.sName, line,Ext)
   if adver and extension and OkAdver(line)~=1 then
      tabAdvert = nil
      tabAdvert = {}
      local action = DoDisc(curUser,msg,line)
      SendToOps("",curUser.sName.." ( "..curUser.sIP.." )  is "..action.." becouse advertising "..msg..": "..Msg)
      return 1
   end
end

function DoDisc(curUser,msg,line)
   if Action==0 then
      curUser:SendPM(BotName,"You are Warned for advertising "..msg..": "..line) return "Warned"
   elseif Action==1 then
      curUser:SendPM(BotName,"You are Disconnected for advertising "..msg..": "..line)
      curUser:Disconnect() return "Disconnected"
   elseif Action==2 then
      curUser:SendPM(BotName,"You are Kicked for advertising "..msg..": "..line)
      curUser:TempBan() return "Kicked"
   elseif Action==3 then
      curUser:SendPM(BotName,"You are Banned for advertising "..msg..": "..line)
      curUser:Ban() return "Banned"
   end
end

function OkAdver(adver)
   for i,v in OkHubs do
      if strfind(adver,v) then
         return 1
      end
   end
end

function Verify(userdata, msg,table)
   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 key, value in table do
      if (strfind(Lines, strlower(value), 1, 1)) then
         return 1
      end
   end
end
 
Title:
Post by: witch on 04 December, 2004, 01:02:35
and?
Title:
Post by: enema on 04 December, 2004, 08:26:55
If you want a script, that "unkicks" users or removes each one from TempBan individually, you can forget about it! I already asked for it like months ago... Its impossible... But if you want us to fix, modify or do anything else with this one, you have to tell us what!