' This script records streaks of points made in a row.
' Each time the shooter makes a point, 1 is added to the current streak counter cs0.count
' When a seven-out occurs, a streak is finished and
' the length is recorded on the corresponding checkstack.
' For example, if 4 points are made in a row, then checkstack4 is incremented by 1
' Note that comeout naturals don't break a streak
If beginning new session Then
cs0.count = 0 :
csn0.#ofstreaks = 0
EndIf
If a point is decided FOR any(4, 5, 6, 8, 9, 10) Then
add 1 to cs0.count
ElseIf seven out Then
If cs0.count > 0 Then
csn0.#ofstreaks = val(csn0.#ofstreaks) + 1 & " streaks" :
add 1 to cs(cs0.count) :
' update all %'s due to new denominator
cs0.count = 20 :
Do
If cs(cs0.count) > 0 Then
csn(cs0.count) = 100 * cs(cs0.count) / val(csn0.#ofstreaks) & "%" :
EndIf
subtract 1 to cs0.count
If cs0.count = 0 Then ExitDo EndIf
Loop
EndIf
EndIf