loadPlants
exports["RiP-Weed"]:loadPlants(cb)
This function fetches the current farm's plants
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
cb | Function | Yes | Callback function |
Returned Table
Name | Type | Explenation |
---|---|---|
plants | Array | Farm's plants |
slots | Integer | Farm's plant slots |
level | Integer | Plant-upgrade level (0-4) |
Plants Table
Name | Type | Explenation |
---|---|---|
id | Integer | Plant (slot) id |
seed | String | Seed name |
seed_label | String | Seed label |
created | Integer | Timestamp of create |
watered | Integer | Timestamp of last watered |
finish | Integer | Calculated finish timestamp |
fertilized | Boolean | Is plant fertilized |
Example
exports["RiP-Weed"]:loadPlants(function(callback)
if callback then
for r,p in pairs(callback.plants) do
print(r, p.id)
end
end
end)