Moderator: MacroQuest Developers
It could just be that you're not very bright.I highly disagree. They have what to put, but its not very self explainitory
Yes, it's a manual. You'll find a 'Search' link above. It behaves a lot like a search function.other than looking at other peoples codes and reading the manual (which look more like a list of commands to me).

Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
if my hitpoints go below 99% then (
target myself
cast aa DA
cast aa CR
/g fuck off asshats and learn to control agro
cast gate
)
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
Now we are getting somewhere, lets change the psuedocode to the actual code show in the usage./if (conditions) {command(s)}
Runs command(s) if conditions evaluates to TRUE.
conditions are ONLY numeric compares. You must use MQ2Data string comparison to turn string compares into numeric compares.
conditions gets evaluated down to a single term from however many terms there are (You may use && and || freely.)
Multiple commands can be surrounded by { }, allowing multiple commands to be executed if the comparison is true.
} can be followed by else and a command. (also see /multiline)
Example:
/if (${String[${firstvar}].Equal[This is true]}) {
/echo TRUE
} else /if (!${secondvar}) {
/echo FALSE
/mqlog secondvar equals: ${secondvar}
} else {
/echo It's Something else
}
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/if (my hitpoints go below 99%) {
target myself
cast aa DA
cast aa CR
/g fuck off asshats and learn to control agro
cast gate
}
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
We aren't quite done with this yet, as we need to find a TLO (Top Level Object) that accesses type character, to allow us to use the PctHPs object. Browsing the TLO reference in the manual and we come up with:character (inherits spawn)
Members
...
int PctHPs Percent hit points
Ok, now lets put that together with the code:character Me
access to types: character, spawn
character object which allows you to get properties of you as a character
${Me} is a character object, so has access to all of the properties of the character reference Type. The character Type also has access to the properties of the spawn Type.
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/if (${Me.PctHPs}<=99) {
target myself
cast aa DA
cast aa CR
/g fuck off asshats and learn to control agro
cast gate
}
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/if (${Me.PctHPs}<=99) {
/target ${Me.Name}
cast aa DA
cast aa CR
/g fuck off asshats and learn to control agro
cast gate
}
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
and the TLO to access that is aptly namedaltability
Members
...
int ID ID number
putting things together leads toAltAbility
altability AltAbility[n]
Alt ability by number
altability AltAbility[name]
Alt ability by name
access to types: altability
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/if (${Me.PctHPs}<=99) {
/target ${Me.Name}
/alt activate ${AltAbility[Divine Arbitration].ID}
/delay 1
/alt activate ${AltAbility[Celestial Regeneration].ID}
/delay 1
/g fuck off asshats and learn to control agro
cast gate
}
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
This looks to be a good choice and so:/cast ["spellname"|"${varname}"]
- [item "itemname"]
Will cast the specified spell, or perform a right click of an item that has a right click spell
Code: Select all
| Savemyass.mac, usage /macro savemyass.mac
| I use this to heal in groups with my cleric
Sub Main
:loop
/if (${Me.PctHPs}<=99) {
/target ${Me.Name}
/alt activate ${AltAbility[Divine Arbitration].ID}
/delay 1
/alt activate ${AltAbility[Celestial Regeneration].ID}
/delay 1
/g fuck off asshats and learn to control agro
/cast "Gate"
}
/goto :loop
| Note, the next line actually does nothing, as the loop will never reach it, but I like to end all my subs at the end as a definite border so to speak
/return
TFM is more than a 'list of commands'. It's a reference.Hiidan wrote:I highly disagree. They have what to put, but its not very self explainitory. I've changed my original idea of a simple macro, it has to be complicated. However Im going to start simple and work my way up a step at a time. Interrupt's, Fizzles, Taking damage, buff requests, Etc. Those are the things that i wanna have affect this bot. I am working on a code myself, all this post was for was to see if there was something other than looking at other peoples codes and reading the manual (which look more like a list of commands to me). Thats all.
Some of us actually aren't smart enough to pick up scripting languages on the fly, so we ask for help. I no longer do this, personally, since when I asked for help making an auto-summon macro for mages to automatically summon gear for whatever class asked them for it, I was shot down instantly saying I was a 'money macroer' and I only wanted to exploit. So, now I write my own little crappy macros that beep when I get a tell, or make a little /popup that tells me certain spells drop, and thats about all I have the talent for.TheAFKBard wrote:Quit griping about people telling you to RTFM and just get in there and get your hands dirty. Take a macro that looks like it might do some things you want it to do, sit there with an open copy of the manual in a window side by side with your code window, and go over each line piece by piece, looking up each command that you don't understand. Then make some changes to suit your particular task. Start with changing spell/ability names and work your way from there. Once you've exceeded the ability of the base macro, try writing your own. When you've done all this with some degree of success, come back to the message board with any specific problems you might be encountering.
Whatever you do, don't come here before putting in some of your own effort and ask people to do all the work for you or give you some guide to writing macros, or ask for one-on-one tutoring. That's a slap in the face to all the people who have contributed their time writing macros for the depot and writing the manual.
MQ2 macro language isn't rocket science. It's not C++, it's not FORTRAN or COBOL. It's just a straightthrough scripting language with a few subroutines and some branching capabilities. It's a lot like visual basic (censor: i'm an idiot; please ignore me) or pascal in structure.
Do not worry about coding for Interrupts or Fizzles. Go to the snippets section and get SpellCast.inc or Spell_routines.inc. Both if these includes will take care of things like recasting when you fizzle or get interrupted. Spell_routines can even include a routine to interrupt your cast (like if someone else heals your target after you start casting, but before your heal hits.)Hiidan wrote:...Interrupt's, Fizzles, Taking damage, buff requests, Etc. Those are the things that i wanna have affect this bot.