ATTENTION! The process of updating WiKi to version Eco 10.x has begun. Those wishing to participate can find out more Information on our ECO Contribution Wiki Discord. From April 26 to May 12, errors may occur in the Wiki, as we will be carrying out a major update to the information processing modules.
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 1:
Line 1:
== Documentation ==
This file is a Datafile that is used to Automate information throughout the Eco Wiki using various Modules.
{{Data file module}}
DO NOT Manually change Data as this is directly taken from the game.
The data file is currently used in at least the following modules:
If you would like to see more information generated on a Data page request it on the ECO Contribution Wiki Discord, https://discord.gg/ynCVtN5.
* [[Module:Infobox_Animal]]: see [[Template:Infobox Animal]] for more details.
* [[Module:Table Animals]]: see [[Template:Animals Table]] for more details.
* [[Module:Table Fish]]: see [[Template:Fish Table]] for more details.
== Usage ==
<syntaxhighlight lang="lua">
-- Load data only once per page. (Do no use require())
local AnimalData = mw.loadData("Module:AnimalData")
-- Assert that some data was received, otherwise throw an error.
assert(AnimalData.animals, "Failed to load data from Module:AnimalData!")
-- You may then use data from this module in your script. For example:
local agoutiData = AnimalData.animals["Agouti"]
-- Or to iterate over the table, you can do this:
for animalName, data in pairs(AnimalData.animals) do
-- animalName now contains the name of the animal in English.
-- data is the data table for that animal.
end
</syntaxhighlight>
<includeonly>[[Category:Eco data files]]</includeonly>