How do you write command in script

I would like to make an event do something in script, for example, walking. I wanted to learn MV api, so my intention to write event's command in script. So what is the object to start with? $gamemap.event[id]?
Most of the event commands lies in the Game_Interpreter, so if you want to replicate how they work in script, that is a good place to start.
To get an event object from the map its:
Code:
$gameMap.event(ID)
or
$gameMap._events[ID]
@Quxios Why did you quit making any more scripts, bro? You are a few good scripters out here.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-write-command-in-script.79565/