Engineering item macro

Looking for a macro that will use an engineering item if it’s ready, swap to another one if it’s not.

Currently I have:

#showtooltip
/use 1
/equip Gnomish Mind Control Cap
/equip Goblin Rocket Helmet

Works fine in combat and when I’m intentionally swapping out of combat. The problem with this is that If I’m out of combat and try to use it while out of range, it will swap to the other item even if the cool down on the currently equipped one is ready. Is there someway to check if a cool down is ready and perform an action based on that?

Problem 2: Same sort of thing, but with boots

#showtooltip
/use 8
/equip Gnomish Rocket Boots
/equip Warsong Boots

Trying to use rocket boots if they’re ready an otherwise equip my other pair of boots. Problem lies in trying to use the rocket boots while not in combat. It will use the cooldown and then swap boots immediately, canceling the effect. Can I make the equip action first and make it dependent on whether or not the cooldown for the rocket boots is ready somehow?

That said, that’s an in-combat limitation.

Found a pseudo-solution:

#showtooltip
/use 1
/equip [noharm] Gnomish Mind Control Cap
/equip [noharm] Goblin Rocket Helmet

Solves the problem of equipping, instead of trying to use, while out of combat and out of range.

Here’s what I wrote for your boots. I have not tested it, please let me know if it works for you:

/run local b,rb,e,crb=16977,10724,GetInventoryItemID("player",8) crb=GetItemCooldown(rb)>0 if (e==rb and crb) then EquipItemByName(b) elseif (e~=rb and not crb) then EquipItemByName(rb) end
/use 8
/run UIErrorsFrame:Clear()

The first item ID is for your normal boots, second one for your rocket boots.

It will first check the cooldown of your rocket boots, if there is no cooldown and they are not equipped, it will equip them. If there is a cooldown and they are equipped, it will equip your normal boots instead.

Then it will try to use your boots which will fail if they cannot be used (hence the UIErrorsFrame:Clear)