Unfortunately, I haven't been able to get the spacing right when copy-pasting to the blogger post editor. So I have to upload text files instead of pasting code right here. The Startscript code can be seen here.
Also: there is a call to a procedure called FillCloneLocationArray. This fills up an array called Locations with the contents of an object's Clone property. It can be found here.