This is not finished but I thought the inventory list with serials matched and one serial for stackable items was cool and wanted to share it.
The serial is just used as a hotspot id at the moment but you can see how easy 'wear <serial>' commands are to make instead of finding the key words by parsing the 'id <item keyword>' command or the 'inventory' output (don't even know how you can do that with inv list) for each item. One limitation is the 'sacrifice' command won't work with serials and as I see it this is one of the more useful commands to use with serials because you can loot then drop and sacrifice with a click without doing an 'id <item keyword> to get keywords, however the 'get <serial>' does work after you drop an item so maybe it's unfinished.
My plan is to make the mouse over display a window with the id command output displayed for the item but I can send the commands to get that data if and when I want it and store it in my database and use serials to reference the items for MUD commands.
The test for checking if an item is stackable just uses the item description and level at the moment. This worked for my inventory at the moment. I had a lot of trouble with this algorithm and Lua code, I ended up with three tables. At the moment only description and level is used to test if item is stacked, I think this is enough but will find out.
One thing I am not sure about this idea is that at one point the 'invdata' output and the 'inventory' output did not match. I did a 'give all.potion <player name>' command and it all synced up ok so not sure how to silently put this in or maybe I'll make a test for it if I can re-make the problem.
Once I have all commands and windows working I'll move on to containers. That being the main reason I want a clickable inventory list.
Forgive the bad code if anyone wants to tell me why it's bad please do. :)
Use 'inw' to display the window.
The serial is just used as a hotspot id at the moment but you can see how easy 'wear <serial>' commands are to make instead of finding the key words by parsing the 'id <item keyword>' command or the 'inventory' output (don't even know how you can do that with inv list) for each item. One limitation is the 'sacrifice' command won't work with serials and as I see it this is one of the more useful commands to use with serials because you can loot then drop and sacrifice with a click without doing an 'id <item keyword> to get keywords, however the 'get <serial>' does work after you drop an item so maybe it's unfinished.
My plan is to make the mouse over display a window with the id command output displayed for the item but I can send the commands to get that data if and when I want it and store it in my database and use serials to reference the items for MUD commands.
The test for checking if an item is stackable just uses the item description and level at the moment. This worked for my inventory at the moment. I had a lot of trouble with this algorithm and Lua code, I ended up with three tables. At the moment only description and level is used to test if item is stacked, I think this is enough but will find out.
One thing I am not sure about this idea is that at one point the 'invdata' output and the 'inventory' output did not match. I did a 'give all.potion <player name>' command and it all synced up ok so not sure how to silently put this in or maybe I'll make a test for it if I can re-make the problem.
Once I have all commands and windows working I'll move on to containers. That being the main reason I want a clickable inventory list.
Forgive the bad code if anyone wants to tell me why it's bad please do. :)
Use 'inw' to display the window.