Created "is_ingredient" and "part_of_recipe" utility functions

Sandiman

Member
One of my friends wanted a script that would tell him if a particular item was part of any recipes. Don't ask me why he wanted it, but it gave me something to do.

I figured I'd share the wealth, in case anyone else wanted this for some reason.

PLEASE NOTE that this script will create/overwrite a file in the directory from which it is called. By default, this file is "inverseconcoctions.txt". This file is generated automatically the first time one of the utility functions is called. Because it takes a while, it outputs several lines of code to let the user know it's working (one line for every line in concoctions.txt)

The attached script has a main() method for testing/example purposes. If the (by default) "inverseconcoctions.txt" file exists, then the output of the main() function is as follows:
Code:
Checking Frosty's arm
IS ingredient
Part of the following recipes:
Staff of the Deepest Freeze
(End of list)
Checking shirt kit
IS ingredient
Part of the following recipes:
barskin cloak
bat-ass leather jacket
clownskin harness
demonskin jacket
gnauga hide vest
hipposkin poncho
tuxedo shirt
white snakeskin duster
yak anorak
(End of list)
Checking moxie weed
IS NOT ingredient
Not part of any recipes
COMPLETED

If anyone wants to use these functions, feel free. If anyone knows of an easier/faster/better way to do this, please let me know!
 

Attachments

  • ingredientFunctions.ash
    3.3 KB · Views: 84
Top