Last active
August 29, 2015 14:15
-
-
Save StinkyTwitch/fbf5320ad23a36065a30 to your computer and use it in GitHub Desktop.
Using dynamicEval with custom PE registers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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