MLRecipe Plug-in for Cinemar's MainLobby Server

MLRecipe - A Plug-in to manage recipes.

About the script. It currently takes three arguments:

When the script is called, it first looks at the category and builds a list of recipes in that category. It then looks at the page number and writes the recipe titles for that page to MLServer variables. Lastly, if a third argument is specified, it translates that to a recipe on the current page and transfers the text from that recipe file to another MLServer variable.

Here's the commands used for the different types of buttons:

Select a category:
MLServeCmd.Macro|SetVariable|recipe_page~0!MLFileOpen|c:\recipe.pl~0 desserts 1~0!SetVariable|recipe_category~desserts
Page Up:
MLServeCmd.Macro|MLMath|Subtract~recipe_page~{{recipe_page}}~1!MLFileOpen|c:\recipe.pl~{{recipe_page}} {{recipe_category}} 1~0
Page Down:
MLServeCmd.Macro|MLMath|Add~recipe_page~{{recipe_page}}~1!MLFileOpen|c:\recipe.pl~{{recipe_page}} {{recipe_category}} 1
Select Recipe:
MLServeCmd.MLFileOpen|c:\recipe.pl~{{recipe_page}} {{recipe_category}} 5~0

The MLServer varialbes created and used:

recipe
Holds the text of the recipe, displayed in the large multi-line text box
recipe_title
Holds the title for the currently selected recipe
recipe_page
Holds the current page of the recipe list. This is always reset to zero when selecting a category
recipe_category
Holds the current category. Passed to the script so it knows where to look for the recipe files.
recipe_picture
Holds the name of a JPG image associated with the current recipe
recipe_1
Holds the first recipe title. I have it set up to list 16 recipes at a time.
recipe_16
Holds the last recipe title.

There are a couple of known problems/limitations. First, if the recipe text is too long and overflows the text box, it gets chopped. I have an idea on how to make this page too, but a scrollable text box would be perfect here. Second, the text must be roughly formatted to fit the text box. Using at 14 pt, CleanNarrow font, I can get just over 80 characters x 34 lines. The script doesn't do any formatting other than to limit it to 34 lines.