Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Gacha tabs: Difference between revisions

From Sekaipedia
Content deleted Content added
MathTurtle (talk | contribs)
No edit summary
MathTurtle (talk | contribs)
No edit summary
Line 11: Line 11:
local gachaName = args[1]
local gachaName = args[1]
local numTabs = args[2] -- int
local numTabs = tonumber(args[2])
if gachaName == nil or gachaName == '' then
if gachaName == nil or gachaName == '' then
Line 17: Line 17:
end
end
if numTabs == '0' then
if numTabs < 1 then
error('Number of tabs cannot be less than 1.')
error('Number of tabs cannot be less than 1.')
end
end

Revision as of 01:10, 13 July 2024

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

local getArgs = require('Module:Arguments').getArgs
local TabsBuilder = require('Module:TabsBuilder')

local p = {}

function p.main(frame)
	local args = getArgs(frame)

	local builder = TabsBuilder.new()
	
	local gachaName = args[1]
	
	local numTabs = tonumber(args[2])
	
	if gachaName == nil or gachaName == '' then
		error('Gacha name cannot be empty.')
	end
	
	if numTabs < 1 then
		error('Number of tabs cannot be less than 1.')
	end

	builder
		:addTab(gachaName, args[3])
		:addTab(gachaName .. ' - Reprint', args[4])
	
	return builder:tostring()
end

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