Solved-How to condense 'is X or Y or Z buttons pressed' conditional branches into one through script

Hi there! Context, I'm trying to make http://yanfly.moe/2015/12/03/yep-36-map-gold-window/ this window appear and disappear whenever the character moves or stops in place. Unfortunately I don't know how to do that directly as an extension to the code yet so I am using in editor events instead.

I have this parallel event that involves checking if the character is moving in any direction, if they are moving it will call on the plugin command that opens the window, if not, it will call on another plugin command to close it.

I know I can do it by having multiple Conditional branches, 'if left button is pressed' etc, but I was wondering how I can condense this into one working if statement via script (I think it involves Input.isPressed? I'm sorry, this is one of the lines I found in the core that has to do with buttons. Not the a lit bulb with this yet. ^^') and use || between the 4 buttons, instead of having 4 conditional branches that pretty much do the same thing after its confirmed that the player is or not moving.

Can someone point me to the right direction on how this is done, or if there is a better way of doing this? Should I scrap the entire idea of using events and it's more efficient to code an extension? Thank you.
There is a script that checks if the player is moving
Code:
$gamePlayer.isMoving()
If that doesn't work the way you want and you want to use the key is pressed method you could use this
Code:
Input.isPressed('left') || Input.isPressed('up') || Input.isPressed('right') || Input.isPressed('down')
The || functions as the word 'or' and checks each condition individually and if one of them is true then the whole thing is true. If in the future you're looking for the 'and' method you can use &&
@Silva
Ahhh I see! Thank you very much for pointing that out.
I see what I was doing wrong, I placed the || in the wrong place and now it works. I'll be using the .isMoving script since I like the format better, thank you for explaining everything! ^o^

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-to-condense-is-x-or-y-or-z-buttons-pressed-conditional-branches-into-one-through-script.108066/