Skip to content

Instantly share code, notes, and snippets.

@StinkyTwitch
Last active August 29, 2015 14:15
Show Gist options
  • Save StinkyTwitch/fbf5320ad23a36065a30 to your computer and use it in GitHub Desktop.
Save StinkyTwitch/fbf5320ad23a36065a30 to your computer and use it in GitHub Desktop.
Using dynamicEval with custom PE registers
ProbablyEngine.condition.register("power.regen", function(target)
return select(2, GetPowerRegen(target))
end)
ProbablyEngine.condition.register("gcd", function(target)
local gcd = (1.5/GetHaste(target))
if gcd < 1 then
return 1
else
return gcd
end
end)
local function dynamicEval(condition, spell)
if not condition then return false end
return ProbablyEngine.dsl.parse(condition, spell or '')
end
{ "spell name",
{
"condition1",
"condtion2",
(function()
return( dynamicEval("player.energy") + (dynamicEval("player.power.regen")*dynamicEval("player.gcd")) < 50 )
end)
"condition4",
}, "target", },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment