I don't believe there is a way even by scripting, as flashlight is not an entity we can control it's all hard-coded in. You can only toggle on or off with 'F' key unless anyone knows different.
Professional Programmer: Languages- SAS, C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen).