Generating Customers for a shop-sim game?

this idea relates to an idea I have that was hatched while remembering old store-running games I used to play when I was a kid, and I thought "Maybe I could create something in this vain in RPG Maker.

The road block I've run into in this ideation process is how I might be able to implement semi-random customers that would order one of the items that the player could have at that point in the game, and come in at different times. Does anyone have any ideas on how I might be able to implement something like this?
one of the items that the player could have at that point in the game
Code:
inv = $gameparty.items + $gameparty.weapons + $gameparty.armors
inv.delete{|itm| itm.quest_item}
return inv[rand(inv.size)]

?
Code:
inv = $gameparty.items + $gameparty.weapons + $gameparty.armors
inv.delete{|itm| itm.quest_item}
return inv[rand(inv.size)]

?
I'm going to be completely honest: I have incredibly limited knowledge of actual code, so I'm not quite sure how to parse this out, although from what i can understand... It kinda looks like I could make a similar function with eventing? albeit with more lines involved
in order to ask for *one of the lot*, you have to define the lot first.
and for that you have to gather items (minus quest items which are unusable), weapons and armors.
if you can do that with eventing, you got it.
Declare an array of customer event ids then use an event spawner to randomly pick an index in the array to spawn
you can use the script call:

$gameParty.gainItem($dataItems[$gameVariables.value(X)], Y);

to add the item with the ID equal to the value of variable number X. Y is the amount added.

for example, if you replace X with 1, you can set variable number 1 in the editor to 10 and this script will add item number 10 in the database to your inventory.

to take away items you use:

$gameParty.loseItem($dataItems[$gameVariables.value(X)], Y);

it works in the same way.

you can put this script call in a common event and then make everyhing with just events.

hope that explanation is understandable :/
you can use the script call:

$gameParty.gainItem($dataItems[$gameVariables.value(X)], Y);

to add the item with the ID equal to the value of variable number X. Y is the amount added.

for example, if you replace X with 1, you can set variable number 1 in the editor to 10 and this script will add item number 10 in the database to your inventory.

to take away items you use:

$gameParty.loseItem($dataItems[$gameVariables.value(X)], Y);

it works in the same way.

you can put this script call in a common event and then make everyhing with just events.

hope that explanation is understandable :/
I think I can wrap my head around this explanation best, and I think it'll all fall into place after some good ol' trial and error testing and learning

I've never been particularly great at the more "technical" aspects of game development (Read: script/coding) but I think with everything said here I can start to improve at least a little. Thanks
oh, there's also conditional branch event > script with this:

$gameParty.hasItem($dataItems[$gameVariables.value(X)])

this checks if you have the item with ID equal to the value of variable X.

so if you set variable X to 10 this will check if you have item number 10 in the database.

It will probably come in handy if you're dealing with randomized items.
This video explains how I handled almost the same problem. I use a set list of items rather than a random value but you could definitely integrate the methods others have explained above to achieve what you're looking for.

I've moved this thread to MV Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/generating-customers-for-a-shop-sim-game.166249/