namespace = FNmathutils\rnd

; $\FNmathutils\rnd\min = 0
; $\FNmathutils\rnd\max = 10
; run = commandlist\FNmathutils\rnd\run
; result = $\FNmathutils\rnd\result

[Constants]
global $min
global $max
global $speed = 20.0
global $result

[CommandListRun]
local $t = time * $speed

local $t1 = $t * 1.31
local $t2 = $t * 0.73 + 1.5

$\FNmathutils\sin\in = $t
run = CommandList\FNmathutils\sin\run
local $s1 = $\FNmathutils\sin\result

$\FNmathutils\cos\in = $t1
run = CommandList\FNmathutils\cos\run
local $c1 = $\FNmathutils\cos\result

$\FNmathutils\sin\in = $t2
run = CommandList\FNmathutils\sin\run
local $s2 = $\FNmathutils\sin\result

local $v = $s1 + $c1 + $s2

local $norm = ($v + 3) / 6

$result = $norm * ($max - $min + 1) // 1 + $min

$min = 0
$max = 0
$speed = 20.0



