You can also have a look at my script example in here:
https://forums.totalwar.org/vb/showp...39&postcount=1