Good Morning.
A few people have asked me how to do somethings using macroquest. I believe that this example should cover most of the basics that I get asked about.
This is an example of my basic Assist me or Attack This macro that I have the other characters in my raid run.
I start it off by all characters have bound to keypad 5 the following social.
/bca //endmac
/attack on
/macro raidatk
Just telling everyone to stop what they are doing and pay attention
Then I turn my attack on so I am hitting while I parse the raidatk macro.
The raid attack macro is like so.
------------------ Raidatk.mac ----------------
#turbo
Sub Main
/Bandolier Activate Melee
/if (${Me.CleanName.NotEqual[example]} && ${SpawnCount[pc radius 100 zradius 100 example]} && ${Target.ID}>0) /bct example //macro exampleatk ${Me.CleanName} ${Target.ID}
/return
---------------------------------------------------
All this macro does is activates the weapons I have saved as Melee on the bandolier (I try not to pull with the weapons, some mobs like to summon)
Then if checks to see if I am example, if I'm not example and example is within 100 of me, and I have a target, then I have example run the macro exampleatk.
I pass exampleatk 2 variables, one is my cleanname which will go into ${Param0} and the other is the ID of my target which will go into ${Param1}.
Now example will run exampleatk
------------- ExampleAtk.mac -------------------
| =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ExampleAtk
By BogReaper (
Bogreaper@gmail.com ) July 7th 2017
Hope you enjoy, and may the Bog be with you.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
#turbo
Sub Main
/tar ID ${Param1}
/delay 3
:badaboom
/if (${Cast.Ready[1]} && ${Target.Distance}<100 && ${Target.Type.Equal[NPC]}) {
/cast 1
/delay ${Int[${Math.Calc[${Spell[1].CastTime}+.5]}]}s
}
/if (${Cast.Ready[2]} && ${Target.Distance}<100 && ${Target.Type.Equal[NPC]}) {
/cast 2
/delay ${Int[${Math.Calc[${Spell[2].CastTime}+.5]}]}s
}
/if (${Target.Distance}<100 && ${Cast.Ready[3]} && ${Target.Type.Equal[NPC]} && ${Target.Buff[${Me.Gem[3].Name}].ID}==0) {
/cast 3
/delay ${Int[${Math.Calc[${Spell[3].CastTime}+.5]}]}s
}
/if (${Cast.Ready[7]} && ${Spawn[${Param0}].PctHPs}<50) {
/tar ${Param0}
/delay 3
/cast 7
/delay ${Int[${Math.Calc[${Spell[7].CastTime}+.5]}]}s
}
/tar ID ${Param1}
/delay 3
/if (${Target.Distance}<100 && ${Target.Type.Equal[NPC]}) {
/goto :badaboom
}
/if (${SpawnCount[npc radius 100 id ${Me.XTarget[1].ID}]} && ${SpawnCount[pc radius 100 ${Param0}]}) {
/assist ${Param0}
/delay 3
/if (${Target.Distance}<100 && ${Target.Type.Equal[NPC]}) {
/goto :badaboom
}
}
/if (${SpawnCount[npc radius 100 id ${Me.XTarget[1].ID}]} && ${SpawnCount[pc radius 100 ${Param0}]}) {
/tar id ${Me.XTarget[1].ID}
/goto :badaboom
}
/return
-------------------------------------------
Ok.. lets walk through it real fasy.
First any line beginning with a | is considered a Remark and is ignored by macroquest. I like to date my files and give a brief description of what it does so that when I go look in it sometime in the future I can get a little information about the macro.
#turbo is a macroquest error halting function, it is said to limit the speed inwhich the macro is executed and is recommended to be at the beginning of all macros, so I put it there.
/tar ID ${Param1}
On the line in raidatk where I told example to run this macro I passed 2 variables, my name and the target's ID.. this is where example will target the mob I want killed.
/delay 3
this is to have it pause for a brief fraction of time so that everquest can aquire the target. The number after the /delay is in 10th of a second. If it was /delay 3s the s would tell macroquest that I wanted 3 seconds, but without the s it defaults to 10ths of a second.
:badaboom
This is a Label, it is used to goto later in the macro
In our first /if statement I am checking that spell 1 is ready to be cast, and my target is closer then 100 in distance and the type of target is an npc. If all 3 of these are true it will cast the spell in spell gem 1.
The next line is a fancy /delay. If we break this down what I do here is I take the Casting time of the spell in gem slot 1, add 1/2 a second to it, convert this into in Intiger (whole number) then put an S at the end.
Lets say that spell has a casting time of 0.3s with all of my focus effects and buffs on. well I add 0.5 to that (just to round up) making it 0.8 then I convert it to an intiger and that again rounds it up to be a 1 then a tag an S on the end and endup with a
/delay 1s
so I can change the spell in gem slot one at will and not have to come back in and edit the macro or some ini file.
The next if statement is the same as the first just does spell 2
The 3rd if statement is an interesting one. Here I use ${Target.Buff[${Me.Gem[3].Name}].ID} to check and see if that spell is already on the target. This is for a number of reasons. This macro might have already reached the end once and we are in the 2nd or 3rd time around the macro commands tring to kill this one mob. Or I have a necro and a sk in my raid.. they like to dot up entire slews of mobs with one cast of a spell, so if we have changed targets we need to check and see if this dot is already on the mob, if it is, it will have a buff id # and will not ==0.
But if that spell is not already on the target, we put it on him.
The 4th if statement, we check and see if spell 7 is ready (lets say a heal spell) and we check and see if ${Param0} 's hp's are below 50%.
This is where I passed my cleanname to the macro and it fell into ${Param0}
Then we target our mob again
Then we check and see if that mob is still here, if its still closer then 100 in distance and still an npc, then we go to our label :badaboom
If that target is gone, or its now not an npc, or its just not there (dead) we use our Extended Targets and see whats going on.
With SpawnCount we count the npc's within 100 of example that has the id of the mob in extended targets slot 1, if that is more then 0 and ${Param0} (me) is still around, then example /assists me.
Then it does our standard check of is the new target withing 100 distance and an npc, if so, goto our label :badaboom
If it did not go back to the label :badaboom I have it check once more if there is a mob in my xtended targets slot 1, and I'm still closer then 100, if so, I have example just target the mob in xtended targets slot one and go to :badaboom.
This is due to timing issues. the tank that issued the command might be flying through targets real fast slaughtering the train. He/She might have just changed targets right at that instance when example was aquiring a new target.
Either way, if theres a mob in the extended target that is within 100 distance and the one whom told example to attack is still around, we need to clean out the trash.
------------------------------------------------
I hope this helped someone.
If you enjoyed this post say so, and I will post some others.
If you see a better way of doing it, please share, I love new idea and better ways. (please remember, as I said, this is a very simple scaled down version of my basic sic'em button, some of them (SK) get very technical to get that dps out of him <grin>)
Thanks for reading, and I will see ya on EzServer.
Peace
BogTank