Update 'Controller/CropController.lua'

This commit is contained in:
manuel 2023-01-13 19:17:11 +00:00
parent da932012e0
commit 74cea2d6da

View File

@ -1,4 +1,5 @@
CropController = {}
CropController.interval = 900
function CropController:new(t)
t = t or {}
@ -143,4 +144,16 @@ end
function CropController:setSlaveID(id)
self.slaveID = id
end
function CropController:harvest()
self:doAction(self.slaveID, "harvest")
local s, duration = self:doAction(self.slaveID, "getLastHarvestDuration")
if s == true then
self.lastHarvestDuration = duration
end
local s, yield = self:doAction(self.slaveID, "getLastYield")
if s == true then
self.lastYield = yield
end
end