Skip to content

Move potions to belt after corpse recovery#731

Open
Sunblood wants to merge 5 commits intohectorgimenez:mainfrom
Sunblood:potionaftercorpse
Open

Move potions to belt after corpse recovery#731
Sunblood wants to merge 5 commits intohectorgimenez:mainfrom
Sunblood:potionaftercorpse

Conversation

@Sunblood
Copy link
Contributor

Shift + left clicks on all potions in inventory so they move back into belt slots instead of getting sold.

Requires Shift+click fix from #684 to function correctly

elb91 and others added 5 commits February 19, 2025 20:34
This pr enable Shift Key usage.
ctx.HID.ClickWithModifier(game.LeftButton, screenPos.X, screenPos.Y, game.ShiftKey)

Used for Equipping gear or moving back potions to belt in correct order if we died.

Assembly code that returns -32768 (0x8000) for shift key
 only sets rax to 0x8000 if the key matches,otherwise it returns 0 (due to the initial xor).
starts by zeroing rax, which provides a default "key not pressed" state.
use single-byte comparisons

Original code would always return 0x8000 after doing the comparison, which explains why the modifier behavior wasn't working correctly . It was reporting the key as pressed regardless of which key was being queried.
@artosimonyan
Copy link
Collaborator

@Sunblood this should be a part of the belt management script. Also clicking all potions can make unwanted potions go in the belt.

Check the logic for belt management and implement something similar, only shift+click a pot when needed/has a missing one in the belt

@elb91
Copy link
Contributor

elb91 commented Mar 17, 2025

Yeah belt doesnt remember emplacement for potions after you died. It isnt completely random but have to help it a little bit.
When doing shift+click it does the following :
Starting from the top-left slot, filling from left to right and top to bottom.

However if 1 potion is on each row( no holes) it would work so need little logic here.

Technically when you die it keeps one potion of each in belt( in wanted order) unless you had none left( rejuv will be more tricky for that)

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.

3 participants