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.
Code:
[overridebar][vehicleui][possessbar,@vehicle,exists]
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:
local function OnEvent(self, event)
print(event)
local vehicleui = SecureCmdOptionParse("[vehicleui] 1; 0")
local possessbar = SecureCmdOptionParse("[possessbar] 1; 0")
local overridebar = SecureCmdOptionParse("[overridebar] 1; 0")
local shapeshift = SecureCmdOptionParse("[shapeshift] 1; 0")
local bonusbar = SecureCmdOptionParse("[bonusbar] 1; 0")
if vehicleui == "1" then print("vehicleui") end
if possessbar == "1" then print("possessbar") end
if overridebar == "1" then print("overridebar") end
if shapeshift == "1" then print("shapeshift") end
if bonusbar == "1" then print("bonusbar") end
print("barpage: "..GetActionBarPage())
print("type: "..type(vehicleui))
end
local barCheck = CreateFrame("Frame")
barCheck:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
barCheck:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR")
barCheck:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR")
barCheck:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
barCheck:SetScript("OnEvent", OnEvent)