feat: Enhance status broadcasting in turtle; include additional logging for better visibility

This commit is contained in:
MayaTheShy
2026-02-20 00:55:56 -05:00
parent 5b23ab1a14
commit 922e6ab25d

View File

@@ -424,6 +424,10 @@ function broadcastStatus()
print("Broadcasting with NO POSITION (waiting for GPS)") print("Broadcasting with NO POSITION (waiting for GPS)")
end end
print("📡 Broadcasting status on channel " .. STATUS_CHANNEL)
print(" Turtle ID: " .. os.getComputerID())
print(" Mode: " .. state.mode)
-- Scan surrounding blocks for map visualization -- Scan surrounding blocks for map visualization
local surroundings = {} local surroundings = {}
local hasBlock, data local hasBlock, data
@@ -446,7 +450,7 @@ function broadcastStatus()
surroundings.down = {name = data.name, metadata = data.metadata or 0} surroundings.down = {name = data.name, metadata = data.metadata or 0}
end end
modem.transmit(STATUS_CHANNEL, CHANNEL_RECEIVE, { local statusPacket = {
type = "status", type = "status",
turtleID = os.getComputerID(), turtleID = os.getComputerID(),
mode = state.mode, mode = state.mode,
@@ -457,7 +461,11 @@ function broadcastStatus()
inventory = state.inventory, inventory = state.inventory,
facing = facing, facing = facing,
surroundings = surroundings surroundings = surroundings
}) }
print(" Packet type: " .. statusPacket.type)
modem.transmit(STATUS_CHANNEL, CHANNEL_RECEIVE, statusPacket)
print(" ✅ Status broadcast complete")
end end
-- Return to home step (non-blocking) -- Return to home step (non-blocking)