Public Macros Automate Casting From .INI
Reply
Automate Casting From .INI
Hullo~

I just wanted to post a small code snippet that I use for automating spells, discs, items, and AA abilities from a .ini file. It's pretty useful since you can preserve a priority (rotation) list and not have to worry about setting up those annoying MQ2Melee down/holyshits.

Note: If you're wondering why I subtract 1 for the loop, it's because I include a space between every subsection in my .inis for readability for regular users.

Call Technique (In Macro):
Macro
More +

/for abilCounter 1 to ${Math.Calc[${Ini[varList.ini, abilityList,,].Count[|]}-1]}
     /varset abilityName ${Ini[varList.ini, abilityList,,].Arg[${abilCounter},|]}
                                               
     /call useAbility "${abilityName}" "${Ini[varList.ini, abilityList, ${abilityName}]}"
/next abilCounter


Macro Code:
Macro
More +
|**
        This will take an ability name and type, and then attempt to cast it if it's ready.
**|

Sub useAbility(abilName, abilType)

        /if ((${abilType.Find[spell]}) && (${Cast.Ready[${abilName}|gem${abilType.Right[1]}]})) {
                /casting "${abilName}" Gem${abilType.Right[1]}
        } else /if ((${abilType.Equal[disc]}) && (${Me.CombatAbilityReady[${abilName}]})) {
                /disc "${abilName}"
        } else /if (${Select[${abilType},item,alt]} && ${Cast.Ready[${abilName}|${abilType}]}) {
                /casting "${abilName}" ${abilType}
        }
       
        /delay ${Cast.Timing}

/return


.INI Setup:
Macro
More +

[abilityList]
Exigency for Blood=spell1
The  Sepukku=item
Rapid Kick Discipline=disc
Infusion of Thunder=alt
Tue Jun 07, 2016 8:03 pm
Public Macros Automate Casting From .INI
Reply