Anyone know why I have an error here?
In game it says it's a nil error, last thing I need to fix before profile release. I am going to be going through the code and taking it out to check, but if anyone notices it first. Rep+
PHP Code:
local seal = GetShapeshiftForm("player")
local mana = (100 * UnitPower("player") / UnitPowerMax("player"))
local SelflessHealer = select(4, UnitAura("player", "Selfless Healer"))
local PlayerHP = (100 * (UnitHealth("player") + UnitGetIncomingHeals("player")) / UnitHealthMax("player"))
local TargetHP = (100 * (UnitHealth("target") + UnitGetIncomingHeals("target")) / UnitHealthMax("target"))
local Party1HP = (100 * (UnitHealth("party1") + UnitGetIncomingHeals("party1")) / UnitHealthMax("party1"))
local Party2HP = (100 * (UnitHealth("party2") + UnitGetIncomingHeals("party2")) / UnitHealthMax("party2"))
local Party3HP = (100 * (UnitHealth("party3") + UnitGetIncomingHeals("party3")) / UnitHealthMax("party3"))
local Party4HP = (100 * (UnitHealth("party4") + UnitGetIncomingHeals("party4")) / UnitHealthMax("party4"))
local Party5HP = (100 * (UnitHealth("party5") + UnitGetIncomingHeals("party5")) / UnitHealthMax("party5"))
-- Buff Seal if none
if single == nil and aoe == nil and seal ~= 1 then CastShapeshiftForm(1) end
-- Seal Swap
if not UnitIsDeadOrGhost("player") then
if IsInInstance() and (select(2, GetInstanceInfo()) == "party" or select(2, GetInstanceInfo()) == "raid") then
if (single == false or single == true or aoe == true) and seal ~= 1 and mana > 10 then
CastShapeshiftForm(1)
elseif aoeMode == false and seal ~= 2 and mana > 10 then
CastShapeshiftForm(2)
elseif mana <= 10 and seal ~= 4 then
CastShapeshiftForm(4)
end
elseif not IsInInstance() or IsInInstance() and (select(2, GetInstanceInfo()) == "pvp" or select(2, GetInstanceInfo()) == "arena") then
if PlayerHP <= 40 and seal ~= 4 then
CastShapeshiftForm(4)
elseif (single == false or single == true or aoe == true) and seal ~= 1 and PlayerHP > 55 then
CastShapeshiftForm(1)
elseif aoe == false and seal ~= 2 and PlayerHP > 55 then
CastShapeshiftForm(2)
end
end
end
-- Blessing of Might/Kings
if not IsMounted() and not UnitInVehicle("player") and not UnitIsDeadOrGhost("player") then
if not UnitBuffID("player", 19740) and not UnitBuffID("player", 116956) then
CastSpellByName(GetSpellInfo(19740), "player")
elseif UnitBuffID("player", 116956) then
if not UnitBuffID("player", 20217) and not UnitBuffID("player", 1126) and not UnitBuffID("player", 90363) and not UnitBuffID("player", 115921) then
CastSpellByName(GetSpellInfo(20217), "player")
end
end
end
-- Solo/Raid Healing
if not IsInInstance() or IsInInstance() and (select(2, GetInstanceInfo()) == "party" or select(2, GetInstanceInfo()) == "raid") then
-- Lay on Hands
if PlayerHP <= 20 and PQR_SpellAvailable(633) then
CastSpellByName(GetSpellInfo(633), "player")
-- Healthstone
elseif PlayerHP <= 25 and not PQR_SpellAvailable(633) and select(3,GetItemCooldown(5512)) == 1 and GetItemCount(5512,false,false) > 0 then
UseItemByName(5512)
elseif not IsInInstance() or IsInInstance() and select(2, GetInstanceInfo()) ~= "party" and select(2, GetInstanceInfo()) ~= "raid" then
-- Flash of Light
if PlayerHP <= 55 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
-- Pvp Healing
elseif IsInInstance() and (select(2, GetInstanceInfo()) == "pvp" or select(2, GetInstanceInfo()) == "arena") then
if UnitPower("player", 9) >= 3 or UnitBuffID("player", 90174) then
if PlayerHP <= 65 and Party1HP > 70 and Party2HP > 70 and Party3HP > 70 and Party4HP > 70 and Party5HP > 70 then
CastSpellByName(GetSpellInfo(85673), "player")
elseif Party1HP <= 65 and PQR_IsOutOfSight("party1") == false and InRange(85673, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(85673), "party1")
elseif Party2HP <= 65 and PQR_IsOutOfSight("party2") == false and InRange(85673, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(85673), "party2")
elseif Party3HP <= 65 and PQR_IsOutOfSight("party3") == false and InRange(85673, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(85673), "party3")
elseif Party4HP <= 65 and PQR_IsOutOfSight("party4") == false and InRange(85673, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(85673), "party4")
elseif Party5HP <= 65 and PQR_IsOutOfSight("party5") == false and InRange(85673, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(85673), "party5")
end
elseif UnitPower("player", 9) == 2 then
if PlayerHP <= 40 and Party1HP > 45 and Party2HP > 45 and Party3HP > 45 and Party4HP > 45 and Party5HP > 45 then
CastSpellByName(GetSpellInfo(85673), "player")
elseif Party1HP <= 40 and PQR_IsOutOfSight("party1") == false and InRange(85673, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(85673), "party1")
elseif Party2HP <= 40 and PQR_IsOutOfSight("party2") == false and InRange(85673, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(85673), "party2")
elseif Party3HP <= 40 and PQR_IsOutOfSight("party3") == false and InRange(85673, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(85673), "party3")
elseif Party4HP <= 40 and PQR_IsOutOfSight("party4") == false and InRange(85673, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(85673), "party4")
elseif Party5HP <= 40 and PQR_IsOutOfSight("party5") == false and InRange(85673, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(85673), "party5")
end
elseif SelflessHealer == 3 then
if PlayerHP <= 55 and Party1HP > 60 and Party2HP > 60 and Party3HP > 60 and Party4HP > 60 and Party5HP > 60 then
CastSpellByName(GetSpellInfo(19750), "player")
elseif Party1HP <= 55 and PQR_IsOutOfSight("party1") == false and InRange(19750, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(19750), "party1")
elseif Party2HP <= 55 and PQR_IsOutOfSight("party2") == false and InRange(19750, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(19750), "party2")
elseif Party3HP <= 55 and PQR_IsOutOfSight("party3") == false and InRange(19750, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(19750), "party3")
elseif Party4HP <= 55 and PQR_IsOutOfSight("party4") == false and InRange(19750, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(19750), "party4")
elseif Party5HP <= 55 and PQR_IsOutOfSight("party5") == false and InRange(19750, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(19750), "party5")
end
end
end
-- Manual Execution Sentence
if IsPlayerSpell(114157) and PQR_SpellAvailable(114157) and IsLeftAltKeyDown() and not GetCurrentKeyBoardFocus() then
if (InRange(114157, "target") or InRange(114157, "target") and not InRange(35395, "target")) and UnitBuffID("player", 84963) then
CastSpellByName(GetSpellInfo(114157), "target")
end
end
-- Manual Light's Hammer
if IsPlayerSpell(114158) and PQR_SpellAvailable(114158) and IsLeftAltKeyDown() and not GetCurrentKeyBoardFocus() then
-- Return false if something is more important
if UnitBuffID("player", 84963) == nil
or (UnitBuffID("player", 84963) and select(7, UnitBuffID( "player", 84963)) - GetTime() < 3)
or UnitPower("player", 9) == 5 or (UnitBuffID("player", 90174) and select(7, UnitBuffID( "player", 90174)) - GetTime() <= 2) then return false end
CastSpellByName(GetSpellInfo(114158))
if SpellIsTargeting() then CameraOrSelectOrMoveStart() CameraOrSelectOrMoveStop() end
return true
end
end
-- Hand of Freedom
--if PQR_SpellAvailable(1044) then
-- local debuff = { 116281, 105289, 110317 }
-- for i=1,#debuff do
-- if UnitDebuffID("player", debuff[i]) then
-- CastSpellByName(GetSpellInfo(1044), "player")
-- end
-- end
-- else
-- if IsRightAltKeyDown() and not GetCurrentKeyBoardFocus() then
-- CastSpellByName(GetSpellInfo(1044), "player")
-- end
-- end
--end
-- Sacred Shield
if not IsMounted() and UnitIsDeadOrGhost("player") == nil and IsPlayerSpell(20925) then
if not IsInInstance() or IsInInstance() and select(2, GetInstanceInfo()) ~= "party" and select(2, GetInstanceInfo()) ~= "raid" then
if UnitBuffID("player", 20925) == nil or UnitBuffID("player", 20925) and select(7, UnitBuffID( "player", 20925)) - GetTime() <= 2 then
CastSpellByName(GetSpellInfo(20925), "player")
end
elseif IsRightControlKeyDown() and not GetCurrentKeyBoardFocus() then
CastSpellByName(GetSpellInfo(20925), "player")
end
end
-- Lightwell
if PQR_LightwellTimeout == nil then PQR_LightwellTimeout = 0 end
if PlayerHP < 70 and UnitBuffID("player", 7001) == nil then
if PQR_LightwellTimeout < GetTime() then
if UnitDebuffID("player", 108220) == nil then
PQR_LightwellTimeout = GetTime() + 1
InteractUnit("Lightwell")
end
end
end
narrowed it down to pvp healing, unsure of what the problem is
PHP Code:
-- Solo/Raid Healing
if not IsInInstance() or IsInInstance() and (select(2, GetInstanceInfo()) == "party" or select(2, GetInstanceInfo()) == "raid") then
-- Lay on Hands
if PlayerHP <= 20 and PQR_SpellAvailable(633) then
CastSpellByName(GetSpellInfo(633), "player")
-- Healthstone
elseif PlayerHP <= 25 and not PQR_SpellAvailable(633) and select(3,GetItemCooldown(5512)) == 1 and GetItemCount(5512,false,false) > 0 then
UseItemByName(5512)
elseif not IsInInstance() or IsInInstance() and select(2, GetInstanceInfo()) ~= "party" and select(2, GetInstanceInfo()) ~= "raid" then
-- Flash of Light
if PlayerHP <= 55 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
-- Pvp Healing
elseif IsInInstance() and (select(2, GetInstanceInfo()) == "pvp" or select(2, GetInstanceInfo()) == "arena") then
if UnitPower("player", 9) >= 3 or UnitBuffID("player", 90174) then
if PlayerHP <= 65 and Party1HP > 70 and Party2HP > 70 and Party3HP > 70 and Party4HP > 70 and Party5HP > 70 then
CastSpellByName(GetSpellInfo(85673), "player")
elseif Party1HP <= 65 and PQR_IsOutOfSight("party1") == false and InRange(85673, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(85673), "party1")
elseif Party2HP <= 65 and PQR_IsOutOfSight("party2") == false and InRange(85673, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(85673), "party2")
elseif Party3HP <= 65 and PQR_IsOutOfSight("party3") == false and InRange(85673, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(85673), "party3")
elseif Party4HP <= 65 and PQR_IsOutOfSight("party4") == false and InRange(85673, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(85673), "party4")
elseif Party5HP <= 65 and PQR_IsOutOfSight("party5") == false and InRange(85673, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(85673), "party5")
end
elseif UnitPower("player", 9) == 2 then
if PlayerHP <= 40 and Party1HP > 45 and Party2HP > 45 and Party3HP > 45 and Party4HP > 45 and Party5HP > 45 then
CastSpellByName(GetSpellInfo(85673), "player")
elseif Party1HP <= 40 and PQR_IsOutOfSight("party1") == false and InRange(85673, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(85673), "party1")
elseif Party2HP <= 40 and PQR_IsOutOfSight("party2") == false and InRange(85673, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(85673), "party2")
elseif Party3HP <= 40 and PQR_IsOutOfSight("party3") == false and InRange(85673, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(85673), "party3")
elseif Party4HP <= 40 and PQR_IsOutOfSight("party4") == false and InRange(85673, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(85673), "party4")
elseif Party5HP <= 40 and PQR_IsOutOfSight("party5") == false and InRange(85673, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(85673), "party5")
end
elseif SelflessHealer == 3 then
if PlayerHP <= 55 and Party1HP > 60 and Party2HP > 60 and Party3HP > 60 and Party4HP > 60 and Party5HP > 60 then
CastSpellByName(GetSpellInfo(19750), "player")
elseif Party1HP <= 55 and PQR_IsOutOfSight("party1") == false and InRange(19750, "party1") and not UnitIsEnemy("party1", "player") then
CastSpellByName(GetSpellInfo(19750), "party1")
elseif Party2HP <= 55 and PQR_IsOutOfSight("party2") == false and InRange(19750, "party2") and not UnitIsEnemy("party2", "player") then
CastSpellByName(GetSpellInfo(19750), "party2")
elseif Party3HP <= 55 and PQR_IsOutOfSight("party3") == false and InRange(19750, "party3") and not UnitIsEnemy("party3", "player") then
CastSpellByName(GetSpellInfo(19750), "party3")
elseif Party4HP <= 55 and PQR_IsOutOfSight("party4") == false and InRange(19750, "party4") and not UnitIsEnemy("party4", "player") then
CastSpellByName(GetSpellInfo(19750), "party4")
elseif Party5HP <= 55 and PQR_IsOutOfSight("party5") == false and InRange(19750, "party5") and not UnitIsEnemy("party5", "player") then
CastSpellByName(GetSpellInfo(19750), "party5")
end
end
end
found a missing end but I still get the error =/