Semicolon in macro

I have a macro which is supposed to use the first “water” which is found in the inventory, in a predefined sequence.

If it is like this:
/use item:8079
/use item:8078
/use item:8077
/use item:3772
/use item:2136
/use item:2288
/use item:5350
/use item:159
/use item:1179
/use item:1205
/use item:1708
/use item:1645
/use item:8766
/use item:18300
it works “fine”. The first item in the sequence which is found in the incentory will be consumed, trigger the universal cooldown, and all the following items in the sequence will cause an error but will not be consumed.
Of course this is far from perfect but it is functioning.

I wanted to cirumvent the errors by modifying it like this:
/use item:8079; item:8078; item:8077; item:3772; item:2136; item:2288; item:5350; item:159; item:1179; item:1205; item:1708; item:1645; item:8766; item:18300
I did expect that, if one item in the sequence is not used for whatever reason, it will attempt to use the next; and if one item in the sequence is used, it will stop executing the /use command.
However, it only attempts to use the first item in the macro and stops regardless of doing it successfully or not.

Therefore I wonder what the semicolon does actually do. Unfortunately there is very litte information about semicolons in macros.
Please enlighten me.

It functions like else in an if statement. Given that you’re not using any conditions in your macro it won’t do anything useful.

Your original solution is the best for this case.

Elvenbane covered the use of semicolon. I only checks the conditions you give it, like [combat] or [harm] and if they don’t apply, then it moves on to the next call after the semi-colon.

However, an alternative is to use an addon like mine [Spinx Cookie] which generates macros for health and mana consumables based on what’s in your bags.

Thank you for your replies. This makes it clear why the macro did not do what it was supposed to.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.