Editing Module:Infobox Plant

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 67: Line 67:
-- string used to build the infobox
-- string used to build the infobox
     local infobox = '{| class=\"infobox\"\n'
     local infobox = '{| class=\"infobox\"\n'
 
   
     -- name of the plant/tree
     -- name of the plant/tree
     infobox = infobox .. '|- style=\"color: white; background-color: #1165AF; text-align: center;\"\n| colspan=\"2\" | \'\'\'<big>' .. species .. '</big>\'\'\'\n'
     infobox = infobox .. '|- style=\"color: #333333; background-color: #1165AF; text-align: center;\"\n| colspan=\"2\" | \'\'\'<big>' .. species .. '</big>\'\'\'\n'
   
   
     -- the sub heading plant or tree
     -- the sub heading plant or tree
     infobox = infobox .. '|- style=\"text-align: center; color: white; background-color: '
     infobox = infobox .. '|- style=\"text-align: center; color: #333333; background-color: '
if check == 'plant' then
if check == 'plant' then
infobox = infobox .. 'seagreen;\"\n| colspan=\"2\" | \'\'\'Plant\'\'\'[[Category:Plants]]\n'
infobox = infobox .. 'seagreen;\"\n| colspan=\"2\" | \'\'\'Plant\'\'\'[[Category:Plants]]\n'
Line 82: Line 82:
local checkImage = {'_Plant.png','_Plant.jpg','_Plant.jpeg','_Tree.png','_Tree.jpg','_Tree.jpeg'}
local checkImage = {'_Plant.png','_Plant.jpg','_Plant.jpeg','_Tree.png','_Tree.jpg','_Tree.jpeg'}
local image = ''  
local image = ''  
local speciesEN = speciesTable.untranslated
local speciesimagename = string.gsub(species, ' ', '')
local speciesimagename = string.gsub(speciesEN, ' ', '')
for i,v in ipairs(checkImage) do  
for i,v in ipairs(checkImage) do  
Line 92: Line 91:
if table.getn(checkImage) == i then
if table.getn(checkImage) == i then
image = 'NoImage.png'  
image = 'NoImage.png'  
if check == 'plant' then  
if check == 'Plant' then  
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Plant.png|[[Category:Pages_with_missing_plant]]'
image = image .. '|64px|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Plant.png|[[Category:Pages_with_missing_plant]]'
end
end
if check == 'tree' then  
if check == 'Tree' then  
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Tree.png|[[Category:Pages_with_missing_tree]]'
image = image .. '|64px|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Tree.png|[[Category:Pages_with_missing_tree]]'
end
end
end
end
end
end
 
   
 
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|240px]]\n'
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|250x250px]]\n'
   
   
-- 'General' section header
-- 'General' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'General\'\'\'\n'
infobox = infobox .. '|- style=\"color: #7BC2CE; background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'General\'\'\'\n'
--Harvestable plant
--Harvestable plant
Line 111: Line 109:
-- speciesTable.seedDrop ~= nil or  
-- speciesTable.seedDrop ~= nil or  
speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then
speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Harvestable:\n| style=\"text-align: right; padding: 3px;\" | Yes \n'
infobox = infobox .. '|- valign=\"center\"\n| Harvestable:\n| style=\"text-align: right;\" | Yes \n'
end
end
--Underwater plant
--Underwater plant
if speciesTable.isWater ~= nil then
if speciesTable.isWater ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Underwater Plant:\n| style=\"text-align: right; padding: 3px;\" | Yes \n'
infobox = infobox .. '|- valign=\"center\"\n| Underwater Plant:\n| style=\"text-align: right;\" | Yes \n'
end
end
--Decorative Plant
--Decorative Plant
if speciesTable.isDecorative ~= nil then
if speciesTable.isDecorative ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Decorative Plant:\n| style=\"text-align: right; padding: 3px;\" | Yes \n'
infobox = infobox .. '|- valign=\"center\"\n| Decorative Plant:\n| style=\"text-align: right;\" | Yes \n'
end
end
--Plant Height
--Plant Height
if speciesTable.height ~= nil then
if speciesTable.height ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Plant Height:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.height .. ' m \n'
infobox = infobox .. '|- valign=\"center\"\n| Plant Height:\n| style=\"text-align: right;\" | ' .. speciesTable.height .. ' m \n'
end
end
Line 133: Line 131:
-- speciesTable.seedDrop ~= nil or  
-- speciesTable.seedDrop ~= nil or  
speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then
speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Agriculture\'\'\'\n'
infobox = infobox .. '|- style=\"color: #7BC2CE; background-color: #337AB7; text-align: center;\"\n| colspan=\"2\" | \'\'\'Agriculture\'\'\'\n'
-- 'Harvesting' sub section header
-- 'Harvesting' sub section header
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Harvesting\'\'\'\n'
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'Harvesting\'\'\n'
-- Harvested Tool  
-- Harvested Tool  
if speciesTable.harvestTool ~= nil then
if speciesTable.harvestTool ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Harvest Tool:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.harvestTool .. ' \n'
infobox = infobox .. '|- valign=\"center\"\n| Harvest Tool:\n| style=\"text-align: right;\" | ' .. speciesTable.harvestTool .. ' \n'
end
end
-- Harvested Seed
-- Harvested Seed
-- if speciesTable.seedDrop ~= nil and speciesTable.seedMax ~= '0.0' then
-- if speciesTable.seedDrop ~= nil and speciesTable.seedMax ~= '0.0' then
-- infobox = infobox .. '|- valign=\"center\"\n| Harvested Seed:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.seedDrop .. '\n'
-- infobox = infobox .. '|- valign=\"center\"\n| Harvested Seed:\n| style=\"text-align: right;\" | ' .. speciesTable.seedDrop .. '\n'
-- end
-- end
-- Harvested Item
-- Harvested Item
if speciesTable.resourceItem ~= nil then
if speciesTable.resourceItem ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Harvested Item:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.resourceItem .. '\n'
infobox = infobox .. '|- valign=\"center\"\n| Harvested Item:\n| style=\"text-align: right;\" | ' .. speciesTable.resourceItem .. '\n'
end
end
--Plant Calorie Value
--Plant Calorie Value
if speciesTable.calorieValue ~= nil then
if speciesTable.calorieValue ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Plant Calorie Value:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.calorieValue .. ' \n'
infobox = infobox .. '|- valign=\"center\"\n| Plant Calorie Value:\n| style=\"text-align: right;\" |' .. speciesTable.calorieValue .. ' \n'
end
end
--XP Per Harvest
--Experience Per Harvest
if speciesTable.experiencePerHarvest ~= nil then
if speciesTable.experiencePerHarvest ~= nil then
infobox = infobox .. '|- valign=\"center\"\n| Base XP Per Harvest:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.experiencePerHarvest .. ' \n'
infobox = infobox .. '|- valign=\"center\"\n| Base Experience Per Harvest:\n| style=\"text-align: right;\" |' .. speciesTable.experiencePerHarvest .. ' \n'
end
end
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Ideal Conditions\'\'\'\n'
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'Ideal Conditions\'\'\n'
-- Ideal Growth Rate
-- Ideal Growth Rate
if speciesTable.idealGrowthRate ~= nil then
if speciesTable.idealGrowthRate ~= nil then
speciesTable.idealGrowthRate = speciesTable.idealGrowthRate*100
infobox = infobox .. '|- valign=\"center\"\n| Ideal Growth Rate:\n| style=\"text-align: right;\" |' .. speciesTable.idealGrowthRate .. ' \n'
infobox = infobox .. '|- valign=\"center\"\n| Ideal Growth Rate:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.idealGrowthRate .. ' % \n'
end
end


