Hello! I have been searching through the forums and the documentation and I haven't been able to find anything about this, so I apologize if I missed it.
Basically, I am hoping to write an ASH script that iterates through all of the items in my inventory and then conditionally runs code depending on what it finds. I would like to be able to do this without explicitly listing all items that I would ever like to act upon. For example, I would rather not be forced to edit my script every time new items are added to the game.
Is there any way to do this? The only thing I can think of is something like the following (pseudo C-style code):
However, this doesn't seem very efficient. Is there a better way to do this? Any help would be greatly appreciated.
Basically, I am hoping to write an ASH script that iterates through all of the items in my inventory and then conditionally runs code depending on what it finds. I would like to be able to do this without explicitly listing all items that I would ever like to act upon. For example, I would rather not be forced to edit my script every time new items are added to the game.
Is there any way to do this? The only thing I can think of is something like the following (pseudo C-style code):
Code:
for (int i = 1; i <= MAX_ITEM_ID; i++)
{
myItem = int_to_item(i);
count = item_amount(myItem);
if (count >= 1)
{
....
}
}
However, this doesn't seem very efficient. Is there a better way to do this? Any help would be greatly appreciated.