Random battle... part2

Hi there, I originally began on a project based on a turn based engine, however, it has evolved into something much more different…

I have come back to the random battle selection… Here’s my question.

When I had first started, I set an AS to trigger a random(99) as the user pressed a key(movemenr key up, down, etc.) but that was inefficient as a person holding down the key would be more likely to enter a battle, than the other who taps the movement button.

So I decided to do a manual tile based random battle… Here is where I come to a dead end. How do I make the random(99) only trigger itself once,when the hero.mc goes over it and allow itself to retrigger itself once the hero.mc leaves it?

GOAL:
create the most efficient random battle generator.
(after moving a few, the gamer is sent to the battle scene).