What you are asking is a specific feature of the specific game. There is no universal solution.
-w is a very common parameter for what you want to achieve, but we could help you better if you actually bothered to tell what game you are talking about.