Skip to content

buff updates#722

Closed
jasorello wants to merge 10 commits intohectorgimenez:mainfrom
jasorello:fix_buff_attempts_when_loading
Closed

buff updates#722
jasorello wants to merge 10 commits intohectorgimenez:mainfrom
jasorello:fix_buff_attempts_when_loading

Conversation

@jasorello
Copy link
Contributor

@jasorello jasorello commented Mar 3, 2025

Originally was just a 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

Now includes the ability to cast buffs with CTA, support for assassin buffs fade/BoS, and improved identification of CTA and swapping (although it expects the CTA to live on your secondary weapon set)

}

// 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

@elb91 elb91 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

for ctx.Data.OpenMenus.LoadingScreen {
for ctx.GameReader.GetData().OpenMenus.LoadingScreen {
time.Sleep(100 * time.Millisecond)
ctx.RefreshGameData()
Copy link
Contributor

@elb91 elb91 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.

@jasorello
Copy link
Contributor Author

I noticed fade wasn't getting cast and poked into why, I think it's because the state for it isn't mapped? I took a stab at a minor refactor here, although I didn't see the state needed for burst of speed.

Presumably this needs to be filled out with all possible buffs and their states

ctx.HID.PressKeyBinding(ctx.Data.KeyBindings.MustKBForSkill(skill.BattleCommand))
utils.Sleep(180)
ctx.HID.Click(game.RightButton, 300, 300)
utils.Sleep(100)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a way to hook into the player's cast rate here?

@jasorello jasorello changed the title bugfix: wait for loading screens to finish before doing initial buff bugfix: wait for loading screens to finish before doing initial buff, support assassin fade/bos Mar 24, 2025
@jasorello
Copy link
Contributor Author

I added some updates based on some discussion with elb, leveraging the ability to check for runewords directly instead of looking for skills on the items, as well as a check for which weapon set we have equipped, instead of again, looking for skills.

@jasorello
Copy link
Contributor Author

I took my own stab at implementing the request implemented in #756 and exposed it as a general config item

@jasorello jasorello changed the title bugfix: wait for loading screens to finish before doing initial buff, support assassin fade/bos buff updates Mar 25, 2025
@jasorello
Copy link
Contributor Author

jasorello commented Mar 25, 2025

once #761 is merged, this should be updated to leverage the cheaper update calls

  • incorporate 761 updates

@jasorello jasorello closed this Mar 29, 2025
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