Module:Sandbox/User:Teamtoto/LuaModule: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 6: Line 6:
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
if frame.args ~= nil and frame.args ~= '' then
if frame.args ~= nil and frame.args ~= '' then
-- argument in template call has to be named so the equal sign doesn't break input
-- argument in template call has to be named so the equal sign doesn't
-- break input
if frame.args["code"]~= nil and frame.args["code"] ~= '' then
if frame.args["code"]~= nil and frame.args["code"] ~= '' then
return p.a(mw.text.trim(frame:preprocess(frame.args[1])))
return p.a(mw.text.trim(frame:preprocess(frame.args["code"])))
else
else
     error "There was no code in your input!"
     error "There was no code in your input!"
Line 28: Line 29:
local bonus_int = {}
local bonus_int = {}
local exts = {}
local exts = {}
local bonus = {
["Strength"] = "",
["Intelligence"] = "",
["Toughness"] = "",
["Willpower"] = "",
["Ego"] = "",
["Agility"] = ""
}
if genotype == "True Kin" then
if genotype == "True Kin" then
Line 54: Line 63:
mw.logObject(stats)
mw.logObject(stats)
local bonus = {
 
["Strength"] = "",
["Intelligence"] = "",
["Toughness"] = "",
["Willpower"] = "",
["Ego"] = "",
["Agility"] = ""
}
for name, num in pairs(bonus_int) do
for name, num in pairs(bonus_int) do
if num > 0 then
if num > 0 then