Ground bot intentions in live game knowledge and verify outcomes
Core tests / core (push) Successful in 28s

This commit is contained in:
Codex
2026-09-25 13:28:03 +08:00
parent 20ccd0fced
commit 502cb1e4fd
17 changed files with 251 additions and 24 deletions
+6 -2
View File
@@ -1,6 +1,6 @@
"""Read native counters and profiler output; return bounded public measurements."""
import json,subprocess,time,math
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper')
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper','nativeDeaths')
def normalize_performance(raw):
def number(v):
try:
@@ -28,9 +28,13 @@ def collect(sql,state):
for line in sql('SELECT guid,COUNT(*) FROM acore_characters.character_queststatus_rewarded WHERE guid IN ('+guids+') GROUP BY guid').splitlines():
guid,count=map(int,line.split('\t'));rewarded[guid]=count
money={int(g):int(c) for g,c in (line.split('\t') for line in sql('SELECT guid,looted_copper FROM acore_auth.azerothai_currency').splitlines())}
deaths={}
for line in sql('SELECT guid,account_id,name,COUNT(*) FROM acore_auth.azerothai_death_experience GROUP BY guid,account_id,name').splitlines():
g,account,name,count=line.split('\t');g=int(g)
if g in allowed and allowed[g]['name']==name and allowed[g]['autonomy'].get('accountId')==int(account):deaths[g]=int(count)
result=[]
for guid,b in allowed.items():
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0)
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0);counters['nativeDeaths']=deaths.get(guid,0)
result.append({'guid':guid,'name':b['name'],**counters})
return result