Curious about what we're currently doing about bots? Check out the latest updates from staff in this thread.
Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
Which game are you doing this on? I only know about RNG in the Pokemon league in HGSS. If you find the unexpected frame change is stable, like it happens the same every time, you just adjust your frame advancements up or down accordingly.