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 if action == "order" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "order", type = "order",
commandId = cmd.commandId,
itemName = cmd.itemName, itemName = cmd.itemName,
amount = cmd.amount, amount = cmd.amount,
dropperName = cmd.dropperName, dropperName = cmd.dropperName,
}) })
elseif action == "scan" then elseif action == "scan" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "scan", type = "scan",
commandId = cmd.commandId,
}) })
elseif action == "toggle_pause" then elseif action == "toggle_pause" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "toggle_pause", type = "toggle_pause",
commandId = cmd.commandId,
}) })
elseif action == "toggle_recipe" then elseif action == "toggle_recipe" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "toggle_recipe", type = "toggle_recipe",
recipe = cmd.recipe, commandId = cmd.commandId,
recipe = cmd.recipe,
}) })
elseif action == "enable_all" then elseif action == "enable_all" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "enable_all", type = "enable_all",
commandId = cmd.commandId,
}) })
elseif action == "disable_all" then elseif action == "disable_all" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "disable_all", type = "disable_all",
commandId = cmd.commandId,
}) })
elseif action == "sort_barrel" then elseif action == "sort_barrel" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "sort_barrel", type = "sort_barrel",
commandId = cmd.commandId,
barrelName = cmd.barrelName, barrelName = cmd.barrelName,
}) })
elseif action == "craft" then elseif action == "craft" then
modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, { modem.transmit(ORDER_CHANNEL, BROADCAST_CHANNEL, {
type = "craft", type = "craft",
commandId = cmd.commandId,
recipeIdx = cmd.recipeIdx, recipeIdx = cmd.recipeIdx,
}) })
else else