-- Ideal Death Rate
-- Ideal Death Rate
if speciesTable.idealDeathRate ~= nil then
if speciesTable.idealDeathRate ~= nil then
speciesTable.idealDeathRate = speciesTable.idealDeathRate*100
infobox = infobox .. '|- valign=\"center\"\n| Ideal Death Rate:\n| style=\"text-align: right;\" |' .. speciesTable.idealDeathRate .. ' \n'
infobox = infobox .. '|- valign=\"center\"\n| Ideal Death Rate:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.idealDeathRate .. ' % \n'
end
end


-- Ideal Temp
-- Ideal Temp
if speciesTable.idealTempMin ~= nil then
if speciesTable.idealTempMin ~= nil then
speciesTable.idealTempMin = speciesTable.idealTempMin*40-10
infobox = infobox .. '|- valign=\"center\"\n| Ideal Temperature Range:\n| style=\"text-align: right;\" | ' .. speciesTable.idealTempMin .. ' -  ' .. speciesTable.idealTempMax .. '\n'
            speciesTable.idealTempMax = speciesTable.idealTempMax*40-10
infobox = infobox .. '|- valign=\"center\"\n| Ideal Temperature Range:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.idealTempMin .. ' -  ' .. speciesTable.idealTempMax .. ' Celsius \n'
end
end
-- Ideal Moisture
-- Ideal Moisture
if speciesTable.idealMoistureMin ~= nil then
if speciesTable.idealMoistureMin ~= nil then
speciesTable.idealMoistureMin = speciesTable.idealMoistureMin*100
infobox = infobox .. '|- valign=\"center\"\n| Ideal Moisture Range:\n| style=\"text-align: right;\" | ' .. speciesTable.idealMoistureMin .. ' -  ' .. speciesTable.idealMoistureMax .. '\n'
speciesTable.idealMoistureMax = speciesTable.idealMoistureMax*100
infobox = infobox .. '|- valign=\"center\"\n| Ideal Moisture Range:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.idealMoistureMin .. ' -  ' .. speciesTable.idealMoistureMax .. '\n'
end
end


