Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stealth checking support #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CleverMacro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ local function GetMouseOverUnit()
end
end

local function HasBuff(textureName)
for i = 1, 16 do
if UnitBuff("player", i) == textureName then
return true;
end
end

return false;
end

local function TestConditions(conditions, target)
local result = true

Expand All @@ -150,7 +160,9 @@ local function TestConditions(conditions, target)
elseif mod == "dead" then
result = UnitIsDead(target) or UnitIsGhost(target)
elseif mod == "combat" then
result = UnitAffectingCombat("player")
result = UnitAffectingCombat("player")
elseif mod == "stealth" then
result = HasBuff("Interface\\Icons\\Ability_Ambush")
elseif mod == "mod" or mod == "modifier" then
if v == true then
result = IsAltKeyDown() or IsControlKeyDown() or IsShiftKeyDown()
Expand Down