This is easier in Python.
In this file I generate a list of integers where each value is between 5 and 10 greater than the last eg
0, 9, 18, 26, 31, 41, 47, 57, 67, 75, 83, 90, 99, 105...
then when anim runs, I check if the current frame is in the list.
if in list > output a 0 to unfreeze the random number
if not in list > output a 1 to freeze the random number
import c4d
import random
def main():
global my_list, Output1
frame = doc.GetTime().GetFrame(doc.GetFps()) # current frame
# make list of frames when output changes
if frame == 0:
my_list = [0]
for a in range(1, 500): # number of value changes
rnd = random.randint(5, 10) # random integer between 5 - 10 inclusive
temp = my_list[a - 1] # previous list item
new_val = temp + rnd # add rnd 5-10 to prev value
my_list.append(new_val) # add to list
# unhide this line to see list in console
# print my_list
# if current frame in my_list get new random value
if frame in my_list:
Output1 = 0 # unfreeze for new value
else:
Output1 = 1 # freeze current value
random 5-10F.c4d