Reply
 
Thread Tools Display Modes
Unread 10-27-13, 06:06 PM   #1
Vrul
A Cobalt Mageweaver
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 208
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?
Vrul is offline   Reply With Quote
Unread 10-28-13, 03:05 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
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)
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | 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.
zork is offline   Reply With Quote
Unread 10-28-13, 04:42 PM   #3
pelf
Sentient Plasmoid
 
pelf's Avatar
Premium Member
Join Date: May 2008
Posts: 128
Originally Posted by Vrul View Post
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?

Last edited by pelf : 10-28-13 at 04:43 PM. Reason: clarity
pelf is offline   Reply With Quote
Unread 11-05-13, 03:43 AM   #4
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 115
Originally Posted by Vrul View Post
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?
AnrDaemon is offline   Reply With Quote
Unread 11-05-13, 10:19 AM   #5
Lombra
A Cobalt Mageweaver
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 242
Originally Posted by AnrDaemon View Post
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.
__________________
Grab your sword and fight the Horde!
Lombra is offline   Reply With Quote
Unread 11-05-13, 11:29 AM   #6
Vrul
A Cobalt Mageweaver
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 208
Originally Posted by AnrDaemon View Post
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.
Vrul is offline   Reply With Quote
Unread 11-05-13, 02:51 PM   #7
AnrDaemon
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 115
Interesting, thanks.
AnrDaemon is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » General Authoring Discussion » New Macro Conditionals?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off