diff --git a/webbridge.lua b/webbridge.lua index e6fb363..24a2431 100644 --- a/webbridge.lua +++ b/webbridge.lua @@ -305,7 +305,7 @@ for i = 0, 65535 do end -- Start polling timer -local POLL_INTERVAL = 2 -- Poll every 2 seconds (reduced frequency for better reliability) +local POLL_INTERVAL = 1 -- Poll every 1 second for responsive command execution os.startTimer(POLL_INTERVAL) -- Track which turtles we've sent commands to recently @@ -360,15 +360,15 @@ while true do addLog(" CMD: " .. cmd.command .. " -> T#" .. turtleID, colors.yellow) end - -- Send command multiple times for reliability - for i = 1, 3 do + -- Send command twice for reliability + for i = 1, 2 do modem.transmit(COMMAND_CHANNEL, CHANNEL_RECEIVE, commandPacket) os.sleep(0.05) end end -- Acknowledge that we sent the commands - os.sleep(1.5) + os.sleep(0.3) if acknowledgeCommands(turtleID) then addLog(" ACK: Commands acknowledged", colors.lime) else