It would help to know how often and under what conditions you want the script to respond.