Learning to code macros

Fammel

New member
Joined
Apr 1, 2008
Messages
13
Reaction score
0
Points
0
Okay so I want to start coding my own macros which brings up a couple of questions.
1) Is there a guide out there on getting started (beyond doing a simple loop)?
2) Does anyone have sample macros that give kind of step by step instructions so I can follow along?
3) Where can I get a list of events (i.e abjuration = 300, or PC = dead)

I have looked on the wiki pages and so far nothing, as well as looking at the guides that I have found here but that only got me so far.

Any help would be appreciated.

Thanks.
 
RaidDruid and RogueHelper are 2 macros I used for a long time as examples for coding.
 
Sadly nobody has really taken the time to do a full out macro tutorial that I know of. Most people just learn themselves by editing others macros.
 
The way i found most the commands was going through the manual, and then going through the wiki. The main things you will need to learn are the variables and how to set and how to change them. My terminology may be wrong but think of it as:
Top Level Obects are the main Variable, and Members are the individal aspects of those variables. So ${Me.PctHPs} is Me as the TLO, and PctHPs as the member and that total variable means i want to know my hitpoints are in percentage value.

My suggestion for you is to read up on all the variables, and then look at other macros. Learn to "read" them and figure out what each command is doing. From there you can start writing simple macros to do a single item that you want your character to do, then expand and expand. Also, kind of map out an outline of what you want your macro to accomplish and from there you can figure out the different events / subs that you need.

There are many ways to do the macro functionality, you will have to figure out what works best for you. For me, i like to compartmentalize each main function into its own sub routine. It feels cleaner to me and I can then copy and paste different routines to other macros. Ie. I have an AA sub that will work on any toon, so now i can just copy it to any macro type of my choosing to use AAs.

Learn the language, find examples, and practice practice practice.

For my reference macros i mostly used Nils' macs from MQ2 VIP boards.
 
Last edited:
I'd have to agree with them.

A ton of learning macro's for me was trial and error. USE IRC!!!!!!!!!!!!!! there are quite a few people in there that if ya need a quick answer they can help. But expect a link to a wiki point or to get flamed (from me) if i see you in asking questions that you could have easily looked up yourself. It's very annoying to see someone not even try to help themself.

Trial and error is your best friend. If your not sure something will work. try it , get an error and stil can't figure it out. come into irc and talk about it.
 
Code:
|The basic format of a macro
|fearless 20070501

|All include files go here
|#include some_include_file.inc

|All events go here
|#Event SomeEvent "blah blah blah blah blah"

Sub Main
|All declares go here
|/declare answertolife int outer 42

|Start my forever loop
|Everything inside my forever loop keeps running
|until I end my macro
:foreverloop

|Check buffs
/call Buff_Check

|Run some other sub
/call Other_Sub

|Restart my loop
/goto :foreverloop

|Sanity Check
/return
/end

Sub Buff_Check
|Check some buffs here
/return

Sub Other_Sub
|Check other stuff here
/return

Sub Event_SomeEvent
|Process an event here
/return
search the forums, and if you dont already have a sub over at the macroquest site i highly suggest you get one. here are some links to get you started.

loops and stuff

mq2 wiki

MMOBugs wiki

Your new favorite button
 
I had a quick question, what language are macros written in? I have a couple years java programming so I can decipher some of the code but some of the syntax and characters used get me confused, plus Id be able to actually start writing my own macros, Id just have to make a flowchart of what it did first lol (god I hate makin flowcharts, but my programs work better if I do)

Edit: sorry for rezzing this thread
 
Last edited: