Scripts not to use Move Route

Hi !
I'm looking for scripts equivalents for Move route functionalities, to be able to chose the "moving" event with a variable.

For exemple : I want an event to wait, but the event is "$game_map.events[$game_variables[812]+121]", and I can't choose that in a Move Route. I can via script, but I don't know how to make an event wait via script.

My priority is waiting, because I need it for an event I'm working on right now, but if someone knows how to do other things from move route it could save me some precious time.

I know I have an other solution : make a condition and a move route for each event
(ex: if $game_variables[812]+121==122 then i make a Move Route for event 122, else if $game_variables[812]+121==123 then I make a Move Route for event 123 etc.), but it is fastidious and generates more lags.

So if anyone knows the command I'm looking for it would help a lot !
You need to make this instance variable accessible in Game_Character:
Ruby:
class Game_Character
  attr_accessor :wait_count
end
And then you can use a script call to set it
Code:
$game_map.events[ID].wait_count = N * 2
where N should be the number of frames you want it to wait, as if you were setting it through the Wait event command. Multiplying it by 2 is necessary.


Alternatively, you can make this new method:
Ruby:
class Game_Character
  def wait(frames)
    @wait_count = frames * 2
  end
end
and your script call would be
Code:
$game_map.events[ID].wait(N)
Don't have to remind yourself to multiply by 2 all the time.
It works! Thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/scripts-not-to-use-move-route.161688/