-
Notifications
You must be signed in to change notification settings - Fork 77
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
Berserk_barb arrives to v2 (travincal barb for now) #506
Conversation
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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.
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