Once enough soldiers have been trained in the barracks, the sword icon can be used to attack other players. You always get targets based on fortress Hall of Fame ranks.
For each opponent, you can see how much you could win. In addition, you can see how strong the opponent's defense is. If he has mages, you have to guess what the right army size is because the number of mages is not displayed.
You are always shown how high the chances are to win a fortress attack. You can see this by the color of the bar used to set your army size. If the army size is in the green area, it is very likely that the attack will succeed. Click on "Attack now!" to start the attack. Soldiers sent into battle never return.
The slider is only an indicator in terms of the cost/benefit factor related to the enemy strength. It is only an approximate aid and not a guaranteed victory.
If you want to attack another target, you can do so for free every five minutes or spend some gold. You can attack other fortresses until you run out of soldiers.