Determining if I am in a raid group.
I need to make a custom trigger for some of my auras in weakauras. What I want it to do is to prevent the trigger from triggering if I am in a raid group (but not if I am in a party or solo). Weakauras accepts lua for custom triggers but seeing as I am a total noob at lua I am in need of some help.
I suspect I could use UnitInRaid("player") but I have no idea how to construct an actual lua function with it. |
I believe you could accomplish that with the Load conditions without writing a custom trigger.
On the Load tab you'll find "Instance Type". Checking it allows you to pick one from dropdown, clicking it again presents you with a multiple checkbox section for all instance types. Just check the ones you want the aura to load in and leave the rest unchecked. Custom trigger is also relatively easy. You'd want Custom Trigger: Code:
function() Code:
function() This set of pages is also a good resource: http://www.wowace.com/addons/weakauras/pages/ |
Quote:
|
Quote:
It needs to be like that. (I should know as I've been doing maintenance work on it after MoP hit) It's good practice to make sure you return a boolean as you won't be left wondering why they don't work when you rely on 1 or 0 being true. |
Maybe I'm missing something, but doesn't the use of "not" already guarantee a boolean result?
|
Actually using the word "not" will always return a boolean value. "not nil" will become true and "not 0" will become false - so strictly speaking it should work just like, like Haleth mentioned. :)
|
You're not missing anything guys, I maybe worded it wrong, it is redundant in this particular case but users trying to write custom triggers in WeakAuras are best served by having a habit of making sure their custom trigger and untrigger functions return boolean true.
For example while if 1|0|table|'text' then will all evaluate to true for the purpose of the control structure they will not produce the desired result as part of a WeakAura trigger. My reply was pertaining to the specific addon not Lua code in general, sorry for the confusion. |
Quote:
Edit: Never mind! I found I was able to get around this by putting in the unit ID before I turned on full scan and it works. Still curious why the options are limited when you put on full scan though. |
Quote:
|
All times are GMT -6. The time now is 10:05 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI