Quick (and I believe correct) patch :
--- a/control.lua
+++ "b/MaintenanceMadness_0.9.3\control.lua"
@@ -1031,12 +1031,14 @@ function(event)
for , element in ipairs(global.eventScheduleMRO[event.tick].elements) do
--game.print(.." ,"..element.id.." ,"..element.age)
local entityData = global.monitoredEntities[element.id]
- --log(serpent.block(element, {maxlevel= 2}))
- --log(serpent.block(entityData, {maxlevel= 3}))
+ -- log(serpent.block(element, {maxlevel= 2}))
+ -- log(serpent.block(entityData, {maxlevel= 3}))
if entityData ~= nil and entityData.entity and entityData.entity.valid then
local realEntity = entityData.entity
local entityName = entityData.surrogatedEntityName or realEntity.name
local status = entityData.status
+ -- log(serpent.block(realEntity.name, {maxlevel= 2}))
+ -- log(serpent.block(realEntity.type, {maxlevel= 2}))
if not global.entitiesWithMROenabled[entityName].active then
-- Stop maintenance for this entity
stopMaintenanceCycle(element.id)
@@ -1044,7 +1046,7 @@ function(event)
end
-- Handle idle crafting machines. At first, check if this machine is operating. Then check, if this is a crafting machine
- if status == "operating" and entityData.producedItems ~= nil then
- if status == "operating" and entityData.type == "crafting-machine" then
-- Check if this machine has finished at least one product since the last maintenance event.
log("ID: "..tostring(element.id).." | Age: "..tostring(element.age))
log("Produced items: "..tostring(realEntity.products_finished).." | Machine inactive: "..tostring(entityData.producedItems >= realEntity.products_finished))