- number scoreboard.GetScore([scoretype])
- Get the score.
- V1 Function Name
- New to V2
scoreboard.GetScore and scoreboard.GetGroupScore return the Rosetta energy score.
This formula converts the Rosetta score to the Foldit score:
Foldit score = 10 * (800 - Rosetta Energy)
The Rosetta score is represents "free energy", and is a negative number. A lower (more negative) Rosetta score is better.
The optional "scoretype" argument takes one of the following numeric values, which are returned from scoreboard.GetScoreType:
- 0: SCORE_SOLOIST
- 1: SCORE_EVOLVER
- 2: SCORE_ALL_HANDS
- 3: SCORE_NO_SCORE
See the feedback what are the different scores types? for the list of values. If "scoretype" is omitted, the result same as using scoreboard.GetScore ( scoreboard.GetScoreType () ). Specifying a different value for "scoretype" seems to produce incorrect results.
The following Lua code prints the current Foldit score and the equivalent Rosetta score. The Rosetta score is converted and compared to the Foldit score. The function scoreboard.GetScoreType is used just to be on the safe side.
function round3(x) return x - x % 0.001 end local cbs = current.GetEnergyScore () print ( "----Foldit scoring----" ) print ( "current Foldit score = " .. round3 ( cbs ) ) print ( "----Rosetta scoring----" ) local sbs = scoreboard.GetScore ( scoreboard.GetScoreType () ) print ( "Rosetta energy score = " .. round3 ( sbs ) ) local crs = 10 * ( 800 - sbs ) print ( "converted Rosetta score = " .. round3 ( crs ) ) print ( " current score - converted Rosetta score = " .. round3 ( cbs - crs ) )