How do I get the time of trinket13 or trinket14? I tried using getTime but I must be doing it wrong.
My double jeopardy code is below, can someone tell me why it only attacks focus even though I have the glyph?
Am I checking glyph's wrong?
edit2:
This is what I have now.
PHP Code:
local doubleJeopardy = { 41092, 57030, 54922, 121027 }
for i=1,#doubleJeopardy do
if HaveGlyph(i) then
It doesn't seem to work so I tried to change it to this
PHP Code:
local doubleJeopardy = { 41092, 57030, 54922, 121027 }
for i=1,#doubleJeopardy do
if HaveGlyph(doubleJeopardy[i]) then
Still doesn't work but my flag pickup works this way?
PHP Code:
-- Pvp Flag
local flag = { "Alliance Flag", "Horde Flag", "Netherstorm Flag" }
for i=1,#flag do InteractUnit(flag[i]) end
edit:
Some updates for people.
PHP Code:
-- Exorcism
local massExorcism = { 83107, 122030, 122028, 85703 }
if UnitBuffID("player", 87138) and UnitPower("player", 9) < 5 or UnitPower("player", 9) < 5 then
for i=1,#massExorcism do
if HaveGlyph(i) then
if RangeCheck(85256, "target") then
CastSpellByName(GetSpellInfo(122028), "target")
end
elseif not HaveGlyph(i) then
if RangeCheck(879, "target") then
CastSpellByName(GetSpellInfo(879), "target")
end
end
end
end
PHP Code:
-- Double Jeporady
if switchedTargets == nil then switchedTargets = false end
-- Judgment
local doubleJeopardy = { 41092, 57030, 54922, 121027 }
for i=1,#doubleJeopardy do
if HaveGlyph(i) then
if UnitExists("focus") and RangeCheck(20271, "focus") and switchedTargets == false then
CastSpellByName(GetSpellInfo(20271), "focus")
switchedTargets = true
elseif UnitExists("target") and RangeCheck(20271, "target") and switchedTargets == true then
CastSpellByName(GetSpellInfo(20271), "target")
switchedTargets = false
end
elseif not HaveGlyph(i) then
if UnitExists("focus") and RangeCheck(20271, "focus") then
CastSpellByName(GetSpellInfo(20271), "focus")
elseif UnitExists("target") and RangeCheck(20271, "target") then
CastSpellByName(GetSpellInfo(20271), "target")
end
end
end
PHP Code:
if IsPlayerSpell(20925) then
local csSTART, csDURATION = GetSpellCooldown(35395)
local jSTART, jDURATION = GetSpellCooldown(20271)
local exoSTART, exoDURATION = GetSpellCooldown(879)
local howSTART, howDURATION = GetSpellCooldown(24275)
local esSTART, esDURATION = GetSpellCooldown(114157)
local lhSTART, lhDURATION = GetSpellCooldown(114158)
local hpSTART, hpDURATION = GetSpellCooldown(114165)
-- GCD Check
if csSTART - GetTime() + csDURATION < 1 and csSTART - GetTime() + csDURATION > 0
or jSTART - GetTime() + jDURATION < 1 and jSTART - GetTime() + jDURATION > 0
or exoSTART - GetTime() + exoDURATION < 1 and exoSTART - GetTime() + exoDURATION > 0
or howSTART - GetTime() + howDURATION < 1 and howSTART - GetTime() + howDURATION > 0
or esSTART - GetTime() + esDURATION < 1 and esSTART - GetTime() + esDURATION > 0
or lhSTART - GetTime() + lhDURATION < 1 and lhSTART - GetTime() + lhDURATION > 0
or hpSTART - GetTime() + hpDURATION < 1 and hpSTART - GetTime() + hpDURATION > 0
or UnitBuffID("player", 87138)
or UnitPower("player", 9) >= 3
or PQR_SpellAvailable(35395)
or PQR_SpellAvailable(20271)
or PQR_SpellAvailable(879)
or PQR_SpellAvailable(24275)
or PQR_SpellAvailable(114157)
or PQR_SpellAvailable(114165)
or PQR_SpellAvailable(114158)
then return false else CastSpellByName(GetSpellInfo(20925), "player") end end
PHP Code:
local PlayerHP = 100 * UnitHealth("player") / UnitHealthMax("player")
local selflessHealer = select(4, UnitAura("player", "Selfless Healer"))
-- Lay on Hands
if PlayerHP <= 20 and PQR_SpellAvailable(633) then
CastSpellByName(GetSpellInfo(633), "player")
-- Healthstone
elseif PlayerHP <= 20 and not PQR_SpellAvailable(633) and select(3,GetItemCooldown(5512)) == 1 then
UseItemByName(5512)
elseif not IsInInstance() or IsInInstance() and select(2, GetInstanceInfo()) ~= "party" and select(2, GetInstanceInfo()) ~= "raid" then
-- Flash of Light
if PlayerHP <= 50 and selflessHealer == 3 then
CastSpellByName(GetSpellInfo(19750), "player")
-- Word of Glory
elseif PlayerHP <= 65 and ( UnitPower("player", 9) >= 3 or UnitBuffID("player", 90174) ) then
CastSpellByName(GetSpellInfo(85673), "player")
end
end
PHP Code:
--No Seal
if singleMode == nil and aoeMode == nil and GetShapeshiftForm("player") == 0 then CastShapeshiftForm(1) end
--Seal Switching
local PlayerHP = 100 * UnitHealth("player") / UnitHealthMax("player")
if not UnitIsDeadOrGhost("player") then
if IsInInstance() and (select(2, GetInstanceInfo()) == "party" or select(2, GetInstanceInfo()) == "raid") then
if (singleMode == false or singleMode == true or aoeMode == true) and GetShapeshiftForm("player") ~= 1 then
CastShapeshiftForm(1)
elseif aoeMode == false and GetShapeshiftForm("player") ~= 2 then
CastShapeshiftForm(2)
end
elseif not IsInInstance() or IsInInstance() and (select(2, GetInstanceInfo()) == "pvp" or select(2, GetInstanceInfo()) == "arena") then
if PlayerHP <= 40 and GetShapeshiftForm("player") ~= 4 then
CastShapeShiftForm(4)
elseif (singleMode == false or singleMode == true or aoeMode == true) and GetShapeshiftForm("player") ~= 1 and PlayerHP > 40 then
CastShapeshiftForm(1)
elseif aoeMode == false and GetShapeshiftForm("player") ~= 2 and PlayerHP > 40 then
CastShapeshiftForm(2)
end
end
end
PHP Code:
function RangeCheck(spellid, t)
if IsSpellInRange(GetSpellInfo(spellid), t) == 1 then
return true
end
return false
end
function HaveGlyph(id)
for i = 1, GetNumGlyphSockets() do
if select(4, GetGlyphSocketInfo(i)) == id then return true end
end
return false
end