from pathlib import Path from lupa import LuaRuntime l=LuaRuntime();l.execute('''hooks={};timers={};sql={};function AuthDBExecute(s)table.insert(sql,s)end function RegisterPlayerEvent(id,fn)hooks[id]=fn end function CreateLuaEvent(fn) table.insert(timers,fn)end function PrintInfo()end p={};function p:IsPlayerbot()return true end;function p:GetGUIDLow()return 9 end human={};function human:IsPlayerbot()return false end ''') l.execute((Path(__file__).resolve().parents[1]/'ale/azerothai_outcomes.lua').read_text()) l.execute('hooks[32](32,p,nil,3);hooks[54](54,p);hooks[38](38,p);hooks[32](32,human,nil,99);timers[1]()') assert 'VALUES (9,1,1,1,3,0)' in l.eval('sql[#sql]') n=l.eval('#sql');l.execute('timers[1]()');assert l.eval('#sql')==n print('Native counters exclude humans, aggregate quantities and flush once')