Simple Macro

burdsjm

Lifetimer
Joined
May 18, 2007
Messages
670
Reaction score
21
Points
18
I have a simple macro that I currently use as a hotkey.

I'd like to just have a run a macro and then end.

/timed 3
/target pc tank next
/if (${If[!${Target.Buff[Ennui].ID},TRUE,FALSE]}) /casting "Ennui Rk. II" gem13

How do I make it loop and then stop when he can't find any new tanks?"

Thanks!
 
I've never used the "/target pc tank next" command, by I am guess it cycles through all the pc tanks in the zone?

You'd need to record the name of the first tank when you start buffing, if it comes back to that tank name, stop it.

Or you could also count how many tanks are in the zone, and only cycle through that many times.

Here is a quick half arsed macro to give you an idea. (I didn't test it so sorry for any typos)

Code:
Sub Main
/declare FirstTank string outer



/timed 3
/target pc tank next
/delay 5
/varset FirstTank ${Target.Name} 

:NextBuff
/if (${If[!${Target.Buff[Ennui].ID},TRUE,FALSE]}) /casting "Ennui Rk. II" gem13
/delay 10s !${Me.Casting.ID}
/timed 3
/target pc tank next
/delay 5
/if ${FirstTank}!=${Target.Name} /goto :NextBuff
/echo We are targeting original tank, ending macro.
/end
 
  • Like
Reactions: EQDAB
Failed to parse /delay condition '!Ennui Rk. II, non-numeric encountered
 
timed command should be used with the slash command you intend to fire.

Code:
/timed 3 /target pc tank next

On separate lines it's likely parsing them as separate commands.

Also, I'm not sure I understand the purpose of using a timed command here.

For clarity.

Code:
/timed ## /commandToUse

means in ## amount of 10ths of a second, use this command. But keep processing code.

So in your command you'd saying in 3 tenths of a second, issue the /target command. (assuming that's the original intent)

Then you
Code:
/delay 5
. So you'd be down to a /delay 2 by the time the command even fired. If the intent of the delay is to wait until you have the target. then I'm not sure I see a point in the timed command at all.

You also have
Code:
${If[!${Target.Buff[Ennui].ID},TRUE,FALSE]}
Which is an exaggerated way of getting the result.
Code:
!${Target.Buff[Ennui].ID}
processes the result the same way. Which is to say that if the target doesn't have a buff that starts with "Ennui".

Code:
/if ${FirstTank}!=${Target.Name} /goto :NextBuff
You can't compare names in this fashion using macros. You'll have to instead say

Code:
/if (${FirstTank.NotEqual[${Target.Name}]}) /goto :NextBuff


You could avoid an unnesseary delay by putting the casting logic all into a block statement. Since you're running in a loop, you can avoid accidental bypass of a target because you issue a casting command, but then immediately check to see if you're not casting by adding a delay that makes sure you start casting first.

Code:
	/if (!${Target.Buff[Ennui].ID}) {
		/casting "Ennui Rk. II" gem13
		/delay 1s ${Me.Casting.ID}
		/delay 10s !${Me.Casting.ID}
	}

You can force clear your target using
Code:
/target clear
, with a
Code:
/squelch
at the start of it to keep it from outputting to the mq2 window. That way when you
Code:
/target pc tank next
you can create an early stop on your delay to stop the delay if you have a target id.

Code:
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}

You can use a while loop instead of a goto statement. But either way works.

Code:
Sub Main
	/declare FirstTank string outer
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/varset FirstTank ${Target.Name} 

	:NextBuff
	/if (!${Target.Buff[Ennui].ID}) {
		/casting "Ennui Rk. II" gem13
		/delay 1s ${Me.Casting.ID}
		/delay 10s !${Me.Casting.ID}
	}
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/if (${FirstTank.NotEqual[${Target.Name}]}) /goto :NextBuff
	/echo We are targeting original tank, ending macro.
/return
 
  • Love
Reactions: EQDAB
Code:
Sub Main
	/declare FirstTank string outer
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/varset FirstTank ${Target.Name} 

	:NextBuff
	/if (!${Target.Buff[Ennui].ID}) {
		/casting "Ennui Rk. II" gem13
		/delay 1s ${Me.Casting.ID}
		/delay 10s !${Me.Casting.ID}
	}
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/if (${FirstTank.NotEqual[${Target.Name}]}) /goto :NextBuff
	/echo We are targeting original tank, ending macro.
/return
[/QUOTE]


This targets a tank then casts it one time and then immediately says we are targeting original tank, ending macro.
 
Clear thinker here

Code:
Sub Main
	/declare FirstTank string outer
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/varset FirstTank ${Target.Name} 

	:NextBuff
	/if (!${Target.Buff[Ennui].ID}) {
		/casting "Ennui Rk. II" gem13
		/delay 1s ${Me.Casting.ID}
		/delay 10s !${Me.Casting.ID}
	}
	/squelch /target clear
	/delay 1s !${Target.ID}
	/target pc tank next
	/delay 1s ${Target.ID}
	/if (${FirstTank.NotEqual[${Target.Name}]}) /goto :NextBuff
	/echo We are targeting original tank, ending macro.
/return


This targets a tank then casts it one time and then immediately says we are targeting original tank, ending macro.[/QUOTE]


Direct to the point, waste-free coding. :cool: