Script Accidentally Duplicates Items

Hi, sorry if this is the wrong place to post this.


I'm pretty new to scripting, but I've been working on a rune crafting script and have run into a problem. If you have only one rune in your inventory and you select it you're able to select it again for the second rune, essentially duplicating it. I have no idea how to fix it to be honest haha, I was hoping someone here could shed some light on how to fix it.


Here is a demo that includes my script, I figured it would make more sense this way.


https://www.dropbox.com/sh/q543pnj9ubixaxs/AACROFmAbeP6W1oxjvI00rgVa?dl=0


Thanks so much for taking a look.
I haven't looked at your script, but normally you'd look at how many items you have in inventory, and subtract how many have already been selected, in order to determine what's available.  So you should have a list somewhere of the items already selected and the quantities of each.
If the idea is


1: Select a rune,


2: Select another rune (to combine with, etc)


You would need to make sure that the second time around, you prevent the user from selecting a rune that is already selected.


So for example you could keep track of a list of items that have been selected, and then checking whether the selected item is already in the list or not.
Thanks guys, I'll give that a shot 😀

Original thread: https://forums.rpgmakerweb.com/threads/script-accidentally-duplicates-items.71539/