Is there a way to check if you actually buy/sell something in a shop?

Basically I want the shopkeeper to grumble about 'Window shoppers.'

if you access the shop and don't buy anything.
Put the party's amount of gold into a variable before and after.
Thanks for that 😀
What if the person buys and sells stuff and ends up with the same amount of gold?  You could run checks on the inventory but that could be cumbersome.  You would likely need some kind of script to keep track of how much is spent and sold at a ship.
you might be right yeah
But, if you bought and sold enough to make the gold even...  Why wouldn't the shopkeeper complain about "Window Shoppers" as well?  After all, he didn't make a profit at all, and you basically got crap you needed without giving him much of anything worth selling if he didn't make a profit.

Makes sense to me, at least.
In a way he did make a profit though, because he bought your stuff at half price and can now turn around and sell it for full price to the next player.
That's only assuming there are other people who buy weapons/armor in the game.  Most RPGs I've played?  Yeah, nobody buys anything in the games except the players.  NPCs typically browse without buying, and the only adventurers in the world are in your party.
I would probably rethink my career then if the only person who would buy my stuff is a once-in-a-lifetime hero.  I would hate to live in a world where a hero only comes along once a century.
Put this into a new plugin - any name. Decide what switch you want to use, and change the 5 on those two lines to that switch number.

When you leave a shop, do a conditional branch on the switch - if it's true, it means the player bought or sold something. If false, they didn't.

I haven't tested it. If it gives any errors, post back with the details.

Code:
var _Scene_Shop_prepare = Scene_Shop.prototype.prepare;Scene_Shop.prototype.prepare = function() {  _Scene_Shop_prepare.call(this);  $gameSwitches.setValue(5, false);}var _Scene_Shop_onNumberOk = Scene_Shop.prototype.onNumberOk;Scene_Shop.prototype.onNumberOk = function() {  _Scene_Shop_onNumberOk.call(this);  $gameSwitches.setValue(5, true);}

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-check-if-you-actually-buy-sell-something-in-a-shop.54728/