Goto page 1, 2, 3  Next Public Macros Looking for some help on this Cleric macro
Reply
Looking for some help on this Cleric macro
I've decided to try my hand at writing a macro for my Cleric, I play on THF if that makes a difference.

I have looked over the wikis, and studied a number of existing macros, but I've found I still don't really understand how they work.

Here is my existing macro:
Macro
More +

| Events and Chat and Includes
#turbo          10
#chat           tell
#chat           group
#Event          ImDead          "You have been slain by#*#"
#Event          ImDead          "You died."
#event          Zoned           "You have entered#*#"
#event          Zoned           "LOADING, PLEASE WAIT..."
#event          ImHit           "#*#hits YOU for#*#"
#Event          Thirsty         "#*#are thirsty#*#"
#Event          Hungry          "#*#are hungry#*#"
#include        ninjadvloot.inc
#include        spell_routines.inc


Sub Main

/if (${Me.Class.ShortName.NotEqual[CLR]}) {
        /echo Sorry you are not a Cleric.
    /echo I'm afraid this macro to PC relationship just isn't going to work out.
    /echo I do hope we can still be friends though.
    /end
}

| - Detect AA spell gems
| ################## Setup AA Extra gem slot variables

        /if (${Me.AltAbility[Mnemonic Retention]}>=3) /multiline ;      /declare  Gem9 int outer  1 ; /declare Gem9Spell        outer

| name the main tank
/declare tank                           string outer    Feldorn
/varset tank                            ${tank}

| Declare the Spells here
/declare heal                           outer   "Ancient: Hallowed Light"
/declare healGem                        int             1
/declare grpHeal                        outer   "Word of Vivification"
/declare grpHealGem                     int             2
/declare hot                            outer   "Pious Elixir"
/declare hotGem                         int             3
/declare vie                            outer   "Panoply of Vie"
/declare vieGem                         int             4
/declare di                                     outer   "Divine Intervention"
/declare diGem                          int             5
/declare pac                            outer   "Placate"
/declare pagGem                         int             6
/declare ohShit                         outer   "Divine Barrier"
/declare ohShitGem                      int             9
/declare gate                           outer   "Gate"
/declare drink                          outer   "Summon Drink"
/declare food                           outer   "Summon Food"
/declare root                           outer   "Petrifying Earth"
/declare pet                            outer   "Unswerving Hammer of Retribution"
/declare petGem                 int             8

/declare Bot bool outer         FALSE

/declare healAt                         int             65
/declare CastRetryTime          string outer 15s

|Item Clicky Declares
/declare manaOrb                outer   "Orb of Spirits"
/declare epic                           outer   "Ancient Shield of the Divine"

| Declares for NetBots
/declare NetBotsArray1          outer
/declare NetBotsArray2          outer
/declare NetBotsArray3          outer
/declare NetBotsArray4          outer
/declare NetBotsArray5          outer
/declare NetBotsArray6          outer


|Main Loop, Add other loop and a connector /if command
:Main_Loop
/echo Tank=${tank}
/echo TankID=${Spawn[=${tank}].ID}
       
/if (!${Bot}) /call Start1
/call Heal
/doevents
/call GrpHeal
/call DivineIntervention
/call CheckTankHealth

/goto :Main_Loop
/return

| Subs below here.

Sub Start1
/varset Bot TRUE
/declare x int local
  /for x 1 to 6
           
          /varset NetBotsArray${x} ${NetBots.Client.Token[${x}, ]}

  /next x
/return


Sub Heal
/if (${Me.Casting.ID} || ${Me.Moving}) /return
/target id ${Spawn[pc ${tank}].ID}
/if (${Target.PctHPs}<=${healAt} && ${Target.Type.Equal[PC]} && ${Target.Type.NotEqual[CORPSE]}) /call cast ${heal} gem${healGem}
/return


Sub GrpHeal
/if (${Me.Casting.ID} || ${Me.Moving}) /return
/declare i int local
/declare x int local
/for x 0 to 5
/for i 0 to 5
/if (${x} == ${i}) /next i
/if (${Group.Member[${i}].Distance}<=100 && ${Group.Member[${i}].PctHPs}<70 && ${Group.Member[${i}].Type.Equal[PC]} && ${Group.Member[${x}].Distance}<=100 && ${Group.Member[${x}].PctHPs}<70 && ${Group.Member[${x}].Type.Equal[PC]}) /call CastGrpHeal
/next i
/next x
/return


Sub CastGrpHeal
/if (${FindItem[Ancient Shield of Divinity].Timer}==0) {
/call cast "Ancient Shield of Divinity" item ${CastRetryTime}
}
/if (${AltAbilityReady[Divine Arbitration]} && !${FindItem[Ancient Shield of Divinity].Timer}==0) {
/call cast "Divine Arbitration" alt
}
/call cast ${grpHeal} gem${grpHealGem}
/echo Gheal Inc
/gsay Grp Heal Inc, Hang in there dudes!
/return


