Update scan interval and remove redundant cache refresh logic in main loop
This commit is contained in:
@@ -5,7 +5,7 @@ local DROPPER_NAME = "minecraft:dropper_9"
|
|||||||
local BARREL_NAME = "minecraft:barrel_0"
|
local BARREL_NAME = "minecraft:barrel_0"
|
||||||
local POLL_INTERVAL = 2 -- seconds between barrel checks
|
local POLL_INTERVAL = 2 -- seconds between barrel checks
|
||||||
local MONITOR_SIDE = "left"
|
local MONITOR_SIDE = "left"
|
||||||
local SCAN_INTERVAL = 3 -- seconds between background scans
|
local SCAN_INTERVAL = 120 -- seconds between full background scans
|
||||||
local SMELT_INTERVAL = 3 -- seconds between furnace checks
|
local SMELT_INTERVAL = 3 -- seconds between furnace checks
|
||||||
local SMELT_RESERVE = 64 -- keep at least 1 stack of each raw material
|
local SMELT_RESERVE = 64 -- keep at least 1 stack of each raw material
|
||||||
local CACHE_FILE = ".inventory_cache" -- persistent cache file
|
local CACHE_FILE = ".inventory_cache" -- persistent cache file
|
||||||
@@ -1810,12 +1810,6 @@ local function main()
|
|||||||
pcall(refreshFurnaceStatus)
|
pcall(refreshFurnaceStatus)
|
||||||
needsRedraw = true
|
needsRedraw = true
|
||||||
smelterNeedsRedraw = true
|
smelterNeedsRedraw = true
|
||||||
-- If work was done, scan sooner to update cache
|
|
||||||
if ok and didWork then
|
|
||||||
pcall(refreshCache)
|
|
||||||
needsRedraw = true
|
|
||||||
smelterNeedsRedraw = true
|
|
||||||
end
|
|
||||||
sleep(SMELT_INTERVAL)
|
sleep(SMELT_INTERVAL)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user