Module

WorldSwitch

From Dogcraft Wiki

Revision as of 22:53, 22 May 2022 by Domino (talk | contribs)

{{#invoke:WorldSwitch|subworld|Survial 4|Husky}} generates: husky

{{#invoke:WorldSwitch|world|Survial 4|Husky}} generates: survival


local p = {} --p stands for package

function p.subworld(frame)
	input = mw.ustring.lower(frame.args[1] .. frame.args[2])
	subworlds = {"husky", "beagle", "akita", "corgi", "labrador", "shepherd"}
	for key,value in ipairs(subworlds) do 
		if (mw.ustring.find(input, value, 1, true) ~= nil) then
			return value
		end
	end
	return 'not found'
end

function p.world(frame)
	input = mw.ustring.lower(frame.args[1] .. frame.args[2])
	worlds = {"survival", "survival 1", "survival 2", "survival 3", "survival 4", "survival 5", "creative", "patreon", "amplified", "mcmmo", "skyblock"}
	for key,value in ipairs(worlds) do 
		if (mw.ustring.find(input, value, 1, true) ~= nil) then
			return value
		end
	end
	return 'not found'
end

return p
This page was last modified on 22 May 2022, at 22:53. (3 months ago)
Background Valentine's Day Event 2024 by TheWhiteTigerNL