PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: AL?MCi on 27 April, 2007, 00:58:08

Title: bad word checker
Post by: AL?MCi on 27 April, 2007, 00:58:08
I take the script in another topic and modified it but i have problem,

For example;
if a user uses "fuck" or "aafuck" or "fuckaa" he is disconnected. How is he disconnected only using "fuck"



sBot = frmHub:GetHubBotName()
trigs = { ["fuck"]=1,["coaie"]=2,["suck"]=3,["sucks"]=4,["suckz"]=5,["blow"]=6,["fucker"]=7,

}

function ChatArrival (user, data)
data=string.sub(data,1,string.len(data)-1)
local s,e,msg = string.find(data, "%b<>(.+)")
if (not user.bOperator) then
for key,a in pairs(trigs) do

if(string.find( string.lower(msg), "[%s%.%,%-%_]?" .. key .. "[%s%.%,%-%_%|]?")) then
SendPmToOps(sBot," "..user.sName.." Try to sent this message in Main----> "..data)
user:Disconnect()
return 1
end
end
end
end

Title: Re: bad word checker
Post by: AL?MCi on 27 April, 2007, 02:05:25

Now it is workin, Thx Mutor...
Title: Re: bad word checker
Post by: jack_port1000 on 25 June, 2007, 14:05:57
hi, if some one use this word bot disconnect them i want just bot changeword to "Sorry" not disconnect to user in this script


-- Set BotName
sBot = frmHub:GetHubBotName()
HubOwner = "Psycho_Chihuahua"
CheckProfiles = {
[0] = 1,    -- =[Master]=
[1] = 1,    -- =[OP]=
[2] = 1,    -- =[ViP]=
[3] = 1,    -- =[Reg]=
[4] = 1,    -- =[Custom Profile 1]=
[5] = 1,    -- =[Custom Profile 2]=
[-1] = 1,    -- =[UnReg]=
}


local trigs = {"fuck","coaie","suck","sucks","suckz","blow","fucker","chutiya",
"madarchod","chodu","bhadva","bhadve","chut","lund","lavde","lavdu","bhenchod","madarchot","madar",
"rand","randi","chod","chinal","gand","jatu","lundfakir","lavda","bastard","maderchod","lodu","bhosda","landus","bhadwa","harami","motherfucker",}

function Main ()
string.gmatch = (string.gmatch or string.gfind);
end

function ChatArrival (user, data)
if CheckProfiles[user.iProfile] == 1 then
local s,e,msg = string.find(string.lower(data), "^%b<> (.+)|$")
for word in string.gmatch(msg,"(%S+)") do
for key,val in ipairs(trigs) do
if word == string.lower(val) then
return SendPmToOps(sBot," "..user.sName.." Try to sent "..
"this message in Main----> "..data),user:SendData(sBot,user.sName..", "..
"please don't use words like "..word.." in this hub order by AnnA  Reconnect to hub."),user:Disconnect(),1
end
end
end
end
end


Title: Re: bad word checker
Post by: Thor on 25 June, 2007, 14:38:25
If you want to change a word into a sentence, use wordreplacer. If you want to filter the main and private chat, use forbidden scripts, there are several one.
Title: Re: bad word checker
Post by: jack_port1000 on 25 June, 2007, 17:17:46


can you give me link for word replacer but it must work for caps also i find in all forums but not get it
Title: Re: bad word checker
Post by: Psycho_Chihuahua on 25 June, 2007, 17:45:39
using the search function would help so much

http://forum.ptokax.org/index.php?topic=7148#msg68912
Title: Re: bad word checker
Post by: jack_port1000 on 26 June, 2007, 08:55:47
Thanks a lot both of u script work very nice tanks again