spot dection scripting