Add commandId to transmitted messages for improved command tracking

This commit is contained in:
MayaTheShy
2026-03-22 02:12:04 -04:00
parent 0f9b7fcf68
commit ebc3efba6a

View File

@@ -128,39 +128,47 @@ local function processCommand(cmd)
if action == "order" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "order",
commandId = cmd.commandId,
itemName = cmd.itemName,
amount = cmd.amount,
dropperName = cmd.dropperName,
})
elseif action == "scan" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "scan",
type = "scan",
commandId = cmd.commandId,
})
elseif action == "toggle_pause" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "toggle_pause",
type = "toggle_pause",
commandId = cmd.commandId,
})
elseif action == "toggle_recipe" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "toggle_recipe",
recipe = cmd.recipe,
type = "toggle_recipe",
commandId = cmd.commandId,
recipe = cmd.recipe,
})
elseif action == "enable_all" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "enable_all",
type = "enable_all",
commandId = cmd.commandId,
})
elseif action == "disable_all" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "disable_all",
type = "disable_all",
commandId = cmd.commandId,
})
elseif action == "sort_barrel" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "sort_barrel",
commandId = cmd.commandId,
barrelName = cmd.barrelName,
})
elseif action == "craft" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "craft",
commandId = cmd.commandId,
recipeIdx = cmd.recipeIdx,
})
else