Optimizing moving platform scripts