A function to help script sequential events.