to learn about the perfect spy script I would suggest reading ER's beginners guide to scripting.

Cheers,
RM3