Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: wait for loading screens to finish before doing initial buff #722

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jasorello
Copy link
Contributor

Fix for #714

By refreshing the game state before checking for a loading screen, the bot successfully identifies the loading screen and waits for it to complete before running through the Buff routine, avoiding the problem identified in issue 714

@@ -48,6 +48,7 @@ func Buff() {
}

// Check if we're in loading screen
ctx.RefreshGameData()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there downsides to this besides a few more CPU cycles? Is there a better way?

Copy link
Contributor

@elobo91 elobo91 Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can selectively update just what you need from GetData() .

ctx.GameReader.GetData().OpenMenus.LoadingScreen

Or ctx.GameReader.GetData().OpenMenus
For all OpenMenus

Full refresh data is on a 100ms ticker already, the less we call it the better it is for cpu

https://github.com/hectorgimenez/d2go/blob/4a7e78234327469911c8a4bba2b4fa4df2e5429b/pkg/memory/game_reader.go#L107

time.Sleep(100 * time.Millisecond)
ctx.RefreshGameData()
Copy link
Contributor

@elobo91 elobo91 Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello , can you make sure the removal of the last refreshgamedata after loading screen is completed doesnt create issue with tinymod when creating new game. . Is perfect to only loop the loading screen until loaded but unsure if we dont need one full refresh after to sync.
it was in place because it would try to move/identify items without everything loaded with tinymod . Thanks

Copy link
Contributor Author

@jasorello jasorello Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used tinymod before, I'll just add a final refresh back in with a comment.

I did a brief look through closed issues and PRs; are there reproduction steps for the tinymod issue so that someone could check if this refresh is needed? When/if I get tinymod set up, I'm not confident I'd be able to say that the refresh isn't needed. Putting back the refresh is safer but potentially redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants