Keep track of the "last_script" and "last_script_of_type" and update TODOs