WBarme1234 Lv 1
–Problem observed: One complete Cycle of Wiggle/Shake ends not always with the maximum of points possible
–This modification will detect and regain this lost points
scoreBestRanked = -999999.9
lscoreBestRanked = -999999.9
currentScore = -999999.9
scoreAtbestRanked = false
scorebestchge = true
function CheckLostPoints( )
currentScore = current.GetScore() – Get current(actual) Score
– print(" - Current Score : "..currentScore)
scoreBestRanked=creditbest.GetScore()
– print(" - Credited best Ranked Score : "..scoreBestRanked)
–Running always to verify if best score reached
if ( math.abs(scoreBestRanked - currentScore) < 1E-3 ) then
if ( scoreAtbestRanked == false ) then
scorebestchge = true – show 'change to best ranked score' only once
end
scoreAtbestRanked = true – Set bit: Recipe started or running along best ranked score
end
if ( scorebestchge == true ) then
print(" - Running along my own best ranking =",scoreAtbestRanked)
scorebestchge = false
end
–Running always after shake, wiggle, …
if ( scoreAtbestRanked and (scoreBestRanked>currentScore) and
(lscoreBestRanked<scoreBestRanked) ) then
creditbest.Restore() – regain lost points
print("Reseting to CreditBest-RankedScore - due to lost points detected")
end
lscoreBestRanked = scoreBestRanked
end
function Score()–return score, exploration too
CheckLostPoints( ) – Check for lost points
return uo.energy and current.GetEnergyScore() or current.GetScore()
end