Sub DivineIntervention
/if (${Me.Casting.ID} || ${Me.Moving}) /return  
/declare v int local
/for v 1 to 6
/if (!${NetBots[${NetBotsArray${v}}].Buff[Divine Intervention]} && ${NetBots[${NetBotsArray${v}}].PctHPs}>50 && ${NetBots[${NetBotsArray${v}}].InZone} && ${NetHeal[${NetBotsArray${v}}].Distance}<80 && ${pct_mana} < 0.40 ) {
        /target ${NetBotsArray${v}} PC
        /delay 1s
        /g Casting ${di} on %t
        /cast ${di} gem${diGem}
        }
/next v
/return

Sub CheckTankHealth
 /if (${Spawn[${tank}].ID} && ${Spawn[${tank}].Distance}<${Spell[${heal}].Range} && ${Spawn[${tank}].PctHPs}<=50) {
  /call Interrupt
  /target ${Spawn[pc ${tank}].ID}
  /call cast ${heal} gem${healGem}
  }
/return


|Chattt Trigger events check #chat {Setting
Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
/if (${Select[${ChatText},tank]}) {
    /varset tank ${ChatSender.Right[-2].Left[-1]}
    /echo Main Assist Changed to ${tank}
    }
/if (${Select[${ChatText},vie]}) {
    /target ${ChatSender.Right[-2].Left[-1]}
    /cast ${vie} gem${vieGem} |maxtries5
    /echo Casting ${vie} on ${Target.ID}
    }
 /if (${Select[${ChatText},di]}) {
    /target ${ChatSender.Right[-2].Left[-1]}
    /cast ${di} gem${diGem} |maxtries5
    /echo Casting ${di} on ${Target.ID}
    }

/return


When I initialize the macro, I get: "There are no spawns matching: (0-300) any null"

I'm not totally sure what I'm doing wrong, any chance I could get some direction please :)
Last edited by mortenya on Sat Feb 08, 2014 11:09 pm; edited 1 time in total
Sat Feb 08, 2014 1:29 pm
Need to use "outer" if you want Tank to be a valid variable the way you are using it.

Macro
More +

/declare tank         string outer    Feldorn    | This is the only target the Cleric will heal
Sat Feb 08, 2014 3:45 pm
That did seem to change it, but it still doesn't seem to like my syntax for targeting my tank. Now the error is just: "There are no spawns matching: (0-300) any"

If I only intend the cleric to watch my tank for single target heals, what would be the correct way to declare that? I know I can use the chat input, but I wanted to not have to be sure and have the cleric target me every encounter.
Sat Feb 08, 2014 5:31 pm
Might be better to target by ID?

This does work nicely for me .. (looked at my healer macro)

Macro
More +


/declare tank string outer Natedog

/target id ${Spawn[pc ${tank}].ID}
Sat Feb 08, 2014 8:07 pm
Somewhere in your main loop, put:

/echo Tank=${tank}
/echo TankID=${Spawn[=${tank}].ID}

and post the results.

General Good Things To Do:
If you know the ID and you want to target, then use the ID.

If you can look in NetBots without targeting, look in NetBots. Look at your tank's HP via NetBots so you don't have to keep targeting your tank.

If you know the ID and want to cast a spell on that target, use the ID in your casting command. You'll have to use either a MQ2Cast command or use MQ2Cast_spell_routines.inc.
Sat Feb 08, 2014 9:49 pm
Senior Project Member
natedog, it's working now, my ${Spawn} line was wrong.

grumble, the echos are returning the correct information, so that portion is worked out.

I'll need to figure out how to use NetBots to track health now then.
Sat Feb 08, 2014 11:08 pm
Ok, I think this is somewhat functional at this point, having trouble with one section.

Macro
More +
Sub DivineIntervention
/if (${Me.Casting.ID} || ${Me.Moving}) /return
/if (${Me.PctMana}>40) {
        /declare x int local
        /for x 1 to ${NetBots.Counts}
        /varset VerifySpell " ${NetBots[${NBToon${x}}].Buff} "
                /if ( !${VerifySpell.Find[ ${vie} ]} && ${NetBots[${NBToon${x}}].InZone} && ${NetBots[${NBToon${x}}].InGroup} && ${Cast.Ready[Divine Intervention]} ) {
                        /delay 1s
                        /g Casting ${vie} on %t
                        /casting ${vie} gem${diGem} -maxtries|5 -targetid|${NetBots[${NBToon${x}}].ID}
                        /next x
                }
}
/return


