fix: Improve message processing and command transmission in turtle system
This commit is contained in:
@@ -301,11 +301,18 @@ while true do
|
||||
stats.commandsSent = stats.commandsSent + 1
|
||||
addLog("CMD: " .. cmd.command .. " -> Turtle #" .. turtleID, colors.yellow)
|
||||
|
||||
modem.transmit(COMMAND_CHANNEL, CHANNEL_RECEIVE, {
|
||||
local commandPacket = {
|
||||
command = cmd.command,
|
||||
param = cmd.param,
|
||||
target = turtleID
|
||||
})
|
||||
}
|
||||
|
||||
modem.transmit(COMMAND_CHANNEL, CHANNEL_RECEIVE, commandPacket)
|
||||
|
||||
-- Debug: show what we're sending
|
||||
if not hasMonitor then
|
||||
print(" Sent to channel " .. COMMAND_CHANNEL .. ": target=" .. turtleID)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user