Editing Module:FoodDetails

From Eco - English Wiki

Your changes will be displayed to readers once an authorized user accepts them. (help)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 5: Line 5:
-- import the required modules
-- import the required modules
local itemData = mw.loadData( "Module:ItemData" )
local itemData = require( "Module:ItemData" )
local recipeData = mw.loadData( "Module:CraftingRecipes" )
local recipeData = require( "Module:CraftingRecipes" )
local plantData = mw.loadData( "Module:PlantData" )
local plantData = require( "Module:PlantData" )
-- assign modules for use
-- assign modules for use
Line 29: Line 29:
header = header .. "<th>Skill Needed</th> \n "
header = header .. "<th>Skill Needed</th> \n "
header = header .. "<th>Skill Level</th> \n "
header = header .. "<th>Skill Level</th> \n "
header = header .. "<th data-sort-type=\"number\">Base Crafting Time(Min)</th> \n "
header = header .. "<th data-sort-type=\"number\">Minutes Crafting</th> \n "
header = header .. "</tr> \n "
header = header .. "</tr> \n "
Line 59: Line 59:
local baseCraftTime = ''
local baseCraftTime = ''
local baseLaborCost = ''
local baseLaborCost = ''
local baseXPGain = ''
local recipe = ''
local recipe = ''
local plant = ''
local plant = ''
if recipes[item] ~= nil then
if recipes[item] ~= nil then
recipe = recipes[item]  -- implies food item is created via a recipe with the item's name
recipe = recipes[item]  -- implies food item is created via a recipe with the item's name
-- else
else
-- for key,val in pairs(recipes) do
for key,val in pairs(recipes) do
-- for numx =  1, #val.variants[item].products and val.variants ~= '' do
for numx =  1, #val.variants[item].products do
-- if val.variants[item].products[numx][1] == item then
if val.variants[item].products[numx][1] == item then
-- recipe = val  -- implies food item is created via a differently named recipe (issue: selects the first found recipe)
recipe = val  -- implies food item is created via a differently named recipe (issue: selects the first found recipe)
-- end
end
-- end
end
-- end
end
end
end
if recipe ~= '' then
if recipe ~= '' then
created = recipe.craftStn[1][1]
created = recipe.craftStn[1]
if recipe.skillNeeds[1] == nil then
if recipe.skillNeeds[1] == nil then
skill = "none"  -- implies a basic recipe like Campfire Beans
skill = "none"  -- implies a basic recipe like Campfire Beans
Please note that all contributions to Eco - English Wiki are considered to be released under the CC BY-NC-SA 4.0 (see Eco:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)

Template used on this page: