I already wrote about this script in "An Intermediate Guide to Scripting" but it looks like I choose a wrong thread.
I'm trying implement script which can reduce population in city.
Code:
script
	declare_counter loop
	set_counter loop 0

	monitor_event ButtonPressed ButtonPressed end_turn
	and Carthago SettlementPopulationMaxedOut
	console_command add_population Carthago -7000
	end_monitor

	while I_CompareCounter loop = 0
	end_while
end_script
In this way script start decrease population each turn if there 24000 in the settlement, but it doesn't stop!!! It' stop only when there are 400 men in the settlement(as I understand lowest level)
If I use terminate_monitor script reduce population only once...
What I should change If I want that script decrease population depending on it's size