Here is some useful scripting for auto-running a campaign,
campaign_script.txt
Code:
monitor_event RequestTrainingAdvice
console_command toggle_fow
console_command toggle_perfect_spy
end_monitor
As "toggle_perfect_spy" only works in a script and not in the console. this will toggle both fog of war and perfect spy (see all enemy stats, armies etc.) on or off whenever you ask for advice about which unit to train (a pretty much un-used command.) This is also useful for play-testing a mod without auto-run. Note if you save the game without toggle off first, "perfect_spy" will be disabled while fow will stay, thus they will toggle alternately unless you toggle perfect spy on then manually toggle fow.
Code:
monitor_event FactionTurnEnd FactionType slave
inc_counter myturn 1
if I_CompareCounter myturn = 50.0
console_command control papal_states
end_if
if I_CompareCounter myturn = 20.0
console_command control papal_states
end_if
end_monitor
This automatically puts you in control at the set turn number, remember to declare "myturn" counter. I choose 'papal states' and order the AI to never attack the pope and make the pope inactive, although technically it could be any faction, but if stated faction is destroyed it causes problems.