Detecting the Group Position of an Arena Oppenent
Hey, i got the following macro:
Code:
/focus [@arena1] What i thought about doing is, writing a script which detects the positon of the healer in the enemy arena team and then edits my macro automatically for me. I am aware that this is only working outside of combat, which is fine, because i just want it to work during the preparation time. Also i dont mind if i have to fire the script manually while waiting in the prep zone. Because Blizzard already implemented the detection of the enemy specs during the prep phase i thought i could use this to filter the enemy team. The idea is to listen for the event that fires when information about arena opponents are available. Then use it to get information about enemy specializations. In the end filter the information to get the postion of the healer in the enemy team. Code:
local f=CreateFrame("Frame") |
A few problems with your code that should be raising errors in-game:
Other than that you're definitely on the right track. I'd suggest checking for InCombatLockdown() before proceeding with anything else in the event handler, just in case. I'd also use some nice variables at the top to contain the desired macro name and template, so it's easier to customize them, eg. Code:
local MACRO_NAME = "FocusHealer" Finally, go get BugSack. The default error display, even if you have it enabled, is simply not good enough for addon development, as it is incapable of showing errors that occur early in the loading sequence -- and that's where most of your errors will occur during development. Being able to see the error messages your code is raising is invaluable, as the message will tell you exactly what the problem is, and exactly where in your code it is. |
All times are GMT -6. The time now is 08:09 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI