update offset

This commit is contained in:
vietdungdev
2026-05-22 19:24:21 +07:00
parent b6fbaa7acf
commit 28da1b9a35
7 changed files with 239 additions and 31 deletions

View File

@@ -76,7 +76,7 @@ func (gd *GameReader) GetData() data.Data {
// Conditionally update monsters
monsters := gd.cachedMonsters
if now.Sub(gd.monstersLastUpdate) > 200*time.Millisecond {
if now.Sub(gd.monstersLastUpdate) > 100*time.Millisecond {
monsters = gd.Monsters(pu.Position, hover)
gd.cachedMonsters = monsters
gd.monstersLastUpdate = now
@@ -88,7 +88,7 @@ func (gd *GameReader) GetData() data.Data {
// Conditionally update inventory 500ms
// Except when hovering over an item
inventory := gd.cachedInventory
if now.Sub(gd.inventoryLastUpdate) > 500*time.Millisecond ||
if now.Sub(gd.inventoryLastUpdate) > 250*time.Millisecond ||
(hover.IsHovered && hover.UnitType == 4) { // 4 = Item type
inventory = gd.Inventory(rawPlayerUnits, merc, hover)
gd.cachedInventory = inventory
@@ -97,7 +97,7 @@ func (gd *GameReader) GetData() data.Data {
// Conditionally update objects
objects := gd.cachedObjects
if now.Sub(gd.objectsLastUpdate) > 200*time.Millisecond {
if now.Sub(gd.objectsLastUpdate) > 100*time.Millisecond {
objects = gd.Objects(pu.Position, hover)
gd.cachedObjects = objects
gd.objectsLastUpdate = now