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

Equipment prototype #14

Merged
merged 2 commits into from
Jan 25, 2020
Merged

Equipment prototype #14

merged 2 commits into from
Jan 25, 2020

Conversation

jaenster
Copy link
Collaborator

@jaenster jaenster commented Jan 25, 2020

Added the prototype equip for units (items).

The goal is to make it more easy to equip an item, without knowledge of the currently equiped items.

For example, this code goes to stash, equips memory, cast energy shield and put the previous items back on. It figures out if you go from a double handed to a single handed item, or vice versa.

Town.move('stash') && Town.openStash();

let oldItems = me.getItems(-1).filter(item => item.getPrefix(20588 /*memory*/)).first().equip();

me.cancel(); // stash might still be open

Skill.cast(58); // cast energy shield

Town.openStash();
oldItems.rollback(); // put old items back on

@azer0
Copy link
Contributor

azer0 commented Jan 25, 2020

Did some testing on this, seems to work well. Love the idea will help with my auto level script :).

@azer0 azer0 merged commit c42f8be into blizzhackers:master Jan 25, 2020
@jaenster jaenster deleted the equipment branch January 31, 2020 10:54
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