My intention is that this will keep divine intervention on my team, when I run the macro, it will select the first team member, and cast the buff on them, but it doesn't step through the rest of the team, and it will continually cast the buff on the first target, so my !${VerifySpell.Find[ ${vie} ]} flag doesn't seem to be working right. I pulled that bit directly from a shaman macro in the Public Macros section.
It does successfully grab a target though, so my issues seems to just be getting it to step through the sub, and properly checking for an existing buff.
Sun Feb 09, 2014 11:46 pm
Ok, after reading through Sorvani's post history, I have that divine intervention sub working.

I'll test this out in actual combat later this week and if it works well, I'll post it to the public macro board so everyone can enjoy it.

do any of you know of an example snippet for memming a set of spells? I have some ideas but haven't been able to test yet.
Tue Feb 11, 2014 12:49 pm
Use spell sets. Either the built in EQ ones or MQ2Cast
_________________
Sorvani
Tue Feb 11, 2014 5:43 pm
Senior Project Member
I had looked at MQ2Cast spell sets, and I have a spell set saved to the client, I was trying to find a more dynamic solution, where I can just change what spells I use in my macro, and use that to check spells memmed vs what spells the macro uses.

Thanks a lot for the help, you guys are great.
Tue Feb 11, 2014 10:47 pm
You want to dynamically change what spells the macro uses?

Super Simple Example:
You have a shaman. Low level. You want to cast slow, a single target heal, a nuke and a dot. As you gain levels and new spells, you want to use the upgraded spell?
Tue Feb 11, 2014 11:03 pm
Senior Project Member
grumble, that is exactly what I was going for.

I know that I can use something like this:
Macro
More +

/if (!${Me.Gem[${spell}]}) {
     /mem ${spell} gem${gem}
}


I might need to just create an array of variables to handle it. Such as:
Macro
More +

/varset spell[1] = ${spell}
     /declare int local i
     /for i 1 to 9
          /memspell ${i} ${spell[${i}]


That might do what I'm after, I'll work on it later, gotta study for a C++ midterm.
Tue Feb 11, 2014 11:17 pm
How fast do you level on THF? How often do you update to a new spell? Unless you will be using this macro for many many low level clerics, it probably won't be worth the time to make it dynamic.

Quick and dirty attempt... with some hard coding.

Instead of:
Macro
More +
/declare heal            outer      "Ancient: Hallowed Light"

Use:
Macro
More +
/declare heal outer
/if (${Me.Book[Holy Light]) /varset heal "Holy Light"
/if (${Me.Book[Pious Light]) /varset heal "Pious Light"
/if (${Me.Book[Ancient: Hallowed Light]) /varset  heal "Ancient: Hallowed Light"
| add higher ranks after

The macro will look through the spells in the order you specify. Start with the lowest level spells and work your way up. The last spell found in your spellbook is the best spell of that line of spells. That spell will be used for the rest of the macro.
Wed Feb 12, 2014 12:50 am
Senior Project Member
I see what you're saying.

I was looking at the shambot macro, and thinking of trying to implement something like that, but I don't think it would really be worth it since I already have the spellset saved.
Wed Feb 12, 2014 12:57 am
Well, I thought this portion was functional, but further testing shows that it isn't.

Macro
More +

Sub DivineIntervention
/if (${Me.Casting.ID} || ${Me.Moving}) /return
/if (${Me.PctMana}>40) {
        /declare x int local
        /declare spellID int local 1546
        /declare findBuff string outer
        /varset findBuff " ${NetBots[${NBToon${x}}].Buff} "
        /for x 1 to ${NetBots.Counts}
                /if ( !${NetBots[${NBToon${x}}].Buff.Find[${spellID}]} || !${NetBots[${NBToon${x}}].ShortBuff.Find[${spellID}]} && ${NetBots[${NBToon${x}}].InZone} && ${NetBots[${NBToon${x}}].InGroup} && ${Cast.Ready[${di}]} ) {
                /echo ${NetBots[${NBToon${x}}].Name}
                /echo ${NetBots[${NBToon${x}}].Buff}
                /echo ${findBuff}
                        /delay 1s
                        /g Casting ${di} on %t
                        /casting ${di} gem${diGem} -maxtries|5 -targetid|${NetBots[${NBToon${x}}].ID}
                }
        /next x
}
/return


${NetBots[${NBToon${x}}].Buff.Find[${spellID}]} returns NULL

What is the proper method to search a NetBots client for a specific buff?

I also tried dropping it into a variable, /varset findBuff " ${NetBots[${NBToon${x}}].Buff} " but this returns NULL as well, I might be giving the variable the wrong type, as it's an array of int, but the example I saw declared it as string.
Wed Feb 12, 2014 2:18 am
Goto page 1, 2, 3  Next Public Macros Looking for some help on this Cleric macro
Reply