-- Max Pollution Density
-- Max Pollution Density
if speciesTable.maxPollutionDensity ~= nil then
if speciesTable.maxPollutionDensity ~= nil then
speciesTable.maxPollutionDensity = speciesTable.maxPollutionDensity*100
infobox = infobox .. '|- valign=\"center\"\n|Max Pollution Density:\n| style=\"text-align: right;\" |' .. speciesTable.maxPollutionDensity .. ' ppm \n'
infobox = infobox .. '|- valign=\"center\"\n|Max Ground Pollution:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.maxPollutionDensity .. ' %\n'
end
end


-- Pollution Tolerance
-- Pollution Tolerance
if speciesTable.pollutionTolerance ~= nil then
if speciesTable.pollutionTolerance ~= nil then
speciesTable.pollutionTolerance = speciesTable.pollutionTolerance*100
infobox = infobox .. '|- valign=\"center\"\n| Pollution Tolerance:\n| style=\"text-align: right;\" |' .. speciesTable.pollutionTolerance .. ' ppm \n'
infobox = infobox .. '|- valign=\"center\"\n| Pollution Tolerance:\n| style=\"text-align: right; padding: 3px;\" |' .. speciesTable.pollutionTolerance .. ' %\n'
end
end


Line 207: Line 197:
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Minimum Soil Nutrients\'\'\'\n'
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Minimum Soil Nutrients\'\'\'\n'
if speciesTable.nitrogenHalfSpeed ~= nil then
if speciesTable.nitrogenHalfSpeed ~= nil then
infobox = infobox .. '|- style=\"color: red; valign: center;\"\n| Nitrogen:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.nitrogenHalfSpeed .. '\n'
infobox = infobox .. '|- style=\"color: red; valign: center;\"\n| Nitrogen:\n| style=\"text-align: right;\" | ' .. speciesTable.nitrogenHalfSpeed .. '\n'
end
end
if speciesTable.phosphorusHalfSpeed ~= nil then
if speciesTable.phosphorusHalfSpeed ~= nil then
infobox = infobox .. '|- style=\"color: darkorange; valign: center;\"\n| Phosphorous:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.phosphorusHalfSpeed .. '\n'
infobox = infobox .. '|- style=\"color: darkorange; valign: center;\"\n| Phosphorous:\n| style=\"text-align: right;\" | ' .. speciesTable.phosphorusHalfSpeed .. '\n'
end
end
if speciesTable.potassiumHalfSpeed ~= nil then
if speciesTable.potassiumHalfSpeed ~= nil then
infobox = infobox .. '|- style=\"color: green; valign: center;\"\n| Potassium:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.potassiumHalfSpeed .. '\n'
infobox = infobox .. '|- style=\"color: limegreen; valign: center;\"\n| Potassium:\n| style=\"text-align: right;\" | ' .. speciesTable.potassiumHalfSpeed .. '\n'
end
end
if speciesTable.soilMoistureHalfSpeed ~= nil then
if speciesTable.soilMoistureHalfSpeed ~= nil then
speciesTable.soilMoistureHalfSpeed = speciesTable.soilMoistureHalfSpeed*100
infobox = infobox .. '|- style=\"color: dodgerblue; valign: center;\"\n| Soil Moisture:\n| style=\"text-align: right;\" | ' .. speciesTable.soilMoistureHalfSpeed .. '\n'
infobox = infobox .. '|- style=\"color: dodgerblue; valign: center;\"\n| Soil Moisture:\n| style=\"text-align: right; padding: 3px;\" | ' .. speciesTable.soilMoistureHalfSpeed .. ' ppm \n'
end
end
end
end
end
end
-- 'Effects on Environment' section header
-- 'Other' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Effects on Environment\'\'\'\n'
infobox = infobox .. '|- style=\"background-color: #337AB7; text-align: center;\"\n| colspan=\"2\" | \'\'\'Effects on Environment\'\'\'\n'
--Carbon release
--Carbon release
     if speciesTable.carbonRelease ~= nil then
     if speciesTable.carbonRelease ~= nil then
         local absoluteCarbon = string.sub(speciesTable.carbonRelease , 2)
         local absoluteCarbon = string.sub(speciesTable.carbonRelease , 2)
         infobox = infobox .. '|- valign=\"center\"\n| Carbon Absorbed:\n| style=\"text-align: right; padding: 3px;\" | ' .. absoluteCarbon .. ' ppm \n'
         infobox = infobox .. '|- valign=\"center\"\n| Carbon Absorbed:\n| style=\"text-align: right;\" | ' .. absoluteCarbon .. ' ppm \n'
     end
     end


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: