Originally Posted by
cukiemunster
I noticed some coding had "else" written into them. Should I add this in, to make it look like this?
Code:
local SavageRoar, _, _, _, _, _, SavageRoarEndTime = UnitBuffID("player", 62071)
local Rip, _, _, _, _, _, ripEndTime = UnitDebuffID("target", 1079, "PLAYER")
local playerCP = GetComboPoints("player", "target")
if Rip == nil then
return false
end
else
if SavageRoar then
local SavageRoarFinishTime = SavageRoarEndTime - GetTime()
if SavageRoarFinishTime < 2 then
return true
end
if Rip then
local ripFinishTime = ripEndTime - GetTime()
if playerCP == 5 and ripFinishTime < 12 then
if SavageRoarFinishTime < 6 and SavageRoarFinishTime < ripFinishTime then
return true
end
end
end
return false
else
if playerCP > 0 then
return true
end
end
EDIT: One more question lol. How can I add into this to NOT SR if Rip has less than 6 seconds left? I have noticed quite a few times that Rip will have 2-3 seconds left, and SR will cast, and cause a 3-6 seconds lapse in Rip uptime before I get 5 CP for the reapply, and that shit adds up over a fight.
Code:
local SavageRoar, _, _, _, _, _, SavageRoarEndTime = UnitBuffID("player", 62071)
local Rip, _, _, _, _, _, ripEndTime = UnitDebuffID("target", 1079, "PLAYER")
local playerCP = GetComboPoints("player", "target")
-- Get time left on debuffs
if SavageRoar then
local SavageRoarFinishTime = SavageRoarEndTime - GetTime()
end
if Rip then
local ripFinishTime = ripEndTime - GetTime()
end
-- If Rip is off return false
if Rip == nil then
return false
-- If Rip finish time is < 6 seconds then return false
else if RipFinishTime < 6 then
return false
-- If Savage Roar ends in 2 seconds return true
else if SavageRoarFinishTime < 2 then
return true
-- If 5 combat points and Rip falls off in less than 12 seconds then
-- If Savage roar ends in less than 6 and Savage roar finish time is less than Rip finish time then return true
else if playerCP == 5 and ripFinishTime < 12 then
if SavageRoarFinishTime < 6 and SavageRoarFinishTime < ripFinishTime then
return true
-- if combat points are greater than 0 return true
else if playerCP > 0 then
return true
end
end
end
end
end
end
You might need to prioritize them and move them around, so I spaced them out.
I think the way lua works is if it finds a true statement it ignores the rest.
Example:
If 3 > 4 then
return false
end
--skipped because first is true
if 3 < 4 then
return true
end
Am I right on this? Can someone who has knowledge of lua tell me.