int(tokenat(AvailableActions, floor(random(tokencount(AvailableActions, ","))), ","))
example (r141)
Explanation:
int(tokenat(AvailableActions, floor(random(<font color="red">tokencount(AvailableActions, ",")</font>)), ","))
tells you how many values there are in AvailableActions separated by a comma (in this case <font color="blue">4</font>)
int(tokenat(AvailableActions, <font color="red">floor(random(<font color="blue">4</font>))</font>, ","))
give you a random number from 0 to 3 (e.g. <font color="blue">0</font>)
int(<font color="red">tokenat(AvailableActions, <font color="blue">0</font>, ",")</font>)
gives you the value in AvailableActions at position 0 (i.e. <font color="blue">"1"</font>)
<font color="red">int(<font color="blue">"1"</font>)</font>
converts the text into a number, int("1") = 1