Modified Description Tag & BadWord in Description
 

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

Modified Description Tag & BadWord in Description

Started by Tw?sT?d-d?v, 07 May, 2005, 13:26:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tw?sT?d-d?v

--Modified Description Tag & BadWord in Description by (uk)jay 07/5/2005
--My First Attempt at a Script - based on Hawk's Description Tag and plop's wordreplacer
--Thx to jiten for help
--Sets Description Tag 

--Timer In Mins
Mins =  1
iTime = 10000 * Mins

function Main() 
	SetTimer(iTime)
	StartTimer() 
end 

sTables = { 
	tProfiles = {
		[0]  = "{Master}",	--// Set the Master Tag Here Eg.   ["Profile Number"] = "I AM A MASTER",
		[1] = "{Op}",		--// Set the Operator Tag Here
		[2] = "{Vip}",		--// Set the VIP Tag Here
		[3] = "{Reg}",		--// Set the Reg Tag Here
		[4] = "{Net Founder}",	--// Set the NetFounder Tag Here
		[5] = "{Moderator}",	--// Set the Moderator Tag Here
	},
	tBadWords = {
		["fuck"] = "",
		["bitch"] = "",
		["piss"] = "",
		["cunt"] = "",
		["bastard"] = "",
		["asshole"] = "",
		["shit"] = "",
                ["crap hub"] = "",
	},
}

function OnTimer()
	for tProfile,tDesc in sTables.tProfiles do
		for i,nick in frmHub:GetOnlineUsers(tProfile) do
			if (nick.sMyInfoString ~= nil) then
				local s,e,name,desc,speed,email,share = string.find(nick.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
				local desc = string.gsub(desc, "(%w+)", function(word) return CheckWord(word) end)
				SendToAll( "$MyINFO $ALL "..name.." "..sTables.tProfiles[tProfile].." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
			end
		end
	end
end

function CheckWord(word)
	local wordl = string.lower(word)
	if sTables.tBadWords[wordl] then
		return sTables.tBadWords[wordl]
	else
		return word
	end
end

jiten

Nice one (uk)jay ;)
Btw, there's something that should be changed:
--// Set the Master Tag Here Eg.   ["Description"] = "I AM A MASTER",

to:
--// Set the Master Tag Here Eg.   [Profile Number] = "I AM A MASTER",
Best regards,

jiten

Tw?sT?d-d?v

thx m8   above code edited    :))

Tw?sT?d-d?v

#3
here is version with unregged incase any1 wants it

--Modified Description Tag & BadWord in Description by (uk)jay 07/5/2005
--My First Attempt at a Script - based on Hawk's Description Tag and plop's wordreplacer
--Thx to jiten for help
--Sets Description Tag 

--Timer In Mins
Mins =  1
iTime = 10000 * Mins

function Main() 
	SetTimer(iTime)
	StartTimer() 
end 

sTables = { 
	tProfiles = { 
                     [-1] = "{User}",		--// Set the User Tag Here
		[0]  = "{Master}",	        --// Set the Master Tag Here Eg.   [Profile Number] = "I AM A MASTER",
		[1] = "{Op}",		        --// Set the Operator Tag Here
		[2] = "{Vip}",		        --// Set the VIP Tag Here
		[3] = "{Reg}",		        --// Set the Reg Tag Here
		[4] = "{Net Founder}",	        --// Set the NetFounder Tag Here
		[5] = "{Moderator}",	        --// Set the Moderator Tag Here
	},
	tBadWords = {
		["fuck"] = "",
		["bitch"] = "",
		["piss"] = "",
		["cunt"] = "",
		["bastard"] = "",
		["asshole"] = "",
		["shit"] = "",
                ["crap hub"] = "",
	},
}

function OnTimer()
	for tProfile,tDesc in sTables.tProfiles do
		for i,nick in frmHub:GetOnlineUsers(tProfile) do
			if (nick.sMyInfoString ~= nil) then
				local s,e,name,desc,speed,email,share = string.find(nick.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
				local desc = string.gsub(desc, "(%w+)", function(word) return CheckWord(word) end)
				SendToAll( "$MyINFO $ALL "..name.." "..sTables.tProfiles[tProfile].." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
			end
		end
	end
end

function CheckWord(word)
	local wordl = string.lower(word)
	if sTables.tBadWords[wordl] then
		return sTables.tBadWords[wordl]
	else
		return word
	end
end

Syphrone-NL

I used the script from above the one without the unregged and i get this error:

Syntax ...lad\0.3.3.0.b16.05.nt.dgb\scripts\descriptiontag.lua:38: attempt to call field `sMyInfoString' (a number value)

Does anybody know how i can fixed that
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

SMF spam blocked by CleanTalk