Scripting game player's movement on map

What are and how does one use script / script calls to temporarily automate the game player's sprites movement on the map.  I would like to be able to control the game player's movement under certain conditions purely from script in a .js file (without using MV's interface such as the event editors or note tags, etc).  Thanks!
you can either use


//Option 1.(better to use this)
$gamePlayer.moveStraight(direction);
//direction being 2,4,6 or 8.

//or you can use
$gamePlayer._x += value;
$gamePlayer._y += value;



but I'd highly recommend using the first one, as the latter can be troublesome if not used correctly, and requires a few extra parameters being applied. 🙂
Thanks Chaucer, that's just what the doctor ordered!
No problem glad I could help, 🙂 also if you choose to usethe second option use thefollowing iff statement or the movement will be extremely wonky, I.e. youll keep moving for further distance than planned, if called multiple times, and you'll go through everything.

Code:
if (!$gamePlayer.isMoving() && $gamePlayercanPass($gamePlayer._x,$gamePlayer_y, direction) {
//direction = the direction you plan on moving in.
$gamePlayer._x++;
} 

Original thread: https://forums.rpgmakerweb.com/threads/scripting-game-players-movement-on-map.58863/