Need some help to add one feature.
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Need some help to add one feature.

Started by Ahmed, 10 July, 2004, 23:29:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ahmed

I have foud one good word replace script, it works onli in main chat, and i can't to get it workin in PM too.

--//NaughtyASs Cook Bot v1.06 fixed by Phatty
--//Does things with words lol :p

Bot = "!crazy"
function Main()
	frmHub:RegBot(Bot)
end
 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
	for i,v in badtable do
	   	data=gsub(data, i, v)
		--data, x,y = gsub(data, "%b"..i, v)
		end
	SendToAll(data)
	return 1
	end
end

nErBoS

#1
Hi,

Try this...

--//NaughtyASs Cook Bot v1.06 fixed by Phatty
--//Does things with words lol :p
--//Work in PM by nErBoS

Bot = "!crazy"
function Main()
	frmHub:RegBot(Bot)
end
 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		for i,v in badtable do
		   	data=gsub(data, i, v)
		end
		SendToAll(data)
		return 1
	elseif strsub(data, 1, 5) == "$To: " then
		for i,v in badtable do
		   	data=gsub(data, i, v)
		end
		user:SendData(data)
		return 1
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

Ahmed

Found litle problems, PM dont work correctly, when i using
 
elseif strsub(data, 1, [COLOR=red]5[/COLOR] ) == "$To: " then

then PM dont work, if i edit it to
elseif strsub(data, 1, [COLOR=red]4[/COLOR] ) == "$To: " then

then script dont work.

NightLitch

--//NaughtyASs Cook Bot v1.06 fixed by Phatty
--//Does things with words lol :p
--//Work in PM by nErBoS
--//Slight Change by NightLitch should work in PM now...

Bot = "!crazy"
function Main()
	frmHub:RegBot(Bot)
end
 
badtable = {

["twat"]="bread",
["cunt"]="dish washer",
["bastard"]="cook-book",
["fucker"]="chief",
["fucking"]="cooking",
["fuck"]="cook",
["arsehole"]="microwave",
["arse"]="microchip",
["clit"]="tomato",
["cock"]="banana",
["tosser"]="baker",
["bitch"]="teaspoon",
["shit"]="mcdonald's manager",
["crap"]="chocolate",
["pissed"]="diluted",
["piss"]="orange juice",
["shagging"]="boiling",
["shag"]="sauce",
["cum"]="water",
["spunk"]="juice",
["asshole"]="fridge-freezer",
["ass"]="oven",
["slut"]="grape-fruit",
["dick"]="sausage",
["fanny"]="pie",
["whore"]="hotdog",
["wanker"]="i'm a wanker",
["slag"]="i'm a slag",

}

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		for i,v in badtable do
		   	data=gsub(data, i, v)
		end
		SendToAll(data)
		return 1
	elseif strsub(data, 1, 4) == "$To:" then
		for i,v in badtable do
		   	data=gsub(data, i, v)
		end
		user:SendData(data)
		return 1
	end
end

/NL
//NL

Ahmed

#4
Destination users dont recive private messages,
but user who send message recive his own messages.
Then users send messages itself.

plop

try this 1.
-- word replace script.
-- by plop


---- filter what? use 1 to enable, nil to disable the filter.
FilterPm = nil
FilterMain = 1

---- the words to be replaced and by what.
tBadWords = {
   ["fuck"]= "havin sex",
   ["shit"] = "bleeeeeeeeh",
   ["m8"] = "mate",
   ["ass"] = "my hiny",
   ["g/f"] = "girlfriend",
   ["asshole"] = "(place where dirty stuff exits the body)",
   ["dick"] = "male saucage",
   ["cum"] = "body cream",
   ["fucker"] = "I love you",
   ["fuckers"] = "I love you guy's",
   ["fucking"] = "doing dirty",
   ["bastard"] = "naughty boy",
   ["hell"] = "mac donalds",
   ["whore"] = "angel",
   ["yep3"] = "yepyepyep4711",
   ["nl"] = "NightLitch",
   ["truck"] = "[NL]trucker",
   ["woosh"] = "Wooshman",
   ["ner"] = "nErBoS",
   ["typ"] = "typhoon",
   ["opti"] = "Optimus",
   ["opium"] = "OpiumVolage",
   ["kbeh"] = "kbeh273300",
   ["shad"] = "Shad_dow?",
   ["hawk"] = "??????Hawk??????", 
   ["des"] = "Herodes",
   ["nid"] = "Nidaros",
   ["2"] = "to"
}

tBadChar = {
   ["!"] = "",
   ["?"] = "",
   ["."] = "",
   [":"] =  "",
   ["\""] = "",
   ["'"] = "",
   ["*"] = "",
   ["("] = "",
   [")"] = "",
   ["="] = ""
}

function CheckLetter(letter)
   if tBadChar[letter] then
      store = store..letter
      return tBadChar[letter]
   else
      return letter
   end
end

function CheckWord(word)
   store = ""
   local word2 = gsub(word, "(%S)", function(letter) return CheckLetter(letter) end)
   if tBadWords[word2] then
      c = 1
      return tBadWords[word2]..store
   else
      return word
   end
end

function DataArrival(user, data) 
   c = nil
   if( strsub(data, 1, 1) == "<" ) then
      if FilterMain then
         local data = strlower(strsub(data,(strlen(user.sName)+4),strlen(data)-1))
         data=gsub(data , "(%S+)", function(word) return CheckWord(word) end)
         if c then
            local s,e, cmd = strfind(data, "%s*(%S+)")
            if cmd == "!me" then
               SendToAll("* "..user.sName.." "..strsub(data, 5, strlen(data)).."|")
               return 1
            else
               SendToAll(user.sName, data.."|")
               return 1
            end
         end
      end
   elseif(strsub(data, 1, 4) == "$To:") then
      if FilterPm then
         local data = strsub(data, 1, (strlen(data)-1))
         local s,e,whoto = strfind(data, "%S+%s*(%S+)")
         s,e,data = strfind(data, "$%b<>%s*(.*)$")
         data=gsub(data , "(%S+)", function(word) return CheckWord(word) end)
         if c then
            SendPmToNick(whoto, user.sName, data.."|")
            return 1
         end
      end
   end
end

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Ahmed

Thx, I think all right, now.

SMF spam blocked by CleanTalk