This command will end your current mission. You will win if all objectives are completed. Otherwise, you will fail. To complete all objectives, you can use the ForceCompleteObjective command first, and then use the EndBattle command.
[0 or 1] can be 1 to end the battle with a win, as long as all objectives are completed, or 0 to end the battle with a loss.
The command endbattle 1 will end the battle with a win. The command endbattle 0 will end the battle with a loss.