Animazioni cycle through scripting

I am basically a mapper but i am doing some scripting too to help building the testing module faster
In some tilesets there is very nice features that turba in/off with animation cycle
I wanted to know if it’s possibile to turn on/off animation cycle with scripting ti make these features turn on/off at certain times of day/night