Skip to main content

loadPlants

exports["RiP-Weed"]:loadPlants(cb) 

This function fetches the current farm's plants

Arguments

NameTypeOptionalExplenation
cbFunctionYesCallback function

Returned Table

NameTypeExplenation
plantsArrayFarm's plants
slotsIntegerFarm's plant slots
levelIntegerPlant-upgrade level (0-4)

Plants Table

NameTypeExplenation
idIntegerPlant (slot) id
seedStringSeed name
seed_labelStringSeed label
createdIntegerTimestamp of create
wateredIntegerTimestamp of last watered
finishIntegerCalculated finish timestamp
fertilizedBooleanIs 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)