Code for timelapse rig control