The Cookbook is the store for Recipes; it is available everywhere except the Tutorial interface.
Recipes are a way of automatically interacting with your protein, you can consistently repeat simple shake and wiggle routines or perform a series of complex routines which never stop!
The term Recipes includes both GUI and Lua Scripts, the terms tend to be used interchangeably but they do represent different things.
GUI recipes perform predefined actions in a single sequence and can be compared to macros. Scripts use the more powerful Lua script and some libraries and can be compared to simple programming code.
Tip: GUI recipes stop running when you minimize the foldit game window, Script recipes keep running in the background.
In August 2011 another version of Lua Scripts was introduced, scripts are now called: GUI, V1 or V2.
V2 introduced many new functions and libraries and will continue to be enhanced. GUI and V1 script types are supported for backward compatibility only.
And you may like to read: What's the point? Can't this just be automated using recipes?
If you have ideas and suggestions for the Cookbook please add them to this post:
There are some excellent recipes of both types written by foldit players on the foldit recipe page. foldit 101 recommends Blue Fuse v1.1 http://fold.it/portal/recipe/2052 as a very useful addition to your Cookbook.
Tip: You must be logged into the foldit web portal and have the game running. Downloading recipes to your game client requires chat to be operating. If you can't see Global Chat, you won't be able to download.
Tip: If you are running multiple clients you can still add recipes to the cookbook by clicking the blue screen icon on the Cookbook and entering the script number found at the end of the address in your browser, Blue Fuse: number is 2052 as you can see from the link above. Note that you have to close the client with the global chat running last for the script to stay in your Cookbook; actually the [all_macro] file which is where your recipes are kept.
Using more than one computer? Copy the all_macro file to a USB or your Cloud storage noting the file location in the foldit directory structure, copy it to the other computer. Keeping a frequent backup of your all_macro file is highly recommended.
Groups usually have recipes which can only be used by members of the group; these recipes are available from the relevant group recipe pages.
Self shared recipes - are your own recipes which you share with yourself.
All recipes of any type are loaded up to the server the first time they are run as the foldit team is also interested in how folders create and use recipes.
Some recipes are very computer resource intensive, and may appear to run slowly, this may be a result of your particular computer configuration and available graphics processing.
If you notice foldit running slowly there are some things you can do while running intensive, resource hungry recipes, particularly if you are not watching the recipe run.
Use the view menu to reduce the amount of drawing to the screen your computer has to do:
- Uncheck all of the clashes and bond view options
- Trace line is the fastest View protein option
- hydro is the fastest color option
- Don't use the show exposed, issue analysis etc views
- Reduce the size of the foldit window
Minimize the foldit window so that it is not drawing at all. (GUI recipes will stop running!)
Recipes output to a text file on your computer [scriptlog.default.xml]. Note that this is overwritten if you start a new recipe.
If you name your tracks look for the track name for example: [scriptlog.793-evo.xml]
You can put a shortcut to the file on your desktop and right click to open it using Notepad or Notepad++. There is also a recipe to copy scriptlog.default.xml to a named file http://fold.it/portal/node/998251
You may want to modify (mod) a recipe, for example, to change a parameter in the options provided. Modifying is easy to do but take care as the in game editor will not check for errors. Good code writers explain the recipe options on the recipe page and in the code itself.
To modify a recipe click the Edit recipe button next to the recipe name in the Cookbook, the edit window will open showing the code. Read any instructions that the code writer has provided and make your changes. You will need to use Save As to save the changes by changing the title of the recipe.
To do this, open a recipe in the Foldit editor. Cut the code (or copy it) by clicking on the code then Ctrl+x (or Ctrl+c) . Paste it (Ctrl+v) into a white page of your editor. In script editors, it's possible to select the script languages (choose Lua). The editor will highlight functions and Lua commands with colors. It will show you your main errors (unclosed loops etc). When done, come back to the Foldit editor by clicking on your code page, selecting all (Ctrl+A), copy (ctrl+c) and paste back to the empty page of your Foldit editor (Ctrl+ v). "Save As" takes track of the parent recipe. If you only changed some small think (debugging) of one of your recipe, you can only update the version in the "info" screen before to simply "save". If you then "share", the new version will be updated on the site, erasing the former version if you simply saved. Note that a backup of the older version still remains in the cookbooks. The users must load the new version if they want to test it.
You can create new recipes from scratch or by modifying existing recipes.
To create GUI Recipes, click the Open Recipe Editor button on the Cookbook, and an edit window will open.
Click New (GUI) and two blue bars will appear at the top of the window. Click the bars and a menu of actions will appear, the Help menu in the edit window has more detailed information about how to use the predefined actions.
To create the more powerful Lua scripts read the tutorials here.
The list of available functions for V2 is automatically created and available here.
More standard Lua functions and libraries have been added, see the Lua manual.
V2 scripts can now use the functions in the: Lua standard libraries.
To create a V2 recipe, open the recipe editor and click the "New (Script V2)" button at the bottom.
Access to Cookbook while recipe is running Selection interface onlyEdit
In the Selection interface only while a script is running, you can:
- edit, add, save, upload recipes the same way as you do without scripts running.
- change the script you are running, the change will be available the next time you load the script.
- change a script you have started from the editor, that makes no difference; note that this will not affect the copy of the script which is running which is already loaded into memory. You may need to save the altered script with a new name.
Once you are satisfied with your recipes, consider sharing them with the rest of the players. Simply click the Share button in the Edit window and choose how you want to share.
Warning: Use the Basic or Advanced interface to do this, not the Selection interface.
Sharing recipes across machines
To share your personal selection of recipes across machines just take the all.macro file with you on a thumbdrive. You can use your operating system search functionality to find the all.macro file.
Or you can "share to myself" using the Coobook, any recipes you want to use on multiple machines.