WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   New Macro Conditionals? (https://www.wowinterface.com/forums/showthread.php?t=48417)

Vrul 10-27-13 06:06 PM

New Macro Conditionals?
 
Have these been posted before? I don't remember seeing them before: canexitvehicle, cursor, resting, shapeshift

canexitvehicle - seems self explanitory
cursor - true if the cursor is dragging a spell or item
resting - true if you're resting (in town/getting rested xp)
shapeshift - not tested but I think it follows HasTempShapeshiftActionBar (didn't trigger for druid forms)

Provided that I'm right about shapeshift, then would:
Code:

SecureCmdOptionParse("[vehicleui] [possessbar] 12; [overridebar] 14; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; [bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10; [bonusbar:5] 11; 1")
be correct for determining the correct action bar page?

zork 10-28-13 03:05 AM

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:
  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
  16.  
  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)

pelf 10-28-13 04:42 PM

Quote:

Originally Posted by Vrul (Post 286294)
cursor - true if the cursor is dragging a spell or item

Is a macro currently being moved, that used to be in an action bar slot bound to, say, Q, able to be activated by Q until it is dropped? If not, what could the use of this conditional be? Secure template attributes?

AnrDaemon 11-05-13 03:43 AM

Quote:

Originally Posted by Vrul (Post 286294)
cursor - true if the cursor is dragging a spell or item

Could you, please, elaborate on it? What I really want to know, is how certain you are, that this is "dragging something", and not just cursor has activated effect (i.e. Resurrection spell was cast without explicit target), which makes a bit more sense to me?

Lombra 11-05-13 10:19 AM

Quote:

Originally Posted by AnrDaemon (Post 286685)
Could you, please, elaborate on it? What I really want to know, is how certain you are, that this is "dragging something", and not just cursor has activated effect (i.e. Resurrection spell was cast without explicit target), which makes a bit more sense to me?

I thought the same, but I tried it, and it works as described.

Vrul 11-05-13 11:29 AM

Quote:

Originally Posted by AnrDaemon (Post 286685)
Could you, please, elaborate on it? What I really want to know, is how certain you are, that this is "dragging something", and not just cursor has activated effect (i.e. Resurrection spell was cast without explicit target), which makes a bit more sense to me?

I thought it would be for the glowing active spell cursor too. Then I thought it would be if the cursor was over something/someone you could right click to interact with. The only use I can think of is for a secure handler to check during it's OnClick to see if it should do it's OnDragStop instead.

AnrDaemon 11-05-13 02:51 PM

Interesting, thanks.


All times are GMT -6. The time now is 06:17 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI