It should probably be noted that we do have access to a few nifty functions in the secure environment to help us determine what actions to display:
Lua Code:
local newPage = 0
if HasVehicleActionBar() then
newPage = GetVehicleBarIndex() or 0
elseif HasOverrideActionBar() then
newPage = GetOverrideBarIndex() or 0
elseif HasTempShapeshiftActionBar() then
newPage = GetTempShapeshiftBarIndex() or 0
else
newPage = 0
end
return newPage