Advanced Druid Boomkin - Detecting more surrounding Eclipse menu

Shout-Out

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any updates nessk?

    Advanced Druid Boomkin - Detecting more surrounding Eclipse
  2. #17
    NessK's Avatar Member
    Reputation
    13
    Join Date
    Jan 2015
    Posts
    100
    Thanks G/R
    2/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I got most of the added things in. Shift will now PAUSE the rotation. ALT will heal your butt off if you so choose.

    Remember, to use this properly you will have to make the change to core.lua (scroll up you will see the line that needs to be entered).

    Let me know what you think !

    Code:
    ProbablyEngine.rotation.register(102, {
    
      --------------------
      -- Start Rotation --
      --------------------
      
      -- Lets Pause ?
      { "pause", "modifier.lshift" },
      
      --Lets Heal ourselves with ALT key
      { "Rejuvenation", {"modifier.alt", "!player.buff(Rejuvenation)"}}, 
      { "Healing Touch", {"modifier.alt", "player.buff(Rejuvenation)"}}, 
      
      -- Interupts
      { "Solar Beam", "modifier.interrupts"},
      { "War Stomp", { "target.range <= 8", "modifier.interrupts" }},
      { "Typhoon",   { "target.range <= 8", "modifier.interrupts" }},
      
      -- Lets check our state.. 
      { "/cancelform", "player.buff(Cat Form)" },
      { "/cancelform", "player.buff(Bear Form)" },
      { "Moonkin Form", "!player.buff(Moonkin Form)"},
      
      -- Mouseover Support
      { "Moonfire", {"!mouseover.debuff(Moonfire)", "mouseover.enemy"}, "mouseover" },
      { "Sunfire",  {"!mouseover.debuff(Sunfire)",  "mouseover.enemy"}, "mouseover" },
      { "Rebirth", "!mouseover.alive", "mouseover" },
    
      -- Cooldowns
      { "Celestial Alignment",  "modifier.cooldowns" },
      { "Stellar Flare", {"modifier.cooldowns", "!target.debuff(Stellar Flare)", "!lastcast(Stellar Flare)" }},
      { "Incarnation: Chosen of Elune",  "modifier.cooldowns"}, 
      
      -- Refresh DOTs
      { "Moonfire",   "target.debuff(Moonfire).duration < 3"					},
      { "Sunfire",   "target.debuff(Sunfire).duration < 3"					},
    
      { "Sunfire",  "!target.debuff(Sunfire)"},
      { "Moonfire",  "!target.debuff(Moonfire)"},
      { "Starsurge",  {"!player.buff(Lunar Empowerment)", "player.enumber < 1" , "!modifier.multitarget" 						}},
      { "Starsurge",  {"!player.buff(Solar Empowerment)", "player.enumber > 0",  "!modifier.multitarget"  }}, 
      { "Starfall",   {"modifier.multitarget", "!player.buff(Starfall)" 							}},
       
       -- Walking
      { "Starsurge", "player.moving" },
      { "Sunfire",  "player.moving" },
      { "Moonfire",  "player.moving"},
       
       -- Starsurge Check 
      { "Starsurge",  {"player.buff(Shooting Stars)", "player.enumber < 0", "player.balance.moon", "!modifier.multitarget"  	}}, 
      { "Moonfire",   {"player.enumber < 0", "target.debuff(Moonfire).duration < 2"					}},
      { "Sunfire",    {"player.enumber > 0", "target.debuff(Sunfire).duration < 2"					}},
      { "Starfire", "player.buff(Celestial Alignment)"}, 
      { "Starfire", {"player.enumber < 60", "player.balance.moon", "player.buff(Lunar Empowerment)"}},
      { "Starfire", {"player.enumber < -60", "player.buff(Lunar Empowerment)"					}},
      { "Wrath",	   {"player.balance.sun", "player.enumber > 0", "player.buff(Solar Empowerment)"}},
      { "Wrath",		{ "player.balance.moon", "player.enumber > 60", "player.buff(Solar Empowerment)"}}, 
      { "Starfire", {"player.enumber < 60", "player.balance.moon"}},
      { "Starfire", "player.enumber < -60"							},
      { "Wrath",	   {"player.balance.sun", "player.enumber > 0"}},
      { "Wrath",		{ "player.balance.moon", "player.enumber > 60"}},
      { "Wrath", {"player.balance.sun", "player.enumber > -30"}},
     
      }
        )

  3. #18
    ImogenOC's Avatar Contributor ProbablyEngine Community Manager
    Reputation
    173
    Join Date
    Nov 2013
    Posts
    364
    Thanks G/R
    0/8
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by NessK View Post
    Ok. I got most of the added things in. Shift will now PAUSE the rotation. ALT will heal your butt off if you so choose.

    Remember, to use this properly you will have to make the change to core.lua (scroll up you will see the line that needs to be entered).

    Let me know what you think !

    Code:
    ProbablyEngine.rotation.register(102, {
    
      --------------------
      -- Start Rotation --
      --------------------
      
      -- Lets Pause ?
      { "pause", "modifier.lshift" },
      
      --Lets Heal ourselves with ALT key
      { "Rejuvenation", {"modifier.alt", "!player.buff(Rejuvenation)"}}, 
      { "Healing Touch", {"modifier.alt", "player.buff(Rejuvenation)"}}, 
      
      -- Interupts
      { "Solar Beam", "modifier.interrupts"},
      { "War Stomp", { "target.range <= 8", "modifier.interrupts" }},
      { "Typhoon",   { "target.range <= 8", "modifier.interrupts" }},
      
      -- Lets check our state.. 
      { "/cancelform", "player.buff(Cat Form)" },
      { "/cancelform", "player.buff(Bear Form)" },
      { "Moonkin Form", "!player.buff(Moonkin Form)"},
      
      -- Mouseover Support
      { "Moonfire", {"!mouseover.debuff(Moonfire)", "mouseover.enemy"}, "mouseover" },
      { "Sunfire",  {"!mouseover.debuff(Sunfire)",  "mouseover.enemy"}, "mouseover" },
      { "Rebirth", "!mouseover.alive", "mouseover" },
    
      -- Cooldowns
      { "Celestial Alignment",  "modifier.cooldowns" },
      { "Stellar Flare", {"modifier.cooldowns", "!target.debuff(Stellar Flare)", "!lastcast(Stellar Flare)" }},
      { "Incarnation: Chosen of Elune",  "modifier.cooldowns"}, 
      
      -- Refresh DOTs
      { "Moonfire",   "target.debuff(Moonfire).duration < 3"					},
      { "Sunfire",   "target.debuff(Sunfire).duration < 3"					},
    
      { "Sunfire",  "!target.debuff(Sunfire)"},
      { "Moonfire",  "!target.debuff(Moonfire)"},
      { "Starsurge",  {"!player.buff(Lunar Empowerment)", "player.enumber < 1" , "!modifier.multitarget" 						}},
      { "Starsurge",  {"!player.buff(Solar Empowerment)", "player.enumber > 0",  "!modifier.multitarget"  }}, 
      { "Starfall",   {"modifier.multitarget", "!player.buff(Starfall)" 							}},
       
       -- Walking
      { "Starsurge", "player.moving" },
      { "Sunfire",  "player.moving" },
      { "Moonfire",  "player.moving"},
       
       -- Starsurge Check 
      { "Starsurge",  {"player.buff(Shooting Stars)", "player.enumber < 0", "player.balance.moon", "!modifier.multitarget"  	}}, 
      { "Moonfire",   {"player.enumber < 0", "target.debuff(Moonfire).duration < 2"					}},
      { "Sunfire",    {"player.enumber > 0", "target.debuff(Sunfire).duration < 2"					}},
      { "Starfire", "player.buff(Celestial Alignment)"}, 
      { "Starfire", {"player.enumber < 60", "player.balance.moon", "player.buff(Lunar Empowerment)"}},
      { "Starfire", {"player.enumber < -60", "player.buff(Lunar Empowerment)"					}},
      { "Wrath",	   {"player.balance.sun", "player.enumber > 0", "player.buff(Solar Empowerment)"}},
      { "Wrath",		{ "player.balance.moon", "player.enumber > 60", "player.buff(Solar Empowerment)"}}, 
      { "Starfire", {"player.enumber < 60", "player.balance.moon"}},
      { "Starfire", "player.enumber < -60"							},
      { "Wrath",	   {"player.balance.sun", "player.enumber > 0"}},
      { "Wrath",		{ "player.balance.moon", "player.enumber > 60"}},
      { "Wrath", {"player.balance.sun", "player.enumber > -30"}},
     
      }
        )
    It's so adorable to see my code style be adopted.
    ProbablyEngine - Developer and Lead Support
    A Powerful Rotation Bot: ProbablyEngine

  4. #19
    NessK's Avatar Member
    Reputation
    13
    Join Date
    Jan 2015
    Posts
    100
    Thanks G/R
    2/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have fought for years for people to use it. The 7 line arguments are ugly as hell.

  5. #20
    ImogenOC's Avatar Contributor ProbablyEngine Community Manager
    Reputation
    173
    Join Date
    Nov 2013
    Posts
    364
    Thanks G/R
    0/8
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by NessK View Post
    I have fought for years for people to use it. The 7 line arguments are ugly as hell.
    I agree... I use it in my private profiles. Public get's the 40 line args.
    ProbablyEngine - Developer and Lead Support
    A Powerful Rotation Bot: ProbablyEngine

  6. #21
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you nessk.

    could you elaborate how "player.enumber" works, because i still have the issue that my sunfire falls of because the rotation doesn't refreshes it before leaving solar if the dot has only 10s remaining (with euphoria, 20 without).

  7. #22
    NessK's Avatar Member
    Reputation
    13
    Join Date
    Jan 2015
    Posts
    100
    Thanks G/R
    2/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using my rotation ?

    If your not, can you paste yours please. Also, did you make the change to core.lua ?

  8. #23
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Advanced Druid Boomkin - Detecting more surrounding Eclipse-l8rdaf0-jpg

    yes im using your rotation. this is a fight log from gruul lfr. Dot uptime is not ok. As Mentioned the Problem is the Rotation isnt considering the Eclipse rotation into deciding when to refresh a dot. it just sees the time left on the dot and refreshes it if its possible with the current ecplise. If not then it refreshes the Dot at entering the Eclipse

    Moonfarespam: The Moonkin Guide (6.0.x) - Forums - World of Warcraft

    Advanced Druid Boomkin - Detecting more surrounding Eclipse-e3wcjmz-jpg

  9. #24
    NessK's Avatar Member
    Reputation
    13
    Join Date
    Jan 2015
    Posts
    100
    Thanks G/R
    2/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah. Something is wrong here. Paste your core.lua please.

  10. #25
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by NessK View Post
    Yeah. Something is wrong here. Paste your core.lua please.

    Code:
    -- ProbablyEngine Rotations
    -- Released under modified BSD, see attached LICENSE.
    
    local GetTime = GetTime
    local GetSpellBookIndex = GetSpellBookIndex
    local UnitCastingInfo = UnitCastingInfo
    local UnitChannelInfo = UnitChannelInfo
    local UnitClassification = UnitClassification
    local UnitIsDeadOrGhost = UnitIsDeadOrGhost
    local UnitIsPlayer = UnitIsPlayer
    local UnitName = UnitName
    local stringFind = string.find
    local stringLower = string.lower
    local stringGmatch = string.gmatch
    
    local ProbablyEngineTempTable1 = { }
    local rangeCheck = LibStub("LibRangeCheck-2.0")
    local LibDispellable = LibStub("LibDispellable-1.0")
    local LibBoss = LibStub("LibBossIDs-1.0")
    
    local UnitBuff = function(target, spell, owner)
        local buff, count, caster, expires, spellID
        if tonumber(spell) then
        local i = 0; local go = true
        while i <= 40 and go do
            i = i + 1
            buff,_,_,count,_,_,expires,caster,_,_,spellID = _G['UnitBuff'](target, i)
            if not owner then
            if spellID == tonumber(spell) and caster == "player" then go = false end
            elseif owner == "any" then
            if spellID == tonumber(spell) then go = false end
            end
        end
        else
        buff,_,_,count,_,_,expires,caster = _G['UnitBuff'](target, spell)
        end
        return buff, count, expires, caster
    end
    
    local UnitDebuff = function(target, spell, owner)
        local debuff, count, caster, expires, spellID
        if tonumber(spell) then
        local i = 0; local go = true
        while i <= 40 and go do
            i = i + 1
            debuff,_,_,count,_,_,expires,caster,_,_,spellID,_,_,_,power = _G['UnitDebuff'](target, i)
            if not owner then
            if spellID == tonumber(spell) and caster == "player" then go = false end
            elseif owner == "any" then
            if spellID == tonumber(spell) then go = false end
            end
        end
        else
        debuff,_,_,count,_,_,expires,caster = _G['UnitDebuff'](target, spell)
        end
        return debuff, count, expires, caster, power
    end
    
    ProbablyEngine.condition.register("dispellable", function(target, spell)
        if LibDispellable:CanDispelWith(target, GetSpellID(GetSpellName(spell))) then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff", function(target, spell)
        local buff,_,_,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff.any", function(target, spell)
        local buff,_,_,caster = UnitBuff(target, spell, "any")
        if not not buff then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff.count", function(target, spell)
        local buff,count,_,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return count
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("debuff", function(target, spell)
        local debuff,_,_,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("debuff.any", function(target, spell)
        local debuff,_,_,caster = UnitDebuff(target, spell, "any")
        if not not debuff then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("debuff.count", function(target, spell)
        local debuff,count,_,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return count
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("debuff.duration", function(target, spell)
        local debuff,_,expires,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return (expires - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("buff.duration", function(target, spell)
        local buff,_,expires,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return (expires - GetTime())
        end
        return 0
    end)
    
    
    --[[
    ProbablyEngine.condition.register("aura.", function(target, spell)
        local guid = UnitGUID(target)
        if guid then
            local unit = ProbablyEngine.module.tracker.units[guid]
            if unit then
                local aura = unit.auras[GetSpellID(spell)]
                local track = false
                if aura['damage'] and not aura['heal'] then
                    track = aura['damage']
                elseif aura['heal'] and not aura['damage'] then
                    track = aura['heal']
                end
                if track then
                    return track.
                end
            end
        end
        return false
    end)
    ]]
    
    local function smartQueryTracker(target, spell, key)
        local guid = UnitGUID(target)
        if guid then
            local unit = ProbablyEngine.module.tracker.units[guid]
            if unit then
                local aura = unit.auras[GetSpellID(spell)]
                if aura then
                    local track = false
                    if key == 'stacks' or key == 'time' then
                        track = aura
                    else
                        if aura['damage'] and not aura['heal'] then
                            track = aura['damage']
                        elseif aura['heal'] and not aura['damage'] then
                            track = aura['heal']
                        end
                    end
                    if track then
                        return track[key]
                    end
                end
            end
        end
        return false
    end
    
    ProbablyEngine.condition.register("aura.crit", function(target, spell)
        return smartQueryTracker(target, spell, 'crit')
    end)
    
    ProbablyEngine.condition.register("aura.crits", function(target, spell)
        return smartQueryTracker(target, spell, 'crits')
    end)
    
    ProbablyEngine.condition.register("aura.avg", function(target, spell)
        return smartQueryTracker(target, spell, 'avg')
    end)
    
    ProbablyEngine.condition.register("aura.last", function(target, spell)
        return smartQueryTracker(target, spell, 'last')
    end)
    
    ProbablyEngine.condition.register("aura.low", function(target, spell)
        return smartQueryTracker(target, spell, 'low')
    end)
    
    ProbablyEngine.condition.register("aura.high", function(target, spell)
        return smartQueryTracker(target, spell, 'high')
    end)
    
    ProbablyEngine.condition.register("aura.total", function(target, spell)
        return smartQueryTracker(target, spell, 'total')
    end)
    
    ProbablyEngine.condition.register("aura.stacks", function(target, spell)
        return smartQueryTracker(target, spell, 'stacks')
    end)
    
    ProbablyEngine.condition.register("aura.time", function(target, spell)
        return smartQueryTracker(target, spell, 'time')
    end)
    
    ProbablyEngine.condition.register("aura.uptime", function(target, spell)
        return smartQueryTracker(target, spell, 'time') - GetTime()
    end)
    
    ProbablyEngine.condition.register("stance", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("form", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("seal", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("focus", function(target, spell)
        return UnitPower(target, SPELL_POWER_FOCUS)
    end)
    
    ProbablyEngine.condition.register("holypower", function(target, spell)
        return UnitPower(target, SPELL_POWER_HOLY_POWER)
    end)
    
    ProbablyEngine.condition.register("shadoworbs", function(target, spell)
        return UnitPower(target, SPELL_POWER_SHADOW_ORBS)
    end)
    
    ProbablyEngine.condition.register("energy", function(target, spell)
        return UnitPower(target, SPELL_POWER_ENERGY)
    end)
    
    ProbablyEngine.condition.register("solar", function(target, spell)
        return GetEclipseDirection() == 'sun'
    end)
    
    ProbablyEngine.condition.register("lunar", function(target, spell)
        return GetEclipseDirection() == 'moon'
    end)
    
    ProbablyEngine.condition.register("enumber", function(target, spell)
        return UnitPower(target, SPELL_POWER_ECLIPSE)
    end)
    
    ProbablyEngine.condition.register("eclipse", function(target, spell)
        return math.abs(UnitPower(target, SPELL_POWER_ECLIPSE))
    end)
    
    ProbablyEngine.condition.register("timetomax", function(target, spell)
        local max = UnitPowerMax(target)
        local curr = UnitPower(target)
        local regen = select(2, GetPowerRegen(target))
        return (max - curr) * (1.0 / regen)
    end)
    
    ProbablyEngine.condition.register("tomax", function(target, spell)
        return ProbablyEngine.condition["timetomax"](toggle)
    end)
    
    ProbablyEngine.condition.register("rage", function(target, spell)
        return UnitPower(target, SPELL_POWER_RAGE)
    end)
    
    ProbablyEngine.condition.register("chi", function(target, spell)
        return UnitPower(target, SPELL_POWER_CHI)
    end)
    
    ProbablyEngine.condition.register("demonicfury", function(target, spell)
        return UnitPower(target, SPELL_POWER_DEMONIC_FURY)
    end)
    
    ProbablyEngine.condition.register("embers", function(target, spell)
        return UnitPower(target, SPELL_POWER_BURNING_EMBERS, true)
    end)
    
    ProbablyEngine.condition.register("soulshards", function(target, spell)
        return UnitPower(target, SPELL_POWER_SOUL_SHARDS)
    end)
    
    ProbablyEngine.condition.register("behind", function(target, spell)
        if FireHack then
            return not UnitInfront(target, 'player')
        end
        return ProbablyEngine.module.player.behind
    end)
    
    ProbablyEngine.condition.register("infront", function(target, spell)
        if FireHack then
            return UnitInfront(target, 'player')
        end
        return ProbablyEngine.module.player.infront
    end)
    
    ProbablyEngine.condition.register("disarmable", function(target, spell)
        return ProbablyEngine.module.disarm.check(target)
    end)
    
    ProbablyEngine.condition.register("combopoints", function()
        return GetComboPoints('player', 'target')
    end)
    
    ProbablyEngine.condition.register("alive", function(target, spell)
        if UnitExists(target) and UnitHealth(target) > 0 then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register('dead', function (target)
        return UnitIsDeadOrGhost(target)
    end)
    
    ProbablyEngine.condition.register('swimming', function ()
        return IsSwimming()
    end)
    
    ProbablyEngine.condition.register("target", function(target, spell)
        return ( UnitGUID(target .. "target") == UnitGUID(spell) )
    end)
    
    --[[
    ProbablyEngine.condition.register("player", function(target, spell)
        return UnitName('player') == UnitName(target)
    end)--]]
    
    ProbablyEngine.condition.register("player", function (target)
        return UnitIsPlayer(target)
    end)
    
    ProbablyEngine.condition.register("exists", function(target)
        return (UnitExists(target))
    end)
    
    ProbablyEngine.condition.register("modifier.shift", function()
        return IsShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.control", function()
        return IsControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.alt", function()
        return IsAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lshift", function()
        return IsLeftShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lcontrol", function()
        return IsLeftControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lalt", function()
        return IsLeftAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.rshift", function()
        return IsRightShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.rcontrol", function()
        return IsRightControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.ralt", function()
        return IsRightAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.player", function()
        return UnitIsPlayer("target")
    end)
    
    ProbablyEngine.condition.register("classification", function (target, spell)
        if not spell then return false end
        local classification = UnitClassification(target)
        if stringFind(spell, '[%s,]+') then
        for classificationExpected in stringGmatch(spell, '%a+') do
            if classification == stringLower(classificationExpected) then
            return true
            end
        end
        return false
        else
        return UnitClassification(target) == stringLower(spell)
        end
    end)
    
    ProbablyEngine.condition.register('boss', function (target, spell)
        local classification = UnitClassification(target)
        if spell == 'true' and (classification == 'rareelite' or classification == 'rare') then
        return true
        end
        if classification == 'worldboss' or LibBoss.BossIDs[tonumber(UnitID(target))] then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("id", function(target, id)
        local expectedID = tonumber(id)
        if expectedID and UnitID(target) == expectedID then
            return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("toggle", function(toggle)
        return ProbablyEngine.condition["modifier.toggle"](toggle)
    end)
    
    ProbablyEngine.condition.register("modifier.toggle", function(toggle)
        return ProbablyEngine.config.read('button_states', toggle, false)
    end)
    
    ProbablyEngine.condition.register("modifier.taunt", function()
        if ProbablyEngine.condition["modifier.toggle"]('taunt') then
            if UnitThreatSituation("player", "target") then
                local status = UnitThreatSituation("player", "target")
                return (status < 3)
            end
            return false
        end
        return false
    end)
    
    ProbablyEngine.condition.register("threat", function(target)
        if UnitThreatSituation("player", target) then
        local isTanking, status, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation("player", target)
        return scaledPercent
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("agro", function(target)
        if UnitThreatSituation(target) and UnitThreatSituation(target) >= 2 then
        return true
        end
        return false
    end)
    
    
    ProbablyEngine.condition.register("balance.sun", function()
        local direction = GetEclipseDirection()
        if direction == 'none' or direction == 'sun' then return true end
    end)
    
    ProbablyEngine.condition.register("balance.moon", function()
        local direction = GetEclipseDirection()
        if direction == 'moon' then return true end
    end)
    
    ProbablyEngine.condition.register("moving", function(target)
        local speed, _ = GetUnitSpeed(target)
        return speed ~= 0
    end)
    
    
    local movingCache = { }
    
    ProbablyEngine.condition.register("lastmoved", function(target)
        if target == 'player' then
            if not ProbablyEngine.module.player.moving then
                return GetTime() - ProbablyEngine.module.player.movingTime
            end
            return false
        else
            if UnitExists(target) then
                local guid = UnitGUID(target)
                if movingCache[guid] then
                    local moving = (GetUnitSpeed(target) > 0)
                    if not movingCache[guid].moving and moving then
                        movingCache[guid].last = GetTime()
                        movingCache[guid].moving = true
                        return false
                    elseif moving then
                        return false
                    elseif not moving then
                        movingCache[guid].moving = false
                        return GetTime() - movingCache[guid].last
                    end
                else
                    movingCache[guid] = { }
                    movingCache[guid].last = GetTime()
                    movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                    return false
                end
            end
            return false
        end
    end)
    
    ProbablyEngine.condition.register("movingfor", function(target)
        if target == 'player' then
            if ProbablyEngine.module.player.moving then
                return GetTime() - ProbablyEngine.module.player.movingTime
            end
            return false
        else
            if UnitExists(target) then
                local guid = UnitGUID(target)
                if movingCache[guid] then
                    local moving = (GetUnitSpeed(target) > 0)
                    if not movingCache[guid].moving then
                        movingCache[guid].last = GetTime()
                        movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                        return false
                    elseif moving then
                        return GetTime() - movingCache[guid].last
                    elseif not moving then
                        movingCache[guid].moving = false
                        return false
                    end
                else
                    movingCache[guid] = { }
                    movingCache[guid].last = GetTime()
                    movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                    return false
                end
            end
            return false
        end
    end)
    
    -- DK Power
    
    ProbablyEngine.condition.register("runicpower", function(target, spell)
        return UnitPower(target, SPELL_POWER_RUNIC_POWER)
    end)
    
    ProbablyEngine.condition.register("runes.count", function(target, rune)
        rune = string.lower(rune)
        if rune == 'frost' then
        local r1 = select(3, GetRuneCooldown(5))
        local r2 = select(3, GetRuneCooldown(6))
        local f1 = GetRuneType(5)
        local f2 = GetRuneType(6)
        if (r1 and f1 == 3) and (r2 and f2 == 3) then
            return 2
        elseif (r1 and f1 == 3) or (r2 and f2 == 3) then
            return 1
        else
            return 0
        end
        elseif rune == 'blood' then
        local r1 = select(3, GetRuneCooldown(1))
        local r2 = select(3, GetRuneCooldown(2))
        local b1 = GetRuneType(1)
        local b2 = GetRuneType(2)
        if (r1 and b1 == 1) and (r2 and b2 == 1) then
            return 2
        elseif (r1 and b1 == 1) or (r2 and b2 == 1) then
            return 1
        else
            return 0
        end
        elseif rune == 'unholy' then
        local r1 = select(3, GetRuneCooldown(3))
        local r2 = select(3, GetRuneCooldown(4))
        local u1 = GetRuneType(3)
        local u2 = GetRuneType(4)
        if (r1 and u1 == 2) and (r2 and u2 == 2) then
            return 2
        elseif (r1 and u1 == 2) or (r2 and u2 == 2) then
            return 1
        else
            return 0
        end
        elseif rune == 'death' then
            local r1 = select(3, GetRuneCooldown(1))
            local r2 = select(3, GetRuneCooldown(2))
            local r3 = select(3, GetRuneCooldown(3))
            local r4 = select(3, GetRuneCooldown(4))
            local d1 = GetRuneType(1)
            local d2 = GetRuneType(2)
            local d3 = GetRuneType(3)
            local d4 = GetRuneType(4)
            local total = 0
            if (r1 and d1 == 4) then
                total = total + 1
            end
            if (r2 and d2 == 4) then
                total = total + 1
            end
            if (r3 and d3 == 4) then
                total = total + 1
            end
            if (r4 and d4 == 4) then
                total = total + 1
            end
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("runes.depleted", function(target, spell)
        local regeneration_threshold = 1
        for i=1,6,2 do
            local start, duration, runeReady = GetRuneCooldown(i)
            local start2, duration2, runeReady2 = GetRuneCooldown(i+1)
            if not runeReady and not runeReady2 and duration > 0 and duration2 > 0 and start > 0 and start2 > 0 then
                if (start-GetTime()+duration)>=regeneration_threshold and (start2-GetTime()+duration2)>=regeneration_threshold then
                    return true
                end
            end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("runes", function(target, rune)
        return ProbablyEngine.condition["runes.count"](target, rune)
    end)
    
    ProbablyEngine.condition.register("health", function(target)
        if UnitExists(target) then
            return math.floor((UnitHealth(target) / UnitHealthMax(target)) * 100)
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("health.actual", function(target)
        return UnitHealth(target)
    end)
    
    ProbablyEngine.condition.register("health.max", function(target)
        return UnitHealthMax(target)
    end)
    
    ProbablyEngine.condition.register("mana", function(target, spell)
        if UnitExists(target) then
            return math.floor((UnitMana(target) / UnitManaMax(target)) * 100)
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("raid.health", function()
        return ProbablyEngine.raid.raidPercent()
    end)
    
    ProbablyEngine.condition.register("modifier.multitarget", function()
        return ProbablyEngine.condition["modifier.toggle"]('multitarget')
    end)
    
    ProbablyEngine.condition.register("modifier.cooldowns", function()
        return ProbablyEngine.condition["modifier.toggle"]('cooldowns')
    end)
    
    ProbablyEngine.condition.register("modifier.cooldown", function()
        return ProbablyEngine.condition["modifier.toggle"]('cooldowns')
    end)
    
    ProbablyEngine.condition.register("modifier.interrupts", function()
        if ProbablyEngine.condition["modifier.toggle"]('interrupt') then
        local stop = ProbablyEngine.condition["casting"]('target')
        if stop then StopCast() end
        return stop
        end
        return false
    end)
    
    ProbablyEngine.condition.register("modifier.interrupt", function()
        if ProbablyEngine.condition["modifier.toggle"]('interrupt') then
        return ProbablyEngine.condition["casting"]('target')
        end
        return false
    end)
    
    local lastDepWarn = false
    
    ProbablyEngine.condition.register("modifier.last", function(target, spell)
        if not lastDepWarn then
            ProbablyEngine.print('modifier.last has been deprecated, please use lastcast')
            lastDepWarn = true
        end
        return ProbablyEngine.parser.lastCast == GetSpellName(spell)
    end)
    
    ProbablyEngine.condition.register("lastcast", function(spell, arg)
        if arg then spell = arg end
        return ProbablyEngine.parser.lastCast == GetSpellName(spell)
    end)
    
    ProbablyEngine.condition.register("enchant.mainhand", function()
        return (select(1, GetWeaponEnchantInfo()) == 1)
    end)
    
    ProbablyEngine.condition.register("enchant.offhand", function()
        return (select(4, GetWeaponEnchantInfo()) == 1)
    end)
    
    ProbablyEngine.condition.register("totem", function(target, totem)
        for index = 1, 4 do
            local _, totemName, startTime, duration = GetTotemInfo(index)
            if totemName == GetSpellName(totem) then
                return true
            end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("totem.duration", function(target, totem)
        for index = 1, 4 do
        local _, totemName, startTime, duration = GetTotemInfo(index)
        if totemName == GetSpellName(totem) then
            return floor(startTime + duration - GetTime())
        end
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("mushrooms", function ()
        local count = 0
        for slot = 1, 3 do
        if GetTotemInfo(slot) then
            count = count + 1 end
        end
        return count
    end)
    
    local function checkChanneling(target)
        local name, _, _, _, startTime, endTime, _, notInterruptible = UnitChannelInfo(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        return false
    end
    
    local function checkCasting(target)
        local name, startTime, endTime, notInterruptible = checkChanneling(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        local name, _, _, _, startTime, endTime, _, _, notInterruptible = UnitCastingInfo(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        return false
    end
    
    ProbablyEngine.condition.register('casting.time', function(target, spell)
        local name, startTime, endTime = checkCasting(target)
        if not endTime or not startTime then return false end
        if name then return (endTime - startTime) / 1000 end
        return false
    end)
    
    ProbablyEngine.condition.register('casting.delta', function(target, spell)
        local name, startTime, endTime, notInterruptible = checkCasting(target)
        if not endTime or not startTime then return false end
        if name and not notInterruptible then
        local castLength = (endTime - startTime) / 1000
        local secondsLeft = endTime / 1000  - GetTime()
        return secondsLeft, castLength
        end
        return false
    end)
    
    ProbablyEngine.condition.register('casting.percent', function(target, spell)
        local name, startTime, endTime, notInterruptible = checkCasting(target)
        if name and not notInterruptible then
        local castLength = (endTime - startTime) / 1000
        local secondsLeft = endTime / 1000  - GetTime()
        return ((secondsLeft/castLength)*100)
        end
        return false
    end)
    
    ProbablyEngine.condition.register('channeling', function (target, spell)
        return checkChanneling(target)
    end)
    
    ProbablyEngine.condition.register("casting", function(target, spell)
        local castName,_,_,_,_,endTime,_,_,notInterruptibleCast = UnitCastingInfo(target)
        local channelName,_,_,_,_,endTime,_,notInterruptibleChannel = UnitChannelInfo(target)
        spell = GetSpellName(spell)
        if (castName == spell or channelName == spell) and not not spell then
        return true
        elseif notInterruptibleCast == false or notInterruptibleChannel == false then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register('interruptsAt', function (target, spell)
        if ProbablyEngine.condition['modifier.toggle']('interrupt') then
        if UnitName('player') == UnitName(target) then return false end
        local stopAt = tonumber(spell) or 95
        local secondsLeft, castLength = ProbablyEngine.condition['casting.delta'](target)
        if secondsLeft and 100 - (secondsLeft / castLength * 100) > stopAt then
            StopCast()
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register('interruptAt', function (target, spell)
        if ProbablyEngine.condition['modifier.toggle']('interrupt') then
        if UnitName('player') == UnitName(target) then return false end
        local stopAt = tonumber(spell) or 95
        local secondsLeft, castLength = ProbablyEngine.condition['casting.delta'](target)
        if secondsLeft and 100 - (secondsLeft / castLength * 100) > stopAt then
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("spell.cooldown", function(target, spell)
        local start, duration, enabled = GetSpellCooldown(spell)
        if not start then return false end
        if start ~= 0 then
        return (start + duration - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("spell.recharge", function(target, spell)
        local charges, maxCharges, start, duration = GetSpellCharges(spell)
        if not start then return false end
        if start ~= 0 then
        return (start + duration - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("spell.usable", function(target, spell)
        return (IsUsableSpell(spell) ~= nil)
    end)
    
    ProbablyEngine.condition.register("spell.exists", function(target, spell)
        if GetSpellBookIndex(spell) then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("spell.casted", function(target, spell)
        return ProbablyEngine.module.player.casted(GetSpellName(spell))
    end)
    
    ProbablyEngine.condition.register("spell.charges", function(target, spell)
        return select(1, GetSpellCharges(spell))
    end)
    
    ProbablyEngine.condition.register("spell.cd", function(target, spell)
        return ProbablyEngine.condition["spell.cooldown"](target, spell)
    end)
    
    ProbablyEngine.condition.register("spell.range", function(target, spell)
        local spellIndex, spellBook = GetSpellBookIndex(spell)
        if not spellIndex then return false end
        return spellIndex and IsSpellInRange(spellIndex, spellBook, target)
    end)
    
    ProbablyEngine.condition.register("talent", function(args)
        local row, col = strsplit(",", args, 2)
        return hasTalent(tonumber(row), tonumber(col))
    end)
    
    ProbablyEngine.condition.register("friend", function(target, spell)
        return ( UnitCanAttack("player", target) ~= 1 )
    end)
    
    ProbablyEngine.condition.register("enemy", function(target, spell)
        return ( UnitCanAttack("player", target) )
    end)
    
    ProbablyEngine.condition.register("glyph", function(target, spell)
        local spellId = tonumber(spell)
        local glyphName, glyphId
    
        for i = 1, 6 do
        glyphId = select(4, GetGlyphSocketInfo(i))
        if glyphId then
            if spellId then
            if select(4, GetGlyphSocketInfo(i)) == spellId then
                return true
            end
            else
            glyphName = GetSpellName(glyphId)
            if glyphName:find(spell) then
                return true
            end
            end
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("range", function(target)
        return ProbablyEngine.condition["distance"](target)
    end)
    
    ProbablyEngine.condition.register("distance", function(target)
        if Distance then
            return math.floor(Distance(target, 'player'))
        else -- fall back to libRangeCheck
            local minRange, maxRange = rangeCheck:GetRange(target)
            return maxRange or minRange
        end
    end)
    
    ProbablyEngine.condition.register("level", function(target, range)
        return UnitLevel(target)
    end)
    
    ProbablyEngine.condition.register("combat", function(target, range)
        return UnitAffectingCombat(target)
    end)
    
    ProbablyEngine.condition.register("time", function(target, range)
        if ProbablyEngine.module.player.combatTime then
            return GetTime() - ProbablyEngine.module.player.combatTime
        end
        return false
    end)
    
    
    local deathTrack = { }
    ProbablyEngine.condition.register("deathin", function(target, range)
        local guid = UnitGUID(target)
        if deathTrack[target] and deathTrack[target].guid == guid then
            local start = deathTrack[target].time
            local currentHP = UnitHealth(target)
            local maxHP = deathTrack[target].start
            local diff = maxHP - currentHP
            local dura = GetTime() - start
            local hpps = diff / dura
            local death = currentHP / hpps
            if death == math.huge then
                return 8675309
            elseif death < 0 then
                return 0
            else
                return death
            end
        elseif deathTrack[target] then
            table.empty(deathTrack[target])
        else
            deathTrack[target] = { }
        end
        deathTrack[target].guid = guid
        deathTrack[target].time = GetTime()
        deathTrack[target].start = UnitHealth(target)
        return 8675309
    end)
    
    ProbablyEngine.condition.register("ttd", function(target, range)
        return ProbablyEngine.condition["deathin"](target)
    end)
    
    ProbablyEngine.condition.register("role", function(target, role)
        role = role:upper()
    
        local damageAliases = { "DAMAGE", "DPS", "DEEPS" }
    
        local targetRole = UnitGroupRolesAssigned(target)
        if targetRole == role then return true
        elseif role:find("HEAL") and targetRole == "HEALER" then return true
        else
        for i = 1, #damageAliases do
            if role == damageAliases[i] then return true end
        end
        end
    
        return false
    end)
    
    ProbablyEngine.condition.register("name", function (target, expectedName)
        return UnitExists(target) and UnitName(target):lower():find(expectedName:lower()) ~= nil
    end)
    
    ProbablyEngine.condition.register("modifier.party", function()
        return IsInGroup()
    end)
    
    ProbablyEngine.condition.register("modifier.raid", function()
        return IsInRaid()
    end)
    
    ProbablyEngine.condition.register("party", function(target)
        return UnitInParty(target)
    end)
    
    ProbablyEngine.condition.register("raid", function(target)
        return UnitInRaid(target)
    end)
    
    ProbablyEngine.condition.register("modifier.members", function()
        return (GetNumGroupMembers() or 0)
    end)
    
    ProbablyEngine.condition.register("creatureType", function (target, expectedType)
        return UnitCreatureType(target) == expectedType
    end)
    
    ProbablyEngine.condition.register("class", function (target, expectedClass)
        local class, _, classID = UnitClass(target)
    
        if tonumber(expectedClass) then
        return tonumber(expectedClass) == classID
        else
        return expectedClass == class
        end
    end)
    
    ProbablyEngine.condition.register("falling", function()
        return IsFalling()
    end)
    
    ProbablyEngine.condition.register("timeout", function(args)
        local name, time = strsplit(",", args, 2)
        if tonumber(time) then
            if ProbablyEngine.timeout.check(name) then
                return false
            end
            ProbablyEngine.timeout.set(name, tonumber(time))
            return true
        end
        return false
    end)
    
    local heroismBuffs = { 32182, 90355, 80353, 2825, 146555 }
    
    ProbablyEngine.condition.register("hashero", function(unit, spell)
        for i = 1, #heroismBuffs do
        if UnitBuff('player', GetSpellName(heroismBuffs[i])) then
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buffs.stats", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(1) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.stamina", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(2) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.attackpower", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(3) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.attackspeed", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(4) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.haste", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(4) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.spellpower", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(5) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.crit", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.critical", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.criticalstrike", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.mastery", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(7) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.multistrike", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(8) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.multi", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(8) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.vers", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(9) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.versatility", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(9) ~= nil)
    end)
    
    ProbablyEngine.condition.register("charmed", function(unit, _)
        return (UnitIsCharmed(unit) == true)
    end)
    
    ProbablyEngine.condition.register("vengeance", function(unit, spell)
        local vengeance = select(15, _G['UnitBuff']("player", GetSpellName(132365)))
        if not vengeance then
            return 0
        end
        if spell then
            return vengeance
        end
        return vengeance / UnitHealthMax("player") * 100
    end)
    
    ProbablyEngine.condition.register("area.enemies", function(unit, distance)
        if UnitsAroundUnit then
            local total = UnitsAroundUnit(unit, tonumber(distance))
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("area.friendly", function(unit, distance)
        if FriendlyUnitsAroundUnit then
            local total = FriendlyUnitsAroundUnit(unit, tonumber(distance))
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("ilevel", function(unit, _)
        return math.floor(select(1,GetAverageItemLevel()))
    end)
    
    ProbablyEngine.condition.register("firehack", function(unit, _)
        return FireHack or false
    end)
    
    ProbablyEngine.condition.register("offspring", function(unit, _)
        return type(opos) == 'function' or false
    end)

  11. #26
    ImogenOC's Avatar Contributor ProbablyEngine Community Manager
    Reputation
    173
    Join Date
    Nov 2013
    Posts
    364
    Thanks G/R
    0/8
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MrBrain1 View Post
    Code:
    -- ProbablyEngine Rotations
    -- Released under modified BSD, see attached LICENSE.
    
    local GetTime = GetTime
    local GetSpellBookIndex = GetSpellBookIndex
    local UnitCastingInfo = UnitCastingInfo
    local UnitChannelInfo = UnitChannelInfo
    local UnitClassification = UnitClassification
    local UnitIsDeadOrGhost = UnitIsDeadOrGhost
    local UnitIsPlayer = UnitIsPlayer
    local UnitName = UnitName
    local stringFind = string.find
    local stringLower = string.lower
    local stringGmatch = string.gmatch
    
    local ProbablyEngineTempTable1 = { }
    local rangeCheck = LibStub("LibRangeCheck-2.0")
    local LibDispellable = LibStub("LibDispellable-1.0")
    local LibBoss = LibStub("LibBossIDs-1.0")
    
    local UnitBuff = function(target, spell, owner)
        local buff, count, caster, expires, spellID
        if tonumber(spell) then
        local i = 0; local go = true
        while i <= 40 and go do
            i = i + 1
            buff,_,_,count,_,_,expires,caster,_,_,spellID = _G['UnitBuff'](target, i)
            if not owner then
            if spellID == tonumber(spell) and caster == "player" then go = false end
            elseif owner == "any" then
            if spellID == tonumber(spell) then go = false end
            end
        end
        else
        buff,_,_,count,_,_,expires,caster = _G['UnitBuff'](target, spell)
        end
        return buff, count, expires, caster
    end
    
    local UnitDebuff = function(target, spell, owner)
        local debuff, count, caster, expires, spellID
        if tonumber(spell) then
        local i = 0; local go = true
        while i <= 40 and go do
            i = i + 1
            debuff,_,_,count,_,_,expires,caster,_,_,spellID,_,_,_,power = _G['UnitDebuff'](target, i)
            if not owner then
            if spellID == tonumber(spell) and caster == "player" then go = false end
            elseif owner == "any" then
            if spellID == tonumber(spell) then go = false end
            end
        end
        else
        debuff,_,_,count,_,_,expires,caster = _G['UnitDebuff'](target, spell)
        end
        return debuff, count, expires, caster, power
    end
    
    ProbablyEngine.condition.register("dispellable", function(target, spell)
        if LibDispellable:CanDispelWith(target, GetSpellID(GetSpellName(spell))) then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff", function(target, spell)
        local buff,_,_,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff.any", function(target, spell)
        local buff,_,_,caster = UnitBuff(target, spell, "any")
        if not not buff then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buff.count", function(target, spell)
        local buff,count,_,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return count
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("debuff", function(target, spell)
        local debuff,_,_,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("debuff.any", function(target, spell)
        local debuff,_,_,caster = UnitDebuff(target, spell, "any")
        if not not debuff then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("debuff.count", function(target, spell)
        local debuff,count,_,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return count
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("debuff.duration", function(target, spell)
        local debuff,_,expires,caster = UnitDebuff(target, spell)
        if not not debuff and (caster == 'player' or caster == 'pet') then
        return (expires - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("buff.duration", function(target, spell)
        local buff,_,expires,caster = UnitBuff(target, spell)
        if not not buff and (caster == 'player' or caster == 'pet') then
        return (expires - GetTime())
        end
        return 0
    end)
    
    
    --[[
    ProbablyEngine.condition.register("aura.", function(target, spell)
        local guid = UnitGUID(target)
        if guid then
            local unit = ProbablyEngine.module.tracker.units[guid]
            if unit then
                local aura = unit.auras[GetSpellID(spell)]
                local track = false
                if aura['damage'] and not aura['heal'] then
                    track = aura['damage']
                elseif aura['heal'] and not aura['damage'] then
                    track = aura['heal']
                end
                if track then
                    return track.
                end
            end
        end
        return false
    end)
    ]]
    
    local function smartQueryTracker(target, spell, key)
        local guid = UnitGUID(target)
        if guid then
            local unit = ProbablyEngine.module.tracker.units[guid]
            if unit then
                local aura = unit.auras[GetSpellID(spell)]
                if aura then
                    local track = false
                    if key == 'stacks' or key == 'time' then
                        track = aura
                    else
                        if aura['damage'] and not aura['heal'] then
                            track = aura['damage']
                        elseif aura['heal'] and not aura['damage'] then
                            track = aura['heal']
                        end
                    end
                    if track then
                        return track[key]
                    end
                end
            end
        end
        return false
    end
    
    ProbablyEngine.condition.register("aura.crit", function(target, spell)
        return smartQueryTracker(target, spell, 'crit')
    end)
    
    ProbablyEngine.condition.register("aura.crits", function(target, spell)
        return smartQueryTracker(target, spell, 'crits')
    end)
    
    ProbablyEngine.condition.register("aura.avg", function(target, spell)
        return smartQueryTracker(target, spell, 'avg')
    end)
    
    ProbablyEngine.condition.register("aura.last", function(target, spell)
        return smartQueryTracker(target, spell, 'last')
    end)
    
    ProbablyEngine.condition.register("aura.low", function(target, spell)
        return smartQueryTracker(target, spell, 'low')
    end)
    
    ProbablyEngine.condition.register("aura.high", function(target, spell)
        return smartQueryTracker(target, spell, 'high')
    end)
    
    ProbablyEngine.condition.register("aura.total", function(target, spell)
        return smartQueryTracker(target, spell, 'total')
    end)
    
    ProbablyEngine.condition.register("aura.stacks", function(target, spell)
        return smartQueryTracker(target, spell, 'stacks')
    end)
    
    ProbablyEngine.condition.register("aura.time", function(target, spell)
        return smartQueryTracker(target, spell, 'time')
    end)
    
    ProbablyEngine.condition.register("aura.uptime", function(target, spell)
        return smartQueryTracker(target, spell, 'time') - GetTime()
    end)
    
    ProbablyEngine.condition.register("stance", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("form", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("seal", function(target, spell)
        return GetShapeshiftForm()
    end)
    
    ProbablyEngine.condition.register("focus", function(target, spell)
        return UnitPower(target, SPELL_POWER_FOCUS)
    end)
    
    ProbablyEngine.condition.register("holypower", function(target, spell)
        return UnitPower(target, SPELL_POWER_HOLY_POWER)
    end)
    
    ProbablyEngine.condition.register("shadoworbs", function(target, spell)
        return UnitPower(target, SPELL_POWER_SHADOW_ORBS)
    end)
    
    ProbablyEngine.condition.register("energy", function(target, spell)
        return UnitPower(target, SPELL_POWER_ENERGY)
    end)
    
    ProbablyEngine.condition.register("solar", function(target, spell)
        return GetEclipseDirection() == 'sun'
    end)
    
    ProbablyEngine.condition.register("lunar", function(target, spell)
        return GetEclipseDirection() == 'moon'
    end)
    
    ProbablyEngine.condition.register("enumber", function(target, spell)
        return UnitPower(target, SPELL_POWER_ECLIPSE)
    end)
    
    ProbablyEngine.condition.register("eclipse", function(target, spell)
        return math.abs(UnitPower(target, SPELL_POWER_ECLIPSE))
    end)
    
    ProbablyEngine.condition.register("timetomax", function(target, spell)
        local max = UnitPowerMax(target)
        local curr = UnitPower(target)
        local regen = select(2, GetPowerRegen(target))
        return (max - curr) * (1.0 / regen)
    end)
    
    ProbablyEngine.condition.register("tomax", function(target, spell)
        return ProbablyEngine.condition["timetomax"](toggle)
    end)
    
    ProbablyEngine.condition.register("rage", function(target, spell)
        return UnitPower(target, SPELL_POWER_RAGE)
    end)
    
    ProbablyEngine.condition.register("chi", function(target, spell)
        return UnitPower(target, SPELL_POWER_CHI)
    end)
    
    ProbablyEngine.condition.register("demonicfury", function(target, spell)
        return UnitPower(target, SPELL_POWER_DEMONIC_FURY)
    end)
    
    ProbablyEngine.condition.register("embers", function(target, spell)
        return UnitPower(target, SPELL_POWER_BURNING_EMBERS, true)
    end)
    
    ProbablyEngine.condition.register("soulshards", function(target, spell)
        return UnitPower(target, SPELL_POWER_SOUL_SHARDS)
    end)
    
    ProbablyEngine.condition.register("behind", function(target, spell)
        if FireHack then
            return not UnitInfront(target, 'player')
        end
        return ProbablyEngine.module.player.behind
    end)
    
    ProbablyEngine.condition.register("infront", function(target, spell)
        if FireHack then
            return UnitInfront(target, 'player')
        end
        return ProbablyEngine.module.player.infront
    end)
    
    ProbablyEngine.condition.register("disarmable", function(target, spell)
        return ProbablyEngine.module.disarm.check(target)
    end)
    
    ProbablyEngine.condition.register("combopoints", function()
        return GetComboPoints('player', 'target')
    end)
    
    ProbablyEngine.condition.register("alive", function(target, spell)
        if UnitExists(target) and UnitHealth(target) > 0 then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register('dead', function (target)
        return UnitIsDeadOrGhost(target)
    end)
    
    ProbablyEngine.condition.register('swimming', function ()
        return IsSwimming()
    end)
    
    ProbablyEngine.condition.register("target", function(target, spell)
        return ( UnitGUID(target .. "target") == UnitGUID(spell) )
    end)
    
    --[[
    ProbablyEngine.condition.register("player", function(target, spell)
        return UnitName('player') == UnitName(target)
    end)--]]
    
    ProbablyEngine.condition.register("player", function (target)
        return UnitIsPlayer(target)
    end)
    
    ProbablyEngine.condition.register("exists", function(target)
        return (UnitExists(target))
    end)
    
    ProbablyEngine.condition.register("modifier.shift", function()
        return IsShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.control", function()
        return IsControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.alt", function()
        return IsAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lshift", function()
        return IsLeftShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lcontrol", function()
        return IsLeftControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.lalt", function()
        return IsLeftAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.rshift", function()
        return IsRightShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.rcontrol", function()
        return IsRightControlKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.ralt", function()
        return IsRightAltKeyDown() and GetCurrentKeyBoardFocus() == nil
    end)
    
    ProbablyEngine.condition.register("modifier.player", function()
        return UnitIsPlayer("target")
    end)
    
    ProbablyEngine.condition.register("classification", function (target, spell)
        if not spell then return false end
        local classification = UnitClassification(target)
        if stringFind(spell, '[%s,]+') then
        for classificationExpected in stringGmatch(spell, '%a+') do
            if classification == stringLower(classificationExpected) then
            return true
            end
        end
        return false
        else
        return UnitClassification(target) == stringLower(spell)
        end
    end)
    
    ProbablyEngine.condition.register('boss', function (target, spell)
        local classification = UnitClassification(target)
        if spell == 'true' and (classification == 'rareelite' or classification == 'rare') then
        return true
        end
        if classification == 'worldboss' or LibBoss.BossIDs[tonumber(UnitID(target))] then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("id", function(target, id)
        local expectedID = tonumber(id)
        if expectedID and UnitID(target) == expectedID then
            return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("toggle", function(toggle)
        return ProbablyEngine.condition["modifier.toggle"](toggle)
    end)
    
    ProbablyEngine.condition.register("modifier.toggle", function(toggle)
        return ProbablyEngine.config.read('button_states', toggle, false)
    end)
    
    ProbablyEngine.condition.register("modifier.taunt", function()
        if ProbablyEngine.condition["modifier.toggle"]('taunt') then
            if UnitThreatSituation("player", "target") then
                local status = UnitThreatSituation("player", "target")
                return (status < 3)
            end
            return false
        end
        return false
    end)
    
    ProbablyEngine.condition.register("threat", function(target)
        if UnitThreatSituation("player", target) then
        local isTanking, status, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation("player", target)
        return scaledPercent
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("agro", function(target)
        if UnitThreatSituation(target) and UnitThreatSituation(target) >= 2 then
        return true
        end
        return false
    end)
    
    
    ProbablyEngine.condition.register("balance.sun", function()
        local direction = GetEclipseDirection()
        if direction == 'none' or direction == 'sun' then return true end
    end)
    
    ProbablyEngine.condition.register("balance.moon", function()
        local direction = GetEclipseDirection()
        if direction == 'moon' then return true end
    end)
    
    ProbablyEngine.condition.register("moving", function(target)
        local speed, _ = GetUnitSpeed(target)
        return speed ~= 0
    end)
    
    
    local movingCache = { }
    
    ProbablyEngine.condition.register("lastmoved", function(target)
        if target == 'player' then
            if not ProbablyEngine.module.player.moving then
                return GetTime() - ProbablyEngine.module.player.movingTime
            end
            return false
        else
            if UnitExists(target) then
                local guid = UnitGUID(target)
                if movingCache[guid] then
                    local moving = (GetUnitSpeed(target) > 0)
                    if not movingCache[guid].moving and moving then
                        movingCache[guid].last = GetTime()
                        movingCache[guid].moving = true
                        return false
                    elseif moving then
                        return false
                    elseif not moving then
                        movingCache[guid].moving = false
                        return GetTime() - movingCache[guid].last
                    end
                else
                    movingCache[guid] = { }
                    movingCache[guid].last = GetTime()
                    movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                    return false
                end
            end
            return false
        end
    end)
    
    ProbablyEngine.condition.register("movingfor", function(target)
        if target == 'player' then
            if ProbablyEngine.module.player.moving then
                return GetTime() - ProbablyEngine.module.player.movingTime
            end
            return false
        else
            if UnitExists(target) then
                local guid = UnitGUID(target)
                if movingCache[guid] then
                    local moving = (GetUnitSpeed(target) > 0)
                    if not movingCache[guid].moving then
                        movingCache[guid].last = GetTime()
                        movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                        return false
                    elseif moving then
                        return GetTime() - movingCache[guid].last
                    elseif not moving then
                        movingCache[guid].moving = false
                        return false
                    end
                else
                    movingCache[guid] = { }
                    movingCache[guid].last = GetTime()
                    movingCache[guid].moving = (GetUnitSpeed(target) > 0)
                    return false
                end
            end
            return false
        end
    end)
    
    -- DK Power
    
    ProbablyEngine.condition.register("runicpower", function(target, spell)
        return UnitPower(target, SPELL_POWER_RUNIC_POWER)
    end)
    
    ProbablyEngine.condition.register("runes.count", function(target, rune)
        rune = string.lower(rune)
        if rune == 'frost' then
        local r1 = select(3, GetRuneCooldown(5))
        local r2 = select(3, GetRuneCooldown(6))
        local f1 = GetRuneType(5)
        local f2 = GetRuneType(6)
        if (r1 and f1 == 3) and (r2 and f2 == 3) then
            return 2
        elseif (r1 and f1 == 3) or (r2 and f2 == 3) then
            return 1
        else
            return 0
        end
        elseif rune == 'blood' then
        local r1 = select(3, GetRuneCooldown(1))
        local r2 = select(3, GetRuneCooldown(2))
        local b1 = GetRuneType(1)
        local b2 = GetRuneType(2)
        if (r1 and b1 == 1) and (r2 and b2 == 1) then
            return 2
        elseif (r1 and b1 == 1) or (r2 and b2 == 1) then
            return 1
        else
            return 0
        end
        elseif rune == 'unholy' then
        local r1 = select(3, GetRuneCooldown(3))
        local r2 = select(3, GetRuneCooldown(4))
        local u1 = GetRuneType(3)
        local u2 = GetRuneType(4)
        if (r1 and u1 == 2) and (r2 and u2 == 2) then
            return 2
        elseif (r1 and u1 == 2) or (r2 and u2 == 2) then
            return 1
        else
            return 0
        end
        elseif rune == 'death' then
            local r1 = select(3, GetRuneCooldown(1))
            local r2 = select(3, GetRuneCooldown(2))
            local r3 = select(3, GetRuneCooldown(3))
            local r4 = select(3, GetRuneCooldown(4))
            local d1 = GetRuneType(1)
            local d2 = GetRuneType(2)
            local d3 = GetRuneType(3)
            local d4 = GetRuneType(4)
            local total = 0
            if (r1 and d1 == 4) then
                total = total + 1
            end
            if (r2 and d2 == 4) then
                total = total + 1
            end
            if (r3 and d3 == 4) then
                total = total + 1
            end
            if (r4 and d4 == 4) then
                total = total + 1
            end
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("runes.depleted", function(target, spell)
        local regeneration_threshold = 1
        for i=1,6,2 do
            local start, duration, runeReady = GetRuneCooldown(i)
            local start2, duration2, runeReady2 = GetRuneCooldown(i+1)
            if not runeReady and not runeReady2 and duration > 0 and duration2 > 0 and start > 0 and start2 > 0 then
                if (start-GetTime()+duration)>=regeneration_threshold and (start2-GetTime()+duration2)>=regeneration_threshold then
                    return true
                end
            end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("runes", function(target, rune)
        return ProbablyEngine.condition["runes.count"](target, rune)
    end)
    
    ProbablyEngine.condition.register("health", function(target)
        if UnitExists(target) then
            return math.floor((UnitHealth(target) / UnitHealthMax(target)) * 100)
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("health.actual", function(target)
        return UnitHealth(target)
    end)
    
    ProbablyEngine.condition.register("health.max", function(target)
        return UnitHealthMax(target)
    end)
    
    ProbablyEngine.condition.register("mana", function(target, spell)
        if UnitExists(target) then
            return math.floor((UnitMana(target) / UnitManaMax(target)) * 100)
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("raid.health", function()
        return ProbablyEngine.raid.raidPercent()
    end)
    
    ProbablyEngine.condition.register("modifier.multitarget", function()
        return ProbablyEngine.condition["modifier.toggle"]('multitarget')
    end)
    
    ProbablyEngine.condition.register("modifier.cooldowns", function()
        return ProbablyEngine.condition["modifier.toggle"]('cooldowns')
    end)
    
    ProbablyEngine.condition.register("modifier.cooldown", function()
        return ProbablyEngine.condition["modifier.toggle"]('cooldowns')
    end)
    
    ProbablyEngine.condition.register("modifier.interrupts", function()
        if ProbablyEngine.condition["modifier.toggle"]('interrupt') then
        local stop = ProbablyEngine.condition["casting"]('target')
        if stop then StopCast() end
        return stop
        end
        return false
    end)
    
    ProbablyEngine.condition.register("modifier.interrupt", function()
        if ProbablyEngine.condition["modifier.toggle"]('interrupt') then
        return ProbablyEngine.condition["casting"]('target')
        end
        return false
    end)
    
    local lastDepWarn = false
    
    ProbablyEngine.condition.register("modifier.last", function(target, spell)
        if not lastDepWarn then
            ProbablyEngine.print('modifier.last has been deprecated, please use lastcast')
            lastDepWarn = true
        end
        return ProbablyEngine.parser.lastCast == GetSpellName(spell)
    end)
    
    ProbablyEngine.condition.register("lastcast", function(spell, arg)
        if arg then spell = arg end
        return ProbablyEngine.parser.lastCast == GetSpellName(spell)
    end)
    
    ProbablyEngine.condition.register("enchant.mainhand", function()
        return (select(1, GetWeaponEnchantInfo()) == 1)
    end)
    
    ProbablyEngine.condition.register("enchant.offhand", function()
        return (select(4, GetWeaponEnchantInfo()) == 1)
    end)
    
    ProbablyEngine.condition.register("totem", function(target, totem)
        for index = 1, 4 do
            local _, totemName, startTime, duration = GetTotemInfo(index)
            if totemName == GetSpellName(totem) then
                return true
            end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("totem.duration", function(target, totem)
        for index = 1, 4 do
        local _, totemName, startTime, duration = GetTotemInfo(index)
        if totemName == GetSpellName(totem) then
            return floor(startTime + duration - GetTime())
        end
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("mushrooms", function ()
        local count = 0
        for slot = 1, 3 do
        if GetTotemInfo(slot) then
            count = count + 1 end
        end
        return count
    end)
    
    local function checkChanneling(target)
        local name, _, _, _, startTime, endTime, _, notInterruptible = UnitChannelInfo(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        return false
    end
    
    local function checkCasting(target)
        local name, startTime, endTime, notInterruptible = checkChanneling(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        local name, _, _, _, startTime, endTime, _, _, notInterruptible = UnitCastingInfo(target)
        if name then return name, startTime, endTime, notInterruptible end
    
        return false
    end
    
    ProbablyEngine.condition.register('casting.time', function(target, spell)
        local name, startTime, endTime = checkCasting(target)
        if not endTime or not startTime then return false end
        if name then return (endTime - startTime) / 1000 end
        return false
    end)
    
    ProbablyEngine.condition.register('casting.delta', function(target, spell)
        local name, startTime, endTime, notInterruptible = checkCasting(target)
        if not endTime or not startTime then return false end
        if name and not notInterruptible then
        local castLength = (endTime - startTime) / 1000
        local secondsLeft = endTime / 1000  - GetTime()
        return secondsLeft, castLength
        end
        return false
    end)
    
    ProbablyEngine.condition.register('casting.percent', function(target, spell)
        local name, startTime, endTime, notInterruptible = checkCasting(target)
        if name and not notInterruptible then
        local castLength = (endTime - startTime) / 1000
        local secondsLeft = endTime / 1000  - GetTime()
        return ((secondsLeft/castLength)*100)
        end
        return false
    end)
    
    ProbablyEngine.condition.register('channeling', function (target, spell)
        return checkChanneling(target)
    end)
    
    ProbablyEngine.condition.register("casting", function(target, spell)
        local castName,_,_,_,_,endTime,_,_,notInterruptibleCast = UnitCastingInfo(target)
        local channelName,_,_,_,_,endTime,_,notInterruptibleChannel = UnitChannelInfo(target)
        spell = GetSpellName(spell)
        if (castName == spell or channelName == spell) and not not spell then
        return true
        elseif notInterruptibleCast == false or notInterruptibleChannel == false then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register('interruptsAt', function (target, spell)
        if ProbablyEngine.condition['modifier.toggle']('interrupt') then
        if UnitName('player') == UnitName(target) then return false end
        local stopAt = tonumber(spell) or 95
        local secondsLeft, castLength = ProbablyEngine.condition['casting.delta'](target)
        if secondsLeft and 100 - (secondsLeft / castLength * 100) > stopAt then
            StopCast()
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register('interruptAt', function (target, spell)
        if ProbablyEngine.condition['modifier.toggle']('interrupt') then
        if UnitName('player') == UnitName(target) then return false end
        local stopAt = tonumber(spell) or 95
        local secondsLeft, castLength = ProbablyEngine.condition['casting.delta'](target)
        if secondsLeft and 100 - (secondsLeft / castLength * 100) > stopAt then
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("spell.cooldown", function(target, spell)
        local start, duration, enabled = GetSpellCooldown(spell)
        if not start then return false end
        if start ~= 0 then
        return (start + duration - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("spell.recharge", function(target, spell)
        local charges, maxCharges, start, duration = GetSpellCharges(spell)
        if not start then return false end
        if start ~= 0 then
        return (start + duration - GetTime())
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("spell.usable", function(target, spell)
        return (IsUsableSpell(spell) ~= nil)
    end)
    
    ProbablyEngine.condition.register("spell.exists", function(target, spell)
        if GetSpellBookIndex(spell) then
        return true
        end
        return false
    end)
    
    ProbablyEngine.condition.register("spell.casted", function(target, spell)
        return ProbablyEngine.module.player.casted(GetSpellName(spell))
    end)
    
    ProbablyEngine.condition.register("spell.charges", function(target, spell)
        return select(1, GetSpellCharges(spell))
    end)
    
    ProbablyEngine.condition.register("spell.cd", function(target, spell)
        return ProbablyEngine.condition["spell.cooldown"](target, spell)
    end)
    
    ProbablyEngine.condition.register("spell.range", function(target, spell)
        local spellIndex, spellBook = GetSpellBookIndex(spell)
        if not spellIndex then return false end
        return spellIndex and IsSpellInRange(spellIndex, spellBook, target)
    end)
    
    ProbablyEngine.condition.register("talent", function(args)
        local row, col = strsplit(",", args, 2)
        return hasTalent(tonumber(row), tonumber(col))
    end)
    
    ProbablyEngine.condition.register("friend", function(target, spell)
        return ( UnitCanAttack("player", target) ~= 1 )
    end)
    
    ProbablyEngine.condition.register("enemy", function(target, spell)
        return ( UnitCanAttack("player", target) )
    end)
    
    ProbablyEngine.condition.register("glyph", function(target, spell)
        local spellId = tonumber(spell)
        local glyphName, glyphId
    
        for i = 1, 6 do
        glyphId = select(4, GetGlyphSocketInfo(i))
        if glyphId then
            if spellId then
            if select(4, GetGlyphSocketInfo(i)) == spellId then
                return true
            end
            else
            glyphName = GetSpellName(glyphId)
            if glyphName:find(spell) then
                return true
            end
            end
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("range", function(target)
        return ProbablyEngine.condition["distance"](target)
    end)
    
    ProbablyEngine.condition.register("distance", function(target)
        if Distance then
            return math.floor(Distance(target, 'player'))
        else -- fall back to libRangeCheck
            local minRange, maxRange = rangeCheck:GetRange(target)
            return maxRange or minRange
        end
    end)
    
    ProbablyEngine.condition.register("level", function(target, range)
        return UnitLevel(target)
    end)
    
    ProbablyEngine.condition.register("combat", function(target, range)
        return UnitAffectingCombat(target)
    end)
    
    ProbablyEngine.condition.register("time", function(target, range)
        if ProbablyEngine.module.player.combatTime then
            return GetTime() - ProbablyEngine.module.player.combatTime
        end
        return false
    end)
    
    
    local deathTrack = { }
    ProbablyEngine.condition.register("deathin", function(target, range)
        local guid = UnitGUID(target)
        if deathTrack[target] and deathTrack[target].guid == guid then
            local start = deathTrack[target].time
            local currentHP = UnitHealth(target)
            local maxHP = deathTrack[target].start
            local diff = maxHP - currentHP
            local dura = GetTime() - start
            local hpps = diff / dura
            local death = currentHP / hpps
            if death == math.huge then
                return 8675309
            elseif death < 0 then
                return 0
            else
                return death
            end
        elseif deathTrack[target] then
            table.empty(deathTrack[target])
        else
            deathTrack[target] = { }
        end
        deathTrack[target].guid = guid
        deathTrack[target].time = GetTime()
        deathTrack[target].start = UnitHealth(target)
        return 8675309
    end)
    
    ProbablyEngine.condition.register("ttd", function(target, range)
        return ProbablyEngine.condition["deathin"](target)
    end)
    
    ProbablyEngine.condition.register("role", function(target, role)
        role = role:upper()
    
        local damageAliases = { "DAMAGE", "DPS", "DEEPS" }
    
        local targetRole = UnitGroupRolesAssigned(target)
        if targetRole == role then return true
        elseif role:find("HEAL") and targetRole == "HEALER" then return true
        else
        for i = 1, #damageAliases do
            if role == damageAliases[i] then return true end
        end
        end
    
        return false
    end)
    
    ProbablyEngine.condition.register("name", function (target, expectedName)
        return UnitExists(target) and UnitName(target):lower():find(expectedName:lower()) ~= nil
    end)
    
    ProbablyEngine.condition.register("modifier.party", function()
        return IsInGroup()
    end)
    
    ProbablyEngine.condition.register("modifier.raid", function()
        return IsInRaid()
    end)
    
    ProbablyEngine.condition.register("party", function(target)
        return UnitInParty(target)
    end)
    
    ProbablyEngine.condition.register("raid", function(target)
        return UnitInRaid(target)
    end)
    
    ProbablyEngine.condition.register("modifier.members", function()
        return (GetNumGroupMembers() or 0)
    end)
    
    ProbablyEngine.condition.register("creatureType", function (target, expectedType)
        return UnitCreatureType(target) == expectedType
    end)
    
    ProbablyEngine.condition.register("class", function (target, expectedClass)
        local class, _, classID = UnitClass(target)
    
        if tonumber(expectedClass) then
        return tonumber(expectedClass) == classID
        else
        return expectedClass == class
        end
    end)
    
    ProbablyEngine.condition.register("falling", function()
        return IsFalling()
    end)
    
    ProbablyEngine.condition.register("timeout", function(args)
        local name, time = strsplit(",", args, 2)
        if tonumber(time) then
            if ProbablyEngine.timeout.check(name) then
                return false
            end
            ProbablyEngine.timeout.set(name, tonumber(time))
            return true
        end
        return false
    end)
    
    local heroismBuffs = { 32182, 90355, 80353, 2825, 146555 }
    
    ProbablyEngine.condition.register("hashero", function(unit, spell)
        for i = 1, #heroismBuffs do
        if UnitBuff('player', GetSpellName(heroismBuffs[i])) then
            return true
        end
        end
        return false
    end)
    
    ProbablyEngine.condition.register("buffs.stats", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(1) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.stamina", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(2) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.attackpower", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(3) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.attackspeed", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(4) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.haste", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(4) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.spellpower", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(5) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.crit", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.critical", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.criticalstrike", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(6) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.mastery", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(7) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.multistrike", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(8) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.multi", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(8) ~= nil)
    end)
    
    ProbablyEngine.condition.register("buffs.vers", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(9) ~= nil)
    end)
    ProbablyEngine.condition.register("buffs.versatility", function(unit, _)
        return (GetRaidBuffTrayAuraInfo(9) ~= nil)
    end)
    
    ProbablyEngine.condition.register("charmed", function(unit, _)
        return (UnitIsCharmed(unit) == true)
    end)
    
    ProbablyEngine.condition.register("vengeance", function(unit, spell)
        local vengeance = select(15, _G['UnitBuff']("player", GetSpellName(132365)))
        if not vengeance then
            return 0
        end
        if spell then
            return vengeance
        end
        return vengeance / UnitHealthMax("player") * 100
    end)
    
    ProbablyEngine.condition.register("area.enemies", function(unit, distance)
        if UnitsAroundUnit then
            local total = UnitsAroundUnit(unit, tonumber(distance))
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("area.friendly", function(unit, distance)
        if FriendlyUnitsAroundUnit then
            local total = FriendlyUnitsAroundUnit(unit, tonumber(distance))
            return total
        end
        return 0
    end)
    
    ProbablyEngine.condition.register("ilevel", function(unit, _)
        return math.floor(select(1,GetAverageItemLevel()))
    end)
    
    ProbablyEngine.condition.register("firehack", function(unit, _)
        return FireHack or false
    end)
    
    ProbablyEngine.condition.register("offspring", function(unit, _)
        return type(opos) == 'function' or false
    end)
    We need to start putting update vers in these
    ProbablyEngine - Developer and Lead Support
    A Powerful Rotation Bot: ProbablyEngine

  12. #27
    T10H's Avatar Member
    Reputation
    2
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no need to implement changes to core to implement enumber, hack added eclipseRaw to latest PE just recently does the same thing.

  13. #28
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by T10H View Post
    no need to implement changes to core to implement enumber, hack added eclipseRaw to latest PE just recently does the same thing.
    can it detect how far you are into the eclipse ?

  14. #29
    ImogenOC's Avatar Contributor ProbablyEngine Community Manager
    Reputation
    173
    Join Date
    Nov 2013
    Posts
    364
    Thanks G/R
    0/8
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MrBrain1 View Post
    can it detect how far you are into the eclipse ?
    That is indeed what a raw integer would represent.
    ProbablyEngine - Developer and Lead Support
    A Powerful Rotation Bot: ProbablyEngine

  15. #30
    MrBrain1's Avatar Member
    Reputation
    3
    Join Date
    Dec 2009
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i cant figure it out.

    Code:
    -- Rotation 
       { "Starfire", {"player.buff(Celestial Alignment)", }},
      { "Starfire", {"player.lunar", "player.eclipse >= 20"}},
      { "Starfire", {"player.solar", "player.eclipse <= 20" }},
      { "Wrath",	 {"player.solar", "player.eclipse >= 20"}},
      { "Wrath",	{"player.lunar", "player.eclipse <= 20" }},

    /edit after some testing:


    so it seems, that player.lunar is only checking which direction you're going, so player.lunar indicates that your bar is going to the left.
    and player.eclipse >=20 is checking how much you are into an eclipse of ether side e.g. player.eclipse >=20 you are 20% into on of the sides, left or right.

    now the big question,
    how do i get Probably to difference betwen lunar and solar side. as of now it will cast starfire in direction lunar if youre above 20% Eclipse in ether side,
    solar also.
    which isnt quite what i want
    Last edited by MrBrain1; 03-14-2015 at 08:42 AM.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [Selling] US BNET account: 4 Level 80s, Shadowmourne Warrior, priest, mage, druid +SC2 and more
    By maddawg514 in forum World of Warcraft Buy Sell Trade
    Replies: 1
    Last Post: 09-12-2010, 04:11 PM
  2. [Selling] WoW EU - 80 paladin, 80 lock, 80 druid, 80 DK + more
    By Annihalation in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 08-10-2010, 10:50 AM
  3. [Druid] Boomkin PVE Guide
    By Ruudvan in forum World of Warcraft Guides
    Replies: 7
    Last Post: 03-18-2010, 09:17 AM
  4. [WIP] Druid Boomkin
    By tetragerd in forum World of Warcraft Model Editing
    Replies: 8
    Last Post: 01-26-2010, 02:44 PM
  5. WTS 70 Mage, 70 Paladin, 19 Twink, 51 Priest, 52 Druid, 69 Wlock + More [EU]
    By Krunkage in forum Members Only Accounts And CD Keys Buy Sell
    Replies: 1
    Last Post: 02-14-2009, 04:02 PM
All times are GMT -5. The time now is 06:17 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search