moved the estimated score to own function

René Welbers [01-10-16 - 11:35]
moved the estimated score to own function
Filename
RaidTimer.lua
diff --git a/RaidTimer.lua b/RaidTimer.lua
index 5e30c78..c5430f3 100644
--- a/RaidTimer.lua
+++ b/RaidTimer.lua
@@ -310,7 +310,7 @@ function RaidTimer.TimerUpdate()

             local estimatedScore = 0
             --if self.raidId == 6 then
-                estimatedScore = (currentPoints+((currentPoints)*((timeLimit-raidDuration)/10000)))
+                estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
             --else
                 --old formula
                 --estimatedScore = zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
@@ -356,7 +356,7 @@ function RaidTimer.ScoreUpdate(event, scoreType, scoreAmount, totalScore)
         if timeLimit > 0 and maxPoints > 0 then
             local estimatedScore = 0
             --if self.raidId == 6 then
-                estimatedScore = (currentPoints+((currentPoints)*((timeLimit-raidDuration)/10000)))
+                estimatedScore = self.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
             --else
                 --old formula
                 --estimatedScore = zo_max(zo_round(((timeLimit - (raidDuration * maxPoints / currentPoints)) * (maxPoints / 1000)) + maxPoints), zo_floor(currentPoints / 100))
@@ -442,6 +442,11 @@ function RaidTimer.TimerStop(event, trialName, totalScore, totalTime)
     self.savedVariables.raidStart = nil
 end

+-------Get Estimated Score--------
+function RaidTimer.EstimatedScore(currentPoints, maxPoints, timeLimit, raidDuration)
+    return (currentPoints+((maxPoints)*((timeLimit-raidDuration)/10000)))
+end
+
 -------Saving the location of the labels when /rt show-------
 function RaidTimer.SaveLoc()
     local self = RaidTimer