Script that can execute a macro upon changing (PvP) talents
I have a macro that I would like to run every time I change a PvP Talent. Is that possible to do? Thanks guys!
|
I'm sure there's a much more elegant solution, but I came up with this quickly:
Code:
/run local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_PVP_TALENT_UPDATE") f:SetScript("OnEvent", function() print("HelloWorld") end) Or if you want to put it in an addon... Lua Code:
|
That's awesome! Do you think its possible to have that script activate a macro that's on my bars?
If it helps, this is the macro I'm running: #showtooltip /run local G=GetSpellInfo SetMacroSpell(GetRunningMacro(), G"Thoughtsteal" or G"Shadowfiend") I'm using it just for displaying the tooltip (to try and never see that blank "?" on my bars). |
https://wow.gamepedia.com/API_EditMacro
Before installing this script, create a macro called "myFavouriteMacro" and drag it to an action bar. You can turn the script into an addon using https://addon.bool.no/ Lua Code:
|
You are the motherf**king MVP thank you!!!
|
Great script!
I also managed to use it for my racial, when I am in Merc mode inside BG. By chancing the Event from "PLAYER_PVP_TALENT_UPDATE" to "PLAYER_ENTERING_WORLD" I do wonder if it is possible for the macro to show a greyed out icon if non of the 2 PvP talents are selected? Or perhaps a regular spell, instead of it showing a question mark icon. |
I have never used merc mode, but I'm going to guess that UNIT_FACTION would fire with arg1="player". You might also be able to try SPELLS_CHANGED?
For your fall-back question.... here is a solution that lets you use as many spells as you want. Lua Code:
|
Quote:
The UNIT_FACTION and SPELLS_CHANGED did some seem the fix it a bit. As soon as I join a BG is updates correctly. But if I launch the game for the first time and login, it shows a red question mark. The macro icon does update if I switch a PvP talent on just reload again. Its like the script is not firing the first time you login into the game. I did like your first version for spells a bit better. Since I could make 2 separate macros for those 2 spells, instead it only be a /cast "spellname" macro. Is there a possibility to have a combination of those 2 scripts? And be able to make a list of different macros? Like: macro1 = [=[awesomemacro1]=] macro2 = [=[awesomemacro2]=] macro3 = [=[awesomemacro3]=] macro4 = [=[awesomemacro4]=] I am not sure if that's even possible. Thanks a lot of the work you already did. I am really happy that there is a nice script for the racial abilities now. |
I think its just missing PLAYER_LOGIN
|
Quote:
Even together, not sure why it is not triggering. |
All times are GMT -6. The time now is 03:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI