From c32403f8edc9d11aa0800621597bbaaf43dbe5e5 Mon Sep 17 00:00:00 2001 From: Arto Simonyan Date: Wed, 21 Aug 2024 15:01:58 +0300 Subject: [PATCH] Update a few addresses (#35) - Add FPS address - thanks @Farmith - Update IsOnline - Update IsIngame --- pkg/data/data.go | 1 + pkg/memory/game_reader.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/data/data.go b/pkg/data/data.go index 9570964..a913b91 100644 --- a/pkg/data/data.go +++ b/pkg/data/data.go @@ -66,6 +66,7 @@ type HoverData struct { type OnlineGame struct { LastGameName string LastGamePassword string + FPS int } func (r Room) GetCenter() Position { diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index 9f38a39..573da1f 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -48,6 +48,7 @@ func (gd *GameReader) GetData() data.Data { Game: data.OnlineGame{ LastGameName: gd.LastGameName(), LastGamePassword: gd.LastGamePass(), + FPS: gd.FPS(), }, Monsters: gd.Monsters(pu.Position, hover), Corpses: gd.Corpses(pu.Position, hover), @@ -205,11 +206,11 @@ func (gd *GameReader) LegacyGraphics() bool { func (gd *GameReader) IsOnline() bool { // This represents which tab (Online/Offline) we're on in the Character Selection Screen - return gd.ReadUInt(gd.moduleBaseAddressPtr+0x2154F50, 1) == 1 + return gd.ReadUInt(gd.moduleBaseAddressPtr+0x2140ED0, 1) == 1 } func (gd *GameReader) IsIngame() bool { - return gd.ReadUInt(gd.moduleBaseAddressPtr+0x214CB48, 1) == 1 + return gd.ReadUInt(gd.moduleBaseAddressPtr+0x22D5D78, 1) == 1 } /* @@ -234,3 +235,7 @@ func (gd *GameReader) LastGameName() string { func (gd *GameReader) LastGamePass() string { return gd.ReadStringFromMemory(gd.moduleBaseAddressPtr+0x29DBD10+0x60, 0) } + +func (gd *GameReader) FPS() int { + return int(gd.ReadUInt(gd.moduleBaseAddressPtr+0x2140DF4, 4)) +}