First Romanian Word Censor V.1.0 - really working
 

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

First Romanian Word Censor V.1.0 - really working

Started by Paco, 10 September, 2005, 14:41:21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paco

I think that should do for now. Final version of Romanian Word Censor V.1.0. It really works. I expect critics and bugs.
---------------------------------------------------------------------
Special thanks goes to the true artists of LUA who really have proven to contribue to the expansion of LUA language with their continue support. Thank you guys. I'm in your debt. All my best from Romania.
-order of helping appearance-
Mutor
Scanning
madman
Corayzon  (I have to ask you to forgive me, my bad man, i was tired)
---security bot name
botname = frmHub:GetHubBotName() 
---checks only profiles with value 0 in the array
LevelHigh = { 
[0] = 1, -- Master 
[1] = 0, -- Operator 
[2] = 0, -- VIP 
[3] = 0, -- Reg 
[4] = 0, -- Moderator 
[5] = 0, -- Netfounder 
[-1] =0, -- User 
} 
---bad words list, here you can replace them
trigs = { ["fuck"]=1,["coaie"]=2,["suck"]=3,["sucks"]=4,["suckz"]=5,["blow"]=6,["fucker"]=7, 
["homeip"]=8,["no%-ip"]=9,["dyn"]=10,["dns"]=11,["myftp"]=12,["asshole"]=13,["d2g"]=14, 
["serveftp"]=15,["sytes"]=16,["http"]=17,["udgnet"]=18,["servebeer"]=19,["zapto"]=20,["hopto"]=21, 
["dnsalias"]=22,["bounceme"]=23,["masochist"]=24,["lysekil"]=25,["stoarfa"]=26,["xs4all"]=27,["dynip"]=28, 
["gotdns"]=29,["servemp3"]=30,["tropico"]=31,["sugeai"]=32,["pizda"]=33,["curva"]=34,["muie"]=35, 
["pula"]=36,["proxenet"]=37,["bitch"]=38,["floci"]=39,["penis"]=40,["shit"]=41,["sugi"]=42, 
["cacanar"]=43,["pedofil"]=44,["zoofil"]=45,["cacat"]=46,["muisti"]=47,["gaoaza"]=48,
["sperma"]=49,["kkt"]=50,["futai"]=51,["futeai"]=52,["erectie"]=53,["ejaculare"]=54,
["felatio"]=54,["labii"]=55,["dchub"]=56,["ejaculezi"]=57,["ejaculat"]=58,["futi"]=59,["futem"]=60,["futeti"]=61
} 
---censor main chat
function ChatArrival (user, data) 
if LevelHigh[user.iProfile] == 0 then
data=string.sub(data,1,string.len(data)-1) 
local s,e,msg = string.find(data, "%b<>(.+)")
	if (not user.bOperator) then -- simple bad user in main
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				SendToAll( botname,user.sName.." a primit BAN pt. cuvinte interzise si isi cere scuze. Mesajul sau nu va fi afisat din respect pentru ceilalti VIP. Urmeaza ca masterii sa decida daca a fost intentionat sau doar o greseala. O lista completa a acestor cuvinte poate fi citita folosind in fereastra principala comanda: +rules" ) 
				user:SendPM( botname, user.sName..":  ai zis: "..msg.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" ) 
				SendPmToOps ( botname,user.sName.." a fost dat afara pentru cuvinte triviale sau reclama: "..msg )
				user:Ban()
				user:Disconnect() 
				return 1 
			end 
		end 
	else ---if it is a bad op in main master should know
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				user:SendPM( botname, user.sName.." a folosit cuvinte triviale sau a facut reclama: "..msg ) 
				return 1 
			end 
		end 
	end 
end
end
---censor privat chat
function ToArrival(user, data) 
if LevelHigh[user.iProfile] == 0 then
data=string.sub(data,1,string.len(data)-1) 
local s,e,msg = string.find(data, "%$(%b<>.+)")
	if (not user.bOperator) then -- simple bad user in main
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				user:SendPM( botname, user.sName..":  ai zis: "..msg.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" ) 
				SendPmToOps ( botname,user.sName.." a fost dat afara pentru cuvinte triviale sau reclama: "..msg)
				user:Ban()
				user:Disconnect() 
				return 1 
			end 
		end 
	else ---if it is a bad op in main master should know
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				SendPmToOps ( botname,user.sName.." a folosit din lista interzisa ceva in exprimarea: "..msg )
				return 1 
			end 
		end 
	end
end
end

Corayzon

Carayzon sounds more like crayon lol ^^

Nice work on ur first effort mate =]

James

LOL
syntax...Replace this in your Script Line 58 :

user:SendPM( botname, user.sName..":  ai zis: "..txt.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" )
 



with this:

user:SendPM( botname, user.sName..":  ai zis: "..msg.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" )
 

MfG.
  James

Paco

I tried to add a function to save the adv attempts in an external file in case the master is not online he/she can view the logs. I hope it works. Try it.
botname = frmHub:GetHubBotName() 
CensorFile = "Censor.tbl"
LevelHigh = { 
[0] = 1, -- Master 
[1] = 0, -- Operator 
[2] = 0, -- VIP 
[3] = 0, -- Reg 
[4] = 0, -- Moderator 
[5] = 0, -- Netfounder 
[-1] =0, -- User 
} 
trigs = { ["homeip"]=1,["no%-ip"]=2,["dyn"]=3,["dns"]=4,["myftp"]=5,["d2g"]=6,
["serveftp"]=7,["sytes"]=8,["http"]=9,["udgnet"]=10,["servebeer"]=11,["zapto"]=12,["hopto"]=13, 
["dnsalias"]=14,["bounceme"]=15,["dchub"]=16,["lysekil"]=17,["xs4all"]=18,["dynip"]=19, 
["gotdns"]=20,["servemp3"]=21,["webhop"]=22,["servepics"]=23,["ronet"]=24,["kontrol"]=25,["lastdot"]=26,
["servequaqe"]=27,["servemp3"]=28,["servehttp"]=29,["tkhub"]=30,["planetdns"]=31,["redirectme"]=32,["myvnc"]=33,
["servebeer"]=34,["servecounterstrike"]=35,["servegame"]=36,["servehalflife"]=37
} 
---rand19
function ChatArrival (user, data) 
if LevelHigh[user.iProfile] == 0 then
data=string.sub(data,1,string.len(data)-1) 
local s,e,msg = string.find(data, "%b<>(.+)")
	if (not user.bOperator) then -- simple bad user in main
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				SendToAll( botname,user.sName.." a primit BAN pt. cuvinte interzise si isi cere scuze. Mesajul sau nu va fi afisat din respect pentru ceilalti VIP. Urmeaza ca masterii sa decida daca a fost intentionat sau doar o greseala. O lista completa a acestor cuvinte poate fi citita folosind in fereastra principala comanda: +rules" ) 
				user:SendPM( botname, user.sName..":  ai zis: "..msg.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" ) 
				SendPmToOps ( botname,user.sName.." a fost dat afara pentru cuvinte triviale sau reclama: "..msg )
				user:Ban()
				user:Disconnect() 
				if CCensor[user.sName] == nil then
					CCensor[user.sName] = {}
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				else
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				end
				return 1 
			end 
		end 
	else ---if it is a bad op in main master should know
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				user:SendPM( botname, user.sName.." a folosit cuvinte triviale sau a facut reclama: "..msg ) 
				if CCensor[user.sName] == nil then
					CCensor[user.sName] = {}
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				else
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				end
				return 1 
			end 
		end 
	end 
end
end
---rand 47
function ToArrival(user, data) 
if LevelHigh[user.iProfile] == 0 then
data=string.sub(data,1,string.len(data)-1) 
local s,e,msg = string.find(data, "%$(%b<>.+)")
	if (not user.bOperator) then -- simple bad user in main
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				user:SendPM( botname, user.sName..":  ai zis: "..msg.." si acest cuvant apare in lista interzisa de adrese internet sau cuvinte triviale. Trebuia sa citesti regulamentul mai intai. (comanda: +rules)" ) 
				SendPmToOps ( botname,user.sName.." a fost dat afara pentru cuvinte triviale sau reclama: "..msg)
				if CCensor[user.sName] == nil then
					CCensor[user.sName] = {}
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				else
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				end
				user:Ban()
				user:Disconnect() 
				return 1 
			end 
		end 
	else ---if it is a bad op in main master should know
		for key,a in trigs do 
			if(string.find( string.lower(msg), "[%s%.%,%-%_]" .. key .. "[%s%.%,%-%_%|]?")) then 
				SendPmToOps ( botname,user.sName.." a folosit din lista interzisa ceva in exprimarea: "..msg )
				if CCensor[user.sName] == nil then
					CCensor[user.sName] = {}
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				else
					CCensor[user.sName] = msg
					SaveToFile(CensorFile,CCensor , "Censor")
				end
				return 1 
			end 
		end 
	end
end
end 

-- Serialize by nErBoS extracted from Custom Intro/outro Script by madman I think, recomended by Mutor at that time
function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");
	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");
	sTab = sTab or "";
	sTmp = ""
	sTmp = sTmp..sTab..sTableName.." = {\n"
	for key, value in tTable do
		local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end
		sTmp = sTmp..",\n"
	end
	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	local handle = io.open(file,"w+")
	handle:write(Serialize(table, tablename))
	handle:flush()
	handle:close()
end

Ubikk

Glad to see a romanian programmer overhere too :)
I'm from Romania as well :P

James

Hey Paco

Your first Romanian Bot-Script is not good for Dc because you can spy the pms from other user .. and this is shit -(((

This for Paco and Ubikk in romanian language :

Salut...daca schimbi cuvintele cautate in litere si numere poti sa asculti toate PMs care contin aceste litere -(((
pentru intrebari sau idei sunt in fun1.no-ip.org  Owner El Diablo.

MfG
  James

Ubikk

@ James: PM-ul oricum poate fi spionat din casuta de dialog a hubului daca bifezi "Commands" (asta doar in cazul in care ai un hub pic si ai dexteritatea necesara sa urmaresti multitudinea de comenzi)
Nu fac asta in mod normal, insa am obs din greseala in timp ce ma uitam peste comenzile din hub :)

Paco

Dear James, I should have expect from your behalf realistic suggestions.
Come up with solutions, something intelligent.
Also you haven't told me if you tried it on and how did it worked.

And further more restrain yourself from trivial expressions that only bring shame on you.

SMF spam blocked by CleanTalk