I was in the same boat a few weeks back. If you understand the logic behind the code, then the coding syntax will come with time.
First and foremost: you want /timed and not /delay. /delaywill work just fine for a single-line hotkeys:
Code: Select all
Line 1: /casting 1
Line 2: /delay 90 /casting 2
Line 3: /delay 30 /casting 3
Whereas if you want to use /multiline, you would need this:
Line 1: /multiline ; /casting 1 ; /timed 90 /casting 2 ; /timed 120 /casting 3
Line 2: /multiline ; /timed 160 /casting 4 ; /timed 190 /sit
Notice when you use /delay you need to count down from the beginning of the line, and if you use multiple lines you need to continue the count.
I taught myself everything based off of the following "generic" routine which can be run on any healing class that will heal groupmates with a specific spell when they are below a HP threshold:
Code: Select all
Sub Main
/declare int i
:foreverloop
/for i 0 to ${Group.GroupSize} {
/if (${Group.Member[${i}].PctHPs < 70) /casting "name of heal spell" gem1 -targetid|${Group.Member[${i}].ID} -maxtries|4
}
/next i
/goto :foreverloop
/return
Line 1 identifies that this is the main routine, because no other routines exist and there are no /calls we know that this will be a "single shot."
Line 2 declares that there is a variable that will be an integer (int) and we will call it i (i).
Line 3 is an anchor which is the first half of the repetitive loop, as indicated by the name - you don't need to make yours called :foreverloop... the only requirement is the : to indicate the anchor.
Line 4 is where the macro actually "does something" - we're saying that the variable i is a number between 0 (yourself) and your group size.
Line 4b is where the macro will execute a function based on your declared variable: for first i if that group members HP are < 70%, this healer will cast a set heal on the group member and will try to cast up to 4 times (fizzles, or in the case of nukes/debuffs, resists).
Line 5 says to move to the next i (0, 1, 2, 3, 4, 5 for a 6-man group).
Line 6 says that once the routine has checked the HP for every i in the group, it goes back to the :foreverloop anchor above. The process is repeated until the macro is ended (/endmac)
Line 7 every routine must have a /return. In this macro, the /return isn't ever truly used, as you're looping back to the HP check over and over and over.
Obviously this is a great simplification of the process, however, using the above example and the MQ2 wiki (familiarize yourself with TLOs and Macro Flow Control) I have been able to build a Cleric macro that monitors self/tank HP, group HP for epic shield/DA, and a Shaman macro that monitors group hp and has reactive debuffs/hot when fighting a boss mob.
The best way to learn is by teaching, and I'm happy to give you as much feedback as possible as you start coding!
Edit: get Notepad + + as it's awesome for formatting. There's a post by Grey in this subforum that has a customization dealio that will help with color coding and font face type things. Really really helpful when you're trying to find a missed bracket or similar.