ARRAY push ANYTHING
Adds ANYTHING to the end of ARRAY.
Does exactly what ARRAY set [count ARRAY, ANYTHING] does, only willo not fail in scheduled environment.
In scheduled environment a script can go into suspension half way through, and and then resume later on while having the same values in variables before the suspension. Because of this, the values of variables may be already too old after suspension.
For example, if I want to add an element to the end of array in one spawned loop while another spawned loop is also set to modify the same array, if 1st loop goes into suspension between
_end = count myArray;
myArray set [_end, "something"];
the sexond loop can modify the array and "something will be added not to the end of array but to (end - 1). See repro.
Because ARRAY set [count ARRAY, ANYTHING] is actually 2 commands and not one, there is a chance the script can go into suspension in between.
set command can be modified to take the end of array as index, so it will become push.