更多操作
无编辑摘要 |
无编辑摘要 标签:已被回退 |
||
第23行: | 第23行: | ||
local t = p.exec() | local t = p.exec() | ||
-- local args = getArgs(frame) | -- local args = getArgs(frame) | ||
return ' | return '{{Quote' | ||
..t[1] | ..'|content='..t[1] | ||
..' | ..'|author='..t[2] | ||
..'}}' | |||
..' | |||
end | end | ||
return p | return p |
2025年4月1日 (二) 16:40的版本
此模块的文档可以在模块:GetMottos/doc创建
local getArgs = require('Module:Arguments').getArgs
local mottos = require('Module:GlobalVars').mottos
local stringUtil = require('Module:StringUtil')
local rand = require('Module:RandomUtil').random
local function randnum(min,max)
local frame = {
args = {}
}
frame.args[1] = min
frame.args[2] = max
return rand(frame)
end
local p = {}
function p.exec()
local index = randnum(1, #mottos)
return stringUtil.split(mottos[index], '@')
end
function p.getMottos(frame)
local t = p.exec()
-- local args = getArgs(frame)
return '{{Quote'
..'|content='..t[1]
..'|author='..t[2]
..'}}'
end
return p