string msg = "Hello World!"; if (GamePlay is GameDef) { (GamePlay as GameDef).gameInterface.CmdExec("chat " + msg); }