Edit: Deleted the old script, due to poor programmer understanding of when/where to do updates to factory/factories.
Moved the factories update out of the i and j loops, and added a simple factory update. Much faster performance.
Attached improved script.
Edit, revised script in post 10 below.
|