Module:Param Parse: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 448:
 
-- Requirements
function parse.requirements_func(valueinput_string)
local icon_map = {
scout = '[[File:Scout_icon.png|link=Scout|width=18x18]]',
Line 456:
}
 
local partsfields = {}
for partfield in valueinput_string:gmatch("%w([^,]+)") do
table.insert(partsfields, partfield)
end
 
local professionresult = {parts[1], parts[2]}
local knowledge = {parts[3], parts[4]}
local quest = {parts[5], parts[6]}
local min_weapon_strength = {parts[7], parts[8]}
 
for i = 1, #fields, 2 do
return string.format(
"%slocal %s,key %s= %s, %s %s, %s %s",fields[i]
icon_map[professionlocal value = fields[i+1]], profession[2],
icon_map[knowledge[1]], knowledge[2],
icon_map[quest[1]],if quest[2],not value then
-- Do nothing
icon_map[min_weapon_strength[1]], min_weapon_strength[2]
) else
local icon = icon_map[key]
if type(value) == "number" then
table.insert(result, string.format("%s %d", icon, math.floor(value)))
else
table.insert(result, string.format("%s %s", icon, value))
end
end
end
 
return table.concat(result, ", ")
end
 
131

edits