Module:Main

--Lua coding local p = {} local getArgs = require('Dev:Arguments').getArgs p.disamb = { ["Battery"] = true, ["Concrete"] = true, ["Personal roboport"] = true, ["Night vision"] = true, ["Portable solar panel"] = true, ["Portable fusion reactor"] = true, ["Personal laser defense"] = true, ["Discharge defense"] = true, ["Speed module"] = true, ["Productivity module"] = true, ["Efficiency module"] = true, ["Rocket silo"] = true, ["Explosives"] = true } function p.trim(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end --function p.letter(s) -- local x = s:lower(s) -- local r = (s:upper(s:sub(s,"1"))) --    return r --end function p.divide(s1, s2) local r = {} local i = 0 for x in string.gmatch(s1, "[^;]+") do       i=i+1 r[i]=p.trim(x) if p.disamb[r[i]] then r[i]=r[i]..s2 end end return r end function p.techTable(frame) local result = "" local title = "" local args = getArgs(frame) for x in string.gmatch(args[1], "[^;]+") do       x=p.trim(x) if p.disamb[x] then x=x.." (technology)" end result=result.."\" y=string.match(x, "%s%d+") if (y~=nil) then result=result.." \[\["..x.."|"..p.trim(y).."\]\]<\/div>" end result=result.."<\/span>" end return result end

function p.itDetail(par1, par2) local result = "" local x = par1 local i = par2 result = result.." "..x..":  "..i.."  " return result end

function p.itemDetails(frame) local title, value, result = "", "", " " return result end function p.itIcon(par1, par2) local result = "" local x = par1 local i = par2 if p.disamb[x] then x=x.." (item)" end result = result.."" if i~=nil then result = result.." "..i.." " end result = result.." " return result end function p.itemRecipe(frame) local item, quantity, result = "", "", "" for x in string.gmatch(frame.args[1], "[^\+]+") do       y=x:find(",") if y==nil then quantity="1" item=p.trim(x) else quantity=x:sub(y+1) item=x:sub(1, (y-1)) end result=result..p.itIcon(item, quantity) end return result end function p.basicTable(frame) local result = "" local title = "" local args = getArgs(frame) for x in string.gmatch(args[1], "[^;]+") do      -- x=p.letter(x) x=p.trim(x) result=result.."\" y=string.match(x, "%s%d+") if (y~=nil) then result=result.." \[\["..x.."|"..p.trim(y).."\]\]<\/div>" end result=result.."<\/span>" end return result end function p.menuTable(frame) local result = "" local title = "" local args = getArgs(frame) for x in string.gmatch(args[1], "[^;]+") do      -- x=p.letter(x) x=p.trim(x) result=result.."\" y=string.match(x, "%s%d+") if (y~=nil) then result=result.." \[\["..x.."|"..p.trim(y).."\]\]<\/div>" end result=result.."<\/span>" end return result end return p