ALWAYS be prepared for an attack!
⋆ PROTECT YOUR LEADER ⋆
SHIELD or SHELTER!! If you're not shielded, shelter. If you're going offline, shelter everyone who fits. If you join a rally, leave one troop home to put in the shelter with your leader. Never send him gathering or put him in a camp.
⋆ KEEP RESOURCES LOW ⋆
Only keep on hand what fits in your vault. Gold is only protected at level 25, so don't stock up. Don't open any resources from your bag unless you're using it IMMEDIATELY.
⋆ PROTECT YOUR TROOPS ⋆
• Upgrade your infirmaries. Make sure your infirmaries are big enough to hold as many of your troops as possible so you only suffer wounds instead of deaths.
• Hold a fake rally. Pick a level 5 Darknest and set it for 8 hours.
• Reenforce and/or garrison a guild mate who has a long shield activated. (What's the difference?)
• Last resort: RUN. Send them to gather far away. Get them out for the attack, but don't let them stay there. Withdrawal when they're close or recall the second they get there. Keep them moving.