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

Berserk_barb arrives to v2 (travincal barb for now) #506

Merged
merged 10 commits into from
Oct 3, 2024
Merged

Berserk_barb arrives to v2 (travincal barb for now) #506

merged 10 commits into from
Oct 3, 2024

Conversation

elobo91
Copy link
Contributor

@elobo91 elobo91 commented Oct 3, 2024

This is a fully working travincal berserk barbarian profile.
Its using FindItem on 100% of the corpses.

Made some exception to barbarian attacks as he is doing melee and his skill (berserk) has no cooldown. Normal primaryattack was making the attacks 2x slower if not more.

It checks if it accidently clicked on durance lvl 1 stairs then come back to travincal and resume its task. (there could be optimization here it takes up to 15 seconds but works)

had to lock the context to pickup items after killing a monster(only for council) . we must kill all 12 council members before looting/horking . thats why the exception.

  • General koolo Fixes
    added a WaitForGameToLoad() in bot.go that make sure game is fully loaded and apply legacygraphics ( if classic mode enabled) before performing anything. That would cause instant crash for anyone using mods. that was also causing a problem when identifying items at the same time as toggling legacy mode. The change from HD to legacy was making the bot misclick and put item on cursor that would spiral forever.

Added a pickup_item after returning from town . If run is done and character had full inventory then it triggered the return to town context. When it would come back the context was done (the run) so it wouldnt pickup remaining items then it would either save/exit game or continue with next run on the list. item_pickup added in UsePortalInTown() to prevent this.

This is not a finished product / i have so much more to add but that would become very long to review so lets have a first version. ETA: very solid. can run without interuptions having teleport from enigma . Theres minor issue with walking character the context "WaitForAllMembersWhenLeveling" gets triggered even tho its not a lvling profile . it happens occasionally but it doesnt with teleport .

elb

elobo91 and others added 10 commits September 30, 2024 12:51
Fixed gambling.  it wasnt reselling  amulets and coronets.  only rings for some reason.
  Removed check for durance lvl 1  wasnt working so just removed it for now.   Also need to improve what happens after we went to town  and reuse waypoint (exemple on full inventory). for now it just saves and exit games.
…o barb

Fixed legacygraphics that were applied after the main bot loop had started.  That would crash user having mods  and also would fail identifying items if it was changing from HD to legacy while doing it. item would end up on cursor and spiral forever. now legacygraphics applied before anything only if classicmode enabled of course.

optimized barb,  now will return to travincal if it accidently clicked on stairs to durance lvl 1
@@ -108,9 +117,16 @@ func (b *Bot) Run(ctx context.Context, firstRun bool, runs []run.Run) error {
continue
}

if b.ctx.CharacterCfg.ClassicMode && !b.ctx.Data.LegacyGraphics {
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we can make this check inside the SwitchToLegacyMode function + the ctx.RefreshGameData()? wdyt? so we can also get rid of the ctx.RefreshGameData() on line 47

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The extra ctx.RefreshGameData after switchtolegacymode is to make sure the context doesn’t switch back to HD having unrefreshed data. That happened when testing so i added it there. This doesnt affect performance . But maybe theres place for optimization

return false
})

if err == nil {
// Perform actions after re-entering the game area
Copy link
Owner

Choose a reason for hiding this comment

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

you wanted to put something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got confused with the
func UsePortalFrom(owner string) and UsePortalInTown(). So i carried that change with the pr. I kept it like this if eventually we want to add stuff there . Is not necessary however

@hectorgimenez hectorgimenez merged commit 65918f0 into hectorgimenez:refactor_actions Oct 3, 2024
1 check passed
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