I'm still poking around with NewPull.mac. It's what I use to pull with and it's what I am cutting my teeth on learning how to write these macros. I've spent the last two days, literally almost 48 hours, trying to work out my sub Combat but while I am getting close to something working consistently, it still acts wonky every now and then:
Sub Combat is called from Main sub after the pull sub is complete and character is back at camp. The first if statement in :CombatLoop checks to make sure I have a target and it's not a corpse ( at least that is what I think it is doing). It then used /killthis to attack the mob, the popup statemetn is just to let me know where in the loop/macro things are at. The second if statement is to give the loop a way to break and return to sub Main (not sure I need it). The third if statement just loops me back to :CombatLoop as long as I am still in combat mode. This loop seems to work pretty well.
Where I have an issue is if there are adds. I want to kill all adds before returning to sub Main and looting, but sometimes he gets stuck targeting the first kills corpse, sometimes he doesn't. It's like he can't break out of :CombatLoop even though I think I have the necessary checks in place to break off the corpse and engage the add(s).
I kind of look at Sub Combat as two parts, :CombatLoop to handle the fighting part, and starting with the 4th if statement being able to handle any adds and call back to :CombatLoop. The delay and /target clear were attempts to get him off the corpse. The delay seemed to help with my issue, and in fact I may just need to increase that to fix it completely. The /target clear just does not work and needs to be removed. If you note the /beep after the 4th if statement, again that was a trigger I used to see where the macro was at. What I found before I put the delay in was that even with single pulls I was getting beeps, which by my thinking should not be occurring since there was nothing in XTarget1. SO it seemed that the macro was just going too fast and was shooting through the :CombatLoop. Like I said, the delay improved this issue (I even set Turbo to 80 to try and slow things down).
So, my question is, does this piece of code look ok to those who know better than me (everyone), and I just need to increase the delay, or are their flaws in the logic I used for the loop?
Code:
:CombatLoop
/if (${Target.ID} && ${Target.Type.NotEqual[corpse]}) {
/killthis
/popup FIRST!
/if (!${Target.ID} && !${Me.XTarget}) /return
/if (${Me.CombatState.Equal[COMBAT]}) /goto :CombatLoop
}
/delay 8
/target clear
/if (${Me.XTarget}) {
/beep
/squelch /tar ${Me.XTarget[1]}
|/if (!${Target.LineOfSight}) /face fast
/face fast
/if (${Me.XTarget}) /goto :CombatLoop
}
/return
Sub Combat is called from Main sub after the pull sub is complete and character is back at camp. The first if statement in :CombatLoop checks to make sure I have a target and it's not a corpse ( at least that is what I think it is doing). It then used /killthis to attack the mob, the popup statemetn is just to let me know where in the loop/macro things are at. The second if statement is to give the loop a way to break and return to sub Main (not sure I need it). The third if statement just loops me back to :CombatLoop as long as I am still in combat mode. This loop seems to work pretty well.
Where I have an issue is if there are adds. I want to kill all adds before returning to sub Main and looting, but sometimes he gets stuck targeting the first kills corpse, sometimes he doesn't. It's like he can't break out of :CombatLoop even though I think I have the necessary checks in place to break off the corpse and engage the add(s).
I kind of look at Sub Combat as two parts, :CombatLoop to handle the fighting part, and starting with the 4th if statement being able to handle any adds and call back to :CombatLoop. The delay and /target clear were attempts to get him off the corpse. The delay seemed to help with my issue, and in fact I may just need to increase that to fix it completely. The /target clear just does not work and needs to be removed. If you note the /beep after the 4th if statement, again that was a trigger I used to see where the macro was at. What I found before I put the delay in was that even with single pulls I was getting beeps, which by my thinking should not be occurring since there was nothing in XTarget1. SO it seemed that the macro was just going too fast and was shooting through the :CombatLoop. Like I said, the delay improved this issue (I even set Turbo to 80 to try and slow things down).
So, my question is, does this piece of code look ok to those who know better than me (everyone), and I just need to increase the delay, or are their flaws in the logic I used for the loop?