From b91e45fc178b96ce7f094676c0e8d011518ce727 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 10:01:02 -0400 Subject: [PATCH] v1.3.2: re-sync timers from far-end arrivals and departures Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WyQKCL92ZLwPi9qmYQtNdc --- CHANGELOG.md | 6 ++++++ OctoBus.lua | 27 +++++++++++++++++++++++---- OctoBus.toc | 2 +- README.md | 1 + 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f56ab7..9dff7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.3.2 (12 October 2026) + +### New +- **Timers re-sync at the far end too.** Seeing a transport arrive at, or leave, Undercity, Grom'gol, Kargath, Thunder Bluff, Revantusk or Booty Bay now re-syncs that route, just like at Orgrimmar, Sparkwater and Ratchet. The row tooltip says where it was synced ("Synced at Undercity this session"). +- The stay at the far end is now learned whenever you see a transport both arrive and leave there. + ## 1.3.1 (10 October 2026) ### Changed diff --git a/OctoBus.lua b/OctoBus.lua index e7e002c..53e8589 100644 --- a/OctoBus.lua +++ b/OctoBus.lua @@ -241,7 +241,8 @@ local OB_OK, OB_ERR = pcall(function () return AtHome(r) or AtAway(r) or AtPlan(r) or seenState[r.entry] ~= nil end - -- confirmed[entry] = true once the transport has been SEEN docking/leaving this session + -- confirmed[entry] = true once the transport has been SEEN docking/leaving at its home end + -- this session, or "far" when it was synced from a sighting at the far end local confirmed = {} ------------------------------------------------------------------------ @@ -557,9 +558,17 @@ local OB_OK, OB_ERR = pcall(function () arr = h[1] end w.arr = arr + w.approached = approached local P = Period(r) + -- Re-sync from the far end: the transport docks here farOff seconds after its + -- home arrival, so its schedule is arrival - farOff. Only when the home end was + -- not seen this session (a home sighting is more direct and wins). + if approached and confirmed[e] ~= true and FarKnown(r) and P and P > 0 then + DB.anchor[e] = arr - FarOff(r, P) + confirmed[e] = "far" + end -- only when it was seen coming in (not already docked when it came into view) - if approached and confirmed[e] and P and P > 0 then + if approached and confirmed[e] == true and P and P > 0 then local off = math.mod(arr - Anchor(r), P) if off < 0 then off = off + P end local old = DB.farOff[e] @@ -574,12 +583,21 @@ local OB_OK, OB_ERR = pcall(function () local dx, dy = x - w.sx, y - w.sy if math.sqrt(dx * dx + dy * dy) <= DOCK_RADIUS then return end -- still easing out local d = now - w.arr - if w.learn and d > 20 and d < 150 then + -- the stay only needs this end's own arrival and departure, so it is learned + -- whenever both were seen, wherever the schedule came from + if w.approached and d > 20 and d < 150 then local old = DB.farDwell[e] DB.farDwell[e] = old and (old * 0.6 + d * 0.4) or d end + -- never saw it dock here, but saw it leave: schedule = departure - stay - farOff + local P = Period(r) + if not w.approached and confirmed[e] ~= true and FarKnown(r) and P and P > 0 then + DB.anchor[e] = now - FarDwell(r) - FarOff(r, P) + confirmed[e] = "far" + end w.arr = nil w.learn = nil + w.approached = nil end w.sx, w.sy, w.st = x, y, now end @@ -932,7 +950,8 @@ local OB_OK, OB_ERR = pcall(function () end GameTooltip:AddLine("Click: " .. (Watched(r) and "remove the bell (no chat alert)" or "add a bell: chat message " .. CFG.alert .. "s before you need to fly"), 0.2, 1, 0.8) else - GameTooltip:AddLine(confirmed[r.entry] and "Seen this session: exact." or "Not seen this session: estimate (~).", 0.7, 0.7, 0.7) + GameTooltip:AddLine(confirmed[r.entry] == true and "Seen this session: exact." + or (confirmed[r.entry] == "far" and ("Synced at " .. Away(r) .. " this session.") or "Not seen this session: estimate (~)."), 0.7, 0.7, 0.7) GameTooltip:AddLine("Click: " .. (Watched(r) and "remove the bell (no chat alert)" or "add a bell: chat message " .. CFG.alert .. "s before it arrives"), 0.2, 1, 0.8) end if r.flipFrom then diff --git a/OctoBus.toc b/OctoBus.toc index 5f994d9..6d799e7 100644 --- a/OctoBus.toc +++ b/OctoBus.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccOcto|rBus ## Notes: Zeppelin and boat arrival timers for Orgrimmar. Reads live positions from ZepSense.dll; minimap icon toggles the window. ## Author: Phridgey -## Version: 1.3.1 +## Version: 1.3.2 ## SavedVariables: OctoBusDB OctoBus.lua diff --git a/README.md b/README.md index b047ecc..c7eb24a 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ Each route runs on a fixed cycle. Once the addon sees one transport arrive, it c - **`/ob calibrate`** (optional): watches every transport on purpose. Stand between the two towers where you can see the docks, do not `/reload`, and wait; rows are marked complete as each route is confirmed. A transport being out of view for a while is normal. If nothing at all has been seen after about 10 minutes, move closer to the towers. `/ob calibrate stop` cancels. - Transports are not reported from deep inside the city (bank / auction house area), so calibrate near the towers. - **Far ends are learned by riding.** When a transport stands still for 20 s away from its home dock, it is docked at the far end: the addon stores when it docked there (relative to its schedule) and how long it stayed. This needs the home end to have been seen earlier in the same session (for example, it leaving Orgrimmar with you on board), and the transport to be seen arriving. No recording is needed. +- **Both ends keep the timers in sync.** Seeing a transport arrive at, or leave, either end of its route re-syncs that route. At the far end this uses the measured far-end timing; if the home end was already seen in the same session, a far-end arrival sharpens the far-end timing instead. - **One odd sighting does not wipe a route's history.** A sighting that does not fit the schedule is set aside; the schedule only starts over (for example after a server restart) when a second sighting agrees with it. ### The Ratchet boat