Posted 12 September 2013 - 04:42 PM
Hey folks! Here's the gist of my program: I can request an item to be crafted by saying "$$craft <amount> <item_name>". I can also manipulate the items in a similar manner. In order to be able to say something like "$$craft 5 glass", I've created a table of some item IDs like so:
Now, that's all good and working fine. I also have an add command to manually index the values ingame using this: "$$add <item_name> <ID>". I have no problems with that command, it works just fine. The problem arises when I need to make changes to the script, and those values are gone. One method I thought might work is saving the table to a disk, then loading it on the program's startup. How would I do something like this while retaining the ability to manually add values? Or is there another method I should be pursuing? Thanks!
itemIndex = {}
itemIndex["glass"] = 20
itemIndex["chest"] = 54
Now, that's all good and working fine. I also have an add command to manually index the values ingame using this: "$$add <item_name> <ID>". I have no problems with that command, it works just fine. The problem arises when I need to make changes to the script, and those values are gone. One method I thought might work is saving the table to a disk, then loading it on the program's startup. How would I do something like this while retaining the ability to manually add values? Or is there another method I should be pursuing? Thanks!