I have been using an Anti Swear script for some time now but i have upgraded to latest ptokax and roboc and it doesn't work any more...here is the script i have been using
--Made By nErBoS
--Fixed by plop
botname = "?SwearBot?"
trigs = {"offensive words have been removed"}
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) ) then
local word = strlower(data), trigs
SendToAll(botname, "The user "..user.sName.." was banned for Advertising or Swearing." )
user:SendData(botname, "You have been banned for Advertising or Swearing.")
SendPmToOps(botname, "The user "..user.sName.." was banned for Advertising or Swearing.")
SendPmToOps(botname, "The user IP "..user.sIP.." .")
SendPmToOps(botname, "He wrote : "..word)
user:Disconnect()
user:TempBan()
break
end
end
end
end
end
Thanks in advance
--By Dessamator
--Made By nErBoS
--Fixed by plop
botname = "?SwearBot?"
trigs = {"offensive words have been removed"}
function Main()
frmHub:RegBot(botname)
end
function ChatArrival(user, data)
if (not user.bOperator) then
for i=1,table.getn(trigs) do
if( string.find( string.lower(data), trigs[i]) ) then
local word = string.lower(data), trigs[i]
SendToAll(botname, "The user "..user.sName.." was banned for Advertising or Swearing." )
user:SendData(botname, "You have been banned for Advertising or Swearing.")
SendPmToOps(botname, "The user "..user.sName.." was banned for Advertising or Swearing.")
SendPmToOps(botname, "The user IP "..user.sIP.." .")
SendPmToOps(botname, "He wrote : "..word)
user:Disconnect()
user:TempBan()
break
end
end
end
end
Done(untested) !!!
Hum, u forgot to change "str" to "string." ;)
Cheers
done !!
Post edited, ;)