Code in subs run exactly the same way as anywhere else in the macro.
EQ itself doesn't always do things instantly though. Like if you /target bob, it may take a few tenths of a second before bob pops up in your target window. MQ2 runs up to 40 lines per second, so if your code is something like this:
Code: Select all
/target bob
/call Cast "complete heal"
/target bill
/call Cast "complete heal"
You will always need to use delays of some sort in order to make sure that MQ2 isn't doing things faster than EQ. I find conditional delays are the best, like this:
Code: Select all
/target bob
/delay 1s ${Target.Name.Equal[bob]}
/call Cast "complete heal"
That will delay for 1 second, or until your target is bob, whichever comes first.