PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: neechan on 15 October, 2004, 11:49:51

Title: small edit of an anti-sick search script (i hope)
Post by: neechan on 15 October, 2004, 11:49:51
can someone add a feaeture to this

as its set-up now it sends a msg to ops-chat
but i would like to have something like this added to it:

Send in main to a list of ops
but not showing to the users in main or the ops that are not in the list

i figure its something like this

---------------

Opslist = "nicks of ops that get the msg in main"

SendToOpslist(botname, "user: "..tUser.sName.." had the bad word "..key.." in this search, the whole string was: \""..niceString.."\"")

---------------

but that isnt working :(

can someone edit it in the below shown script for me ???


Code:
----------------------------

-- pm to ops chat of any one
-- searching for bad files
-- by ??????Hawk??????  
-- 28-06-2004
-- fixed by ??Empie??
-- 11-08-2004

BadFiles = {
   ["childsex"]=1,
   ["childporn"]=2,
   ["underage"]=3,
   ["animalsex"]=4,
   ["preteen"]=5,
   ["r@ygold"]=6,
   ["lolita"]=7,
   ["rape"]=8,
   ["incest"]=9,
   ["beastiality"]=10,
   ["rape"]=11,
}

-- Good Users are case sensitive!
GoodUsers = {
   ["And_M"]=1,
   ["jossy"]=2,
   ["Cheetara"]=3,
}

opchat = "Lin's-Dark-room"
botname = "Lin?Minmay"
relax = 0

function Main()
   frmHub:EnableFullData(1)
end

function DataArrival(tUser, sData)
   if (tUser.bOperator == nil) then
      for key2,a in GoodUsers do
         if (tUser.sName == key2) then
            relax = 1
         end
      end
      if (relax==0) then
         if strsub(sData, 1, 12) == "$Search Hub:" then
            local _,_,  sSearch = strfind(sData, "$Search Hub:%S+%s+%a%?%a%?%d+%?%d+%?(.*)|")
            for key,a in BadFiles do
               if( strfind( strlower(sSearch), key) ) then
                  theString = sSearch
                  niceString = gsub(theString, "[$]", " ")
                  SendPmToOps(opschat, "\r\n\r\nThis user is searching for Bad files Please check their share: \r\n\r\nUsername: \t"..tUser.sName.."\r\n\IP: \t\t" .. tUser.sIP .. "\r\nSearched for: \t\""..niceString.."\"\r\n" )
--                  SendToAll(botname, "user: "..tUser.sName.." had the bad word "..key.." in this search, the whole string was: \""..niceString.."\"")
               end
            end   
         elseif strsub(sData, 1, 7) == "$Search" then
            local _,_, sSearch = strfind(sData, "%$Search %d+%.%d+%.%d+%.%d+:%d+%s+%a%?%a%?%d+%?%d+%?(.*)|")
            for key,a in BadFiles do
               if( strfind( strlower(sSearch), key) ) then
                  theString = sSearch
                  niceString = gsub(theString, "[$]", " ")
                  SendPmToOps(opschat, "\r\n\r\nThis user is searching for Bad files Please check their share: \r\n\r\nUsername: \t"..tUser.sName.."\r\n\IP: \t\t" .. tUser.sIP .. "\r\nSearched for: \t\""..niceString.."\"\r\n" )
--                  SendToAll(botname, "user: "..tUser.sName.." had the bad word "..key.." in this search, the whole string was: \""..niceString.."\"")
               end
            end
         end
      end
   relax = 0
   end
end

------------------
end Code

thanks in advance

greetings neechan
Title:
Post by: bastya_elvtars on 15 October, 2004, 12:01:05
opslist={"op1","op2","bastya_elvtars","neechan"}
and

for k=1,getn(opslist) do -- repeats the below for every item in array called opslist
  SendToNick(opslist[k],botname, "user: "..tUser.sName.." had the bad word "..key.." in this search, the whole string was: \""..niceString.."\"") -- sends the stuff
end
Title:
Post by: neechan on 15 October, 2004, 12:06:32
thanks ill try that :D
Title:
Post by: neechan on 15 October, 2004, 13:04:27
could you implement it in the script ....

because for some reason i dont get it to work

:(