Zone-based Ability Macro

Hey all, I want to consolidate the Expansion extra abilities into one button and have searched all over and can’t seem to find a macro to use abilities based on zone/location.

Is this do-able? Based on some other sites, I’ve tried the following (and similar) with no success:

#showtooltip
/run if GetZoneText()==572 then BT4Button7=Call to Arms;if GetZoneText()==619 then BT4Button7=Combat Ally;if GetZoneText()==905 then BT4Button7=Vindicaar Matrix Crystal end

or

#showtooltip
/run if GetZoneText()==572 then /cast Call to Arms;if GetZoneText()==619 then /cast Combat Ally;if GetZoneText()==905 then /cast Vindicaar Matrix Crystal end

Elvenbane mentioned a secure button template might work, but I’m not versed in LUA or scripts enough to know where to begin. Any guidance is appreciated.

1 Like

GetZoneText() returns the name, not the ZoneID.

C_Map.GetBestMapForUnit("player")

This will return the zoneid, don’t know if there’s a different, or shorter, way nowadays.