From 5bee808492ccda26485c0a04097d90b4a35d40a4 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 22 Sep 2026 17:13:19 -0400 Subject: [PATCH] Prefer stationary social pairs and deliver roster before individual snapshots --- ale/azerothai_bridge.lua | 8 +++++--- docs/bot-conversations.md | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ale/azerothai_bridge.lua b/ale/azerothai_bridge.lua index d3789da..9f6062d 100644 --- a/ale/azerothai_bridge.lua +++ b/ale/azerothai_bridge.lua @@ -196,7 +196,6 @@ function AzerothAIEmitSnapshots() local guids={} for _,player in pairs(players) do if is_playerbot(player) then - emit("player.snapshot",player_payload(player)) guids[#guids+1]=player:GetGUIDLow() emitted=emitted+1 end @@ -207,9 +206,9 @@ function AzerothAIEmitSnapshots() for _,p in pairs(players) do if is_playerbot(p) then ordered[#ordered+1]=p end end table.sort(ordered,function(a,b) return (socialLast[a:GetGUIDLow()] or 0)<(socialLast[b:GetGUIDLow()] or 0) end) for _,p in ipairs(ordered) do - if not p:IsDead() and not p:IsInCombat() and os.time()-(socialLast[p:GetGUIDLow()] or 0)>600 then + if not p:IsDead() and not p:IsInCombat() and not p:IsMoving() and os.time()-(socialLast[p:GetGUIDLow()] or 0)>600 then for _,q in pairs(p:GetPlayersInRange(25) or {}) do - if q:GetGUIDLow()~=p:GetGUIDLow() and is_playerbot(q) and not q:IsDead() and not q:IsInCombat() and p:GetTeam()==q:GetTeam() and p:GetPhaseMask()==q:GetPhaseMask() and os.time()-(socialLast[q:GetGUIDLow()] or 0)>600 then + if q:GetGUIDLow()~=p:GetGUIDLow() and is_playerbot(q) and not q:IsDead() and not q:IsInCombat() and not q:IsMoving() and p:GetDistance(q)<=15 and p:GetTeam()==q:GetTeam() and p:GetPhaseMask()==q:GetPhaseMask() and os.time()-(socialLast[q:GetGUIDLow()] or 0)>600 then roster.socialA=p:GetName();roster.socialB=q:GetName();roster.zoneName=area_name(p:GetZoneId()) socialLast[p:GetGUIDLow()]=os.time();socialLast[q:GetGUIDLow()]=os.time() break @@ -219,6 +218,9 @@ function AzerothAIEmitSnapshots() if roster.socialA then break end end emit("player.snapshot",roster) + for _,player in pairs(players) do + if is_playerbot(player) then emit("player.snapshot",player_payload(player)) end + end return emitted end diff --git a/docs/bot-conversations.md b/docs/bot-conversations.md index b79505e..ce88054 100644 --- a/docs/bot-conversations.md +++ b/docs/bot-conversations.md @@ -1,6 +1,6 @@ # Autonomous conversations -The live bridge proposes nearby, same-faction bot pairs within 25 yards. Both +The live bridge proposes nearby, same-faction stationary bot pairs within 15 yards. Delivery allows up to 25 yards. Both must be alive, out of combat and in the same phase. Opportunities ride the fresh roster snapshot transport. The database admits at most one exchange per two-minute clock bucket and enforces ten minutes between social requests involving a bot.