The two events
Bloodcrow Empires and War of the Realms both put foreign castles around your main castle in the Green kingdom. They are fought the same way: find the castles near you, then work through them.
What fortifying costs
Each fortify costs rubies, and the price climbs with every one you pay for: 1,200, then 1,210, 1,240, 1,270 and up. It drops back when the game resets the count.
A camp is fortified once, right before it is attacked, and again after it respawns.
Set a ceiling
Decide the highest price you are willing to pay and stop there. Above it you have two choices: attack the camp without fortifying, or wait until the price drops back.
Difficulty
Difficulty runs from Classic through Easy, Intermediate, Hard, Expert and Master — each with a plus step — up to Archmaster. It is chosen when the event has none selected yet.
Letting the bot do it
The Foreign Invasion bot detects which of the two events is on, scans for its castles within 50 tiles of your main castle every 5 minutes and cycles through them. It reads the current ruby price from the game and stops fortifying above your cap, then attacks without fortifying or waits — your choice.

