Based on the need for potions and equipment, I'd recommend HiEv's. My simple inventory is designed for handling key items, that is, items that don't stack or have any complex parts of their own. You could extend it to handle more complicated item types, but that will take more work than using a system already tailored to those uses. F2Andy's system is fine for the most part, and other than being built for v1 of SugarCube primarily, it should still do most of what you need, but I'd generally recommend my simple inventory over that one, though I am obviously biased. At the least, I wouldn't use that code as a basis for building your own stuff since it is outdated and using deprecated stuff.