Quantcast WoWInterface - View Single Post - New Macro Conditionals?
View Single Post
10-28-13, 03:05 AM   #2
A Pyroguard Emberseer
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,685
Good question. Basically you need to write a function that checks the return value of your SecureCmdOptionParse against the return value of GetActionBarPage().

Last year or so we had quite some issues on the Amber-Shaper Un'sok encounter. That encounter uses the overridebar but the state to spawn it is the progressbar-state.
If you start out a new Deathknight one of the first quests will be the eye. That will activate under progressbar-state aswell but this time swap out the main actionbar.

There was another event ... Feast or sth. Where you sit on a table. Another progressbar-state. But again using the override bar.

I need to activate the overridebar under certain circumstances, so I had to change the condition to include progressbar and check for the vehicle unit at the same time.
So I doubt that the progressbar-state delivers the same actionbar page all the time. But with factoring in the vehicle unit it may work.

Lua Code:
  1. local function OnEvent(self, event)
  2.   print(event)
  3.   local vehicleui = SecureCmdOptionParse("[vehicleui] 1; 0")
  4.   local possessbar = SecureCmdOptionParse("[possessbar] 1; 0")
  5.   local overridebar = SecureCmdOptionParse("[overridebar] 1; 0")
  6.   local shapeshift = SecureCmdOptionParse("[shapeshift] 1; 0")
  7.   local bonusbar = SecureCmdOptionParse("[bonusbar] 1; 0")
  8.   if vehicleui == "1" then print("vehicleui") end
  9.   if possessbar == "1" then print("possessbar") end
  10.   if overridebar == "1" then print("overridebar") end
  11.   if shapeshift == "1" then print("shapeshift") end
  12.   if bonusbar == "1" then print("bonusbar") end
  13.   print("barpage: "..GetActionBarPage())
  14.   print("type: "..type(vehicleui))
  15. end
  17. local barCheck = CreateFrame("Frame")
  18. barCheck:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
  19. barCheck:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR")
  20. barCheck:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR")
  21. barCheck:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
  22. barCheck:SetScript("OnEvent", OnEvent)
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-28-13 at 03:25 AM.
  Reply With Quote