Track item sales with variables?

What I'd like to do is pretty simple, but search as I may, I can't seem to find any info on how to do it.  I would just like to have variables attached to certain items that will increase as they are sold.  I found one script that seemed like it would work, but it wasn't working/compatible and it was from a very old discussion, so feedback on it is unlikely.  Any insight on this issue would be appreciated.  Thanks.
Without breaking into the script and aliasing anything I wouldn't be able to help on that end. However, you could potentially have an event that occurs right before you call Shop Processing on a merchant, for example, (it would be copy/pastable) that stores how many of said item you have in a variable, and then after the Shop Processing it could use another variable to store your new amount of that item, subtract one from the other and store/add that final difference to the variable you're looking for. 


Here's what an example might look like example.png


Hope this helps, btw since it seems odd to buy something and sell it in the same transaction, just know that this won't account for doing something like that. I just whipped it up as an example to show you how you could do some math and keep track of things without having to do anything plugin-wise
Without breaking into the script and aliasing anything I wouldn't be able to help on that end. However, you could potentially have an event that occurs right before you call Shop Processing on a merchant, for example, (it would be copy/pastable) that stores how many of said item you have in a variable, and then after the Shop Processing it could use another variable to store your new amount of that item, subtract one from the other and store/add that final difference to the variable you're looking for. 


Here's what an example might look like


Hope this helps, btw since it seems odd to buy something and sell it in the same transaction, just know that this won't account for doing something like that. I just whipped it up as an example to show you how you could do some math and keep track of things without having to do anything plugin-wise

Thank you.  I'll keep that option in mind.  I hadn't thought of going at it from that angle. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/track-item-sales-with-variables.60158/