Better random number generation for scripts