Jump to content
Sign in to follow this  
Rems

Weapon swap at x amount of mana

Recommended Posts

I think it is not possible to put such functions in some kind of OnUpdate function.

 

However you could bind this to pretty much every button.

 

The macro should check the weapon and mana:

Depending on that, switch or don't switch the weapon.

What you need is:

UnitMana("player") => Your mana (current)

UnitManaMax("player") => Your max mana

local _,texture = GetInventorySlotInfo("MainHandSlot") => Lookup the texture string

strfind(str1, str2) => To just fuzzy check cause only 255 chars,

UseContainerItem(bagid, slotid, onself) => Where your weapon is located

So now we should have everything:

local p,u,z,s,_,t="player",UnitMana,UnitManaMax,strfind,GetInventorySlotInfo("MainHandSlot"); if ((u(p)/z(p))<50) and s(t,"textureNamePart")) or ((u(p)/z(p))>50) and s(t,"textureNamePartOther")) then UseContainerItem(0,1,1); end

Maybe you can shorten it a little bit more with some neat tricks.

Also I didn't test it, so just test it and fix the issues.

 

cheers!

 

Edit:

Supermacro or putting such macros into an own macro addon can also help!

Edited by Shino

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×