Highlighting spells based on player resources
BanditTech opened this issue ยท 3 comments
Which version of AdiButtonAuras are you using (enter the exact version number here)?
9.0.2
How did you install the addon (twitch client/manually)?
wowup
If using the twitch client, what type of release did you install (alpha/beta/release)?
release
If you installed manually, where did you download the addon from?
Which type of installation did you choose (nolib/normal)?
normal
If your report is about a missing or wrong spell provide the following information:
- Your class: priest
- Your spec: shadow
- Name of the spell (and spell id if known): Shadow Mend 186263
- Source of the spell (core ability/talent/pvp): core ability
- Do you use a macro to cast the spell (post the macro if so): yes
#showtooltip
/cast [@cursor,spec:2] Holy Word: Sanctify;[@mouseOver,exists,noharm,spec:1/3][spec:1/3]Shadow Mend
If you have an error report, copy it below:
I am not having an issue persay, but am attempting to use your API to make custom highlight rules
I have looked through the documentation, but there are no other examples beyond the one provided in the default template. I figured it was nearly identical to the template so it should not be an issue, but it is not working. Maybe I am missing something?
-- https://github.com/AdiAddons/AdiButtonAuras/blob/master/doc/RulesRef.md#user-rules
return Configure {
-- Unique Id
"ShadowMend",
-- Description
"Hint when the player is below 100% health.",
-- Spells to modify
{
186263 -- Shadow Mend
},
-- Unit(s) to watch
"player",
-- Event(s) to watch
{ "UNIT_HEALTH", "UNIT_MAXHEALTH" },
-- Callback
function(units, model)
if UnitHealth(units.player) / UnitHealthMax(units.player) < 1 then
model.hint = true
end
end
}
I have it at 100% for testing, but would like to eventually figure how to make it trigger when in combat, able to cast, and below 60%
ok, I figured this out after doing a /rl and it started working in combat.
I was not reloading the ui to test when I was editing it, and it did not seem to take effect.
After reloading the UI it is working, and only while in combat :D ๐
[string "-- https://github.com/AdiAddons/AdiButtonAu..."]:24: Using 'IsUsableSpell' is forbidden.
[string "=[C]"]: ?
[string "@Interface\AddOns\AdiButtonAuras\core\SafeEnv.lua"]:89: in function <Interface\AddOns\AdiButtonAuras\core\SafeEnv.lua:84>
[string "-- https://github.com/AdiAddons/AdiButtonAuras/blob/master/doc/RulesRef.md#user-rules
return Configure {
-- Unique Id
"ShadowMend",
-- Description
"Hint when the player is below 60% health.",
-- Spells to modify
{
186263 -- Shadow Mend
},
-- Unit(s) to watch
"player",
-- Event(s) to watch
{ "UNIT_HEALTH", "UNIT_MAXHEALTH" },
-- Callback
function(units, model)
if UnitHealth(units.player) / UnitHealthMax(units.player) < 1 and IsUsableSpell("Shadow Mend") then
model.hint = true
end
end
}
"]:24: in function `handler'
[string "@Interface\AddOns\AdiButtonAuras\core\Overlays.lua"]:528: in function <Interface\AddOns\AdiButtonAuras\core\Overlays.lua:517>
(*temporary) = "Using 'IsUsableSpell' is forbidden."
[string "-- https://github.com/AdiAddons/AdiButtonAu..."]:24: Using 'GetSpellPowerCost' is forbidden.
[string "=[C]"]: ?
[string "@Interface\AddOns\AdiButtonAuras\core\SafeEnv.lua"]:89: in function <Interface\AddOns\AdiButtonAuras\core\SafeEnv.lua:84>
[string "-- https://github.com/AdiAddons/AdiButtonAuras/blob/master/doc/RulesRef.md#user-rules
return Configure {
-- Unique Id
"ShadowMend",
-- Description
"Hint when the player is below 60% health.",
-- Spells to modify
{
186263 -- Shadow Mend
},
-- Unit(s) to watch
"player",
-- Event(s) to watch
{ "UNIT_HEALTH", "UNIT_MAXHEALTH","UNIT_MANA" },
-- Callback
function(units, model)
if UnitHealth(units.player) / UnitHealthMax(units.player) < 1 and UnitPower(units.player,0) > GetSpellPowerCost("Shadow Mend") then
model.hint = true
end
end
}
"]:24: in function `handler'
[string "@Interface\AddOns\AdiButtonAuras\core\Overlays.lua"]:528: in function <Interface\AddOns\AdiButtonAuras\core\Overlays.lua:517>
(*temporary) = "Using 'GetSpellPowerCost' is forbidden."
Am I just out of luck on trying to do this?