Module:Guidance

From the Audiovisual Identity Database, the motion graphics museum

Revision as of 04:27, 21 November 2022 by Pingu (talk | contribs)

Documentation for this module may be created at Module:Guidance/doc

local p = {} --p stands for package

rs = {}
rs[1] = "graphic violence or gore";
rs[2] = "[[:wikipedia:photosensitive epilepsy|flashing images]]";
rs[3] = "[[:wikipedia:jump scare|jump scares]]";
rs[4] = "sexual content";

rv    = {};
rv[1] = "flashing"
rv[2] = "graphic"
rv[3] = "jumpscare"
rv[4] = "sexual"
	
function p.reasons(frame)
	
	for i = 4,1,-1
	do
		if string.find(frame.args[1], rv[i]) then
			if ro == nil then
				ro = rs[i]
			elseif string.find(ro,", and") then
				ro = rs[i]..", "..ro
			else
				ro = rs[i]..", and "..ro
			end
		end
	end
	return ro
end

function p.warn1(frame)
	if string.find(frame.args[1], rv[1] or rv[3]) then
		rw1 = 1
	end
	return rw1
end

function p.warn2(frame)
	if string.find(frame.args[1], rv[2] or rv[4]) then
		rw2 = 1
	end
	return rw2
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.