The script is good, but I don't understand why would this script generate a random number in such a complicated way..
I mean all the crap at the top of the script where it gets Date, time, then multiplies it, randomizes, etc. - all this just to get a random number between 1 and 10.
So I guess...