Auto Craft Loader


自动从LinkedChestAndPipe共享区填充组装机原材料,并将产出返回共享区

Tweaks
9 days ago
2.0
20
Logistics Manufacturing Storage

g Bug in 0.1.1: attempt to call global 'scan_all_crafting_machines' (a nil value)

9 days ago

Hi! There is a Lua error when configuration changes in version 0.1.1.
Error traceback:
Error while running event AutoCraftLoader::on_configuration_changed AutoCraftLoader/control.lua:65: attempt to call global 'scan_all_crafting_machines' (a nil value) stack traceback: AutoCraftLoader/control.lua:65: in function <AutoCraftLoader/control.lua:59>

Why it happens:
In control.lua, the local function scan_all_crafting_machines (line 223) is called inside on_configuration_changed (line 65) before it has been declared. In Lua, local functions must be defined or forward-declared before they are used.
How to fix:
You can add a forward declaration at the top of control.lua (e.g., around line 24):

local scan_all_crafting_machines

New response