Alright, let me make it readable and break it down for you:
Code:
local l=GetInventoryItemLink("player",6") -- gets the item link for your currently equipped belt
local a = l:find("m:%d+:4223") and "Invisibility Field" or "Nitro Boosts" -- searches for enchant id 4223 in the currently equipped belt's link. if it is found, that means the belt has nitro boosts on it, and we should tinker invisibility field. otherwise, we should tinker nitro boosts.
CastSpellByName("Engineering") -- open the engineering window
for i=1,GetNumTradeSkills() do -- loop through all engineering recipes
if GetTradeSkillInfo(i) == a then -- if we've found the tinker we should use
DoTradeSkill(i,1) -- cast the tinker
break -- stop looping
end
end
CloseTradeSkill() -- close the engineering window
Afterwards, /use 6 should target the tinker (which is currently queued on the glowing cursor) onto your belt. In theory.
There's a few things that may not make this work:
1. I don't know if the tinker cast requires the trade skill window to be open. If it does, that would complicate things.
2. I don't know if tinkers actually use DoTradeSkill().
3. I don't know if the tinker actually has the enchantID 4223. If the macro doesn't work, this is the first thing you'd want to check. Do a
/dump "[Item Link]" (with quotes). This should break the item link down into its underlying datastring, which should look something like this: |cff
color|Hitem:
itemid:
enchantid:
<other information>|h[
item name]|h|r. Replace the '4223' in the macro with the enchant ID your nitro boost tinkered belt displays.