Help with battles!

Okay, so I've got a battle set up where 

- You enter a forest

- A bandit sees you, approaches you, initiates a text screen and then a battle ensues.

- After said battle the event repeats

My question is how do I get it so when the battle finishes, the bandits (back in the forest) run away/disappear and don't start the event again?
You must add a second page and set it to Control Self Switch :A/B/C/D

Then on the first page, the very last command should be Control Self Switch A/B/C/D. This is how you turn the page in your event to prevent it from looping. On the second page, just leave it blank.

At the end of page one, it will read the Control Self Switch and then go to the next page. Since page 2 will be higher than Page 1, it will be read first. Since the Switch A is on, the event will stop there since it:

Is a higher page number and it's conditions are being met. The condition being that a self switch is on.

Events are read backwards. Like reading a book from the ending to the beginning.
You need a switch.

Here is what you do:

Go to the event with the battle in it and add a new tab at the top.

Leave the event box empty(for now) but in the left hand corner locate where it says self-switch and set it to A. 

Now go back to the original tab and after that battle, do what you need to do(like have the bandit walk away and disappear) and then to cap off the whole event, turn self-switch A to ON. This should solve your repeating problem 🙂  
Also, so that you don't have a jarring delete effect, you can set up the event to do a quick fade using a move route and wait commands in the move route to make easier on the player, visually speaking.

Oh and if you do that, have it happen before the event ends.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-battles.18510/