PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Pedro on 27 February, 2004, 02:32:36

Title: Anti Swearing
Post by: Pedro on 27 February, 2004, 02:32:36
Dont tell me to use search, I already have a script but what it doesnt do is check main chat only, the one I am using checks main chat and PMs, but I believe the PMs should be kept private and users should be allowed to say what they want..so really all I need is a script to check for Swearing I Main Chat ONLY!!!

Can anyone help.. here is the script I use now

--Made By nErBoS
--Fixed by plop


botname = "??Helga??"
trigs = {"bad words removed  to keep it clean in forum"}

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 i=1,getn(trigs) do
            if( strfind( strlower(data), trigs[i]) ) then
            local word = strlower(data), trigs[i]
               SendToAll(botname, "The user "..user.sName.." was banned for Swearing." )
               user:SendData(botname, "You have been banned for Swearing.")
               SendPmToOps(botname, "The user "..user.sName.." was banned for Swearing.")
               SendPmToOps(botname, "The user IP "..user.sIP.." .")
               SendPmToOps(botname, "He wrote : "..word)
               user:Disconnect()
               user:TempBan()
               break
            end
         end
      end
   end
end

Thanx guys and good luck to you and make me a happy man
Title:
Post by: nErBoS on 27 February, 2004, 02:55:16
Hi,

Done...

--Made By nErBoS
--Fixed by plop


botname = "? Helga ?"
trigs = {"bad words removed  to keep it clean in forum"}

function Main()
   frmHub:RegBot(botname)
end
   
function DataArrival(user, data)
   if (not user.bOperator) then
      if ( strsub(data, 1, 1) == "<" ) then
         for i=1,getn(trigs) do
            if( strfind( strlower(data), trigs[i]) ) then
            local word = strlower(data), trigs[i]
               SendToAll(botname, "The user "..user.sName.." was banned for Swearing." )
               user:SendData(botname, "You have been banned for Swearing.")
               SendPmToOps(botname, "The user "..user.sName.." was banned for Swearing.")
               SendPmToOps(botname, "The user IP "..user.sIP.." .")
               SendPmToOps(botname, "He wrote : "..word)
               user:Disconnect()
               user:TempBan()
               break
            end
         end
      end
   end
end

Best regards, nErBoS
Title:
Post by: Pedro on 28 February, 2004, 13:04:07
Thanks m8, your a life saver.

this will help our network and can only make it better ( well at least it will stop the complaints) lol


HAPPIER DAYS