back to Foldit 101

In Foldit, the Cookbook is where recipes are stored. (The cookbook is not available in Intro Puzzles.)

Recipes are one of the most important features of Foldit. Recipes can perform simple tasks like shake and wiggle, and they can also automate complex tasks like rebuild and remix. Some recipes end quickly, others may run for days, and some are designed to run in an "infinite loop" until you cancel them.

The Foldit website has a recipes section, with a huge collection of recipes contributed by Foldit players over the years.

Recipe page

Recipe page, showing recipe number and "Add to Cookbook!" button.

Each recipe on the Foldit website has a "Add to Cookbook!" button. Clicking the button downloads the recipe to your Foldit client, provided the client is connected to chat. (When a client is not connected to chat, recipes can still be downloaded using the recipe number, which is found in the "ID" field on the recipe page, as is also the last part of the recipe's URL. Once a recipe has been added to the cookbook, clicking on the recipe's name in the cookbook runs the recipe. (Hovering over the recipe name and clicking the small "play" icon also runs the recipe.)

Cookbook functionsEdit

Cookbook parts

The major components of the cookbook.

Aside from storing and running recipes, the other functions of the cookbook include:

  • recipe editor (notepad icon), which allows you to:
    • modify recipes
    • create recipes
    • rename recipes
    • import and export recipes
    • share recipes to the Foldit website
    • run recipes
  • browse/download (network folder icon), allowing you to
    • go to Foldit recipe page, if connected to chat
    • enter a recipe number to download, when not connected to chat
  • show recipe output (DOS prompt icon) -- opens window displaying output
  • add a new divider (plus sign icon) -- adds a new divider to the cookbook
  • change cookbook font size ("A" icon)
  • view tutorial video

Recipe functionsEdit

Cook recipe options

Hovering over a recipe reveals the options for that recipe.

Hovering over a recipe in the cookbook reveals still more options:

  • delete recipe (red "x" icon) -- prompts to remove recipe from cookbook
  • go to recipe web page (magnifying glass icon) -- opens the web page for a shared recipe
  • cut recipe (scissor icon) -- cuts the recipe from current divider, allowing it to be pasted into another divider
  • recipe editor (notepad icon) -- opens recipe editor with current recipe loaded
  • run (play icon) - runs the recipe

Divider functionsEdit

Cookbook cut recipe

When a recipe has been cut, the word "[cut]" and an undo arrow appear.

Cookbook divider options

Hovering over a divider reveals the paste option if recipes have cut, and also the option to delete the divider and its contents.

Dividers are an important way of organizing recipes. By default, downloaded recipes are added to the "[Recipes]" divider in the cookbook. They can be cut and pasted into other dividers. Unlike a normal cut and paste, several recipes can be cut at the same time and then pasted into a new divider.

The contents of dividers can be displayed or hidden using the dropdown button to the left of the divider name.

Hovering over a divider reveals the following options:

  • paste (downward arrow icon) - paste any cut recipes into divider (does not appear if nothing cut)
  • delete divider (red "x" icon) -- prompt to delete divider and all recipes it contains

Downloading recipes Edit

As described above, you can download recipes directly from the Foldit website to your Foldit client. There are two requirements for this to work:

  • you must be logged on the Foldit website with your Foldit user id
  • your Foldit client must be running (using the same user id) and connected to in-game chat

As described in IRC Chat, only one Foldit client can be connected to chat at one time.

If you are running multiple clients or chat is unavailable, you can still add recipes to the cookbook. Click on the "Browse/Download Shared Recipes" icon at the bottom of the cookbook.

If the client is not connected, it will prompt you for a recipe number. The recipe number can be found on the recipe's webpage as described above.

Running recipes Edit

The are three ways to run a recipe:

  • clicking on the recipe's name in the cookbook
  • clicking the "play" icon to the right of the recipe's name in the cookbook
  • opening the recipe in the cookbook recipe editor and clicking "run"

Recipe performanceEdit

Recipes can use a lot of computer resources, often for a long time.

If a recipe seems to be running slowly, there are several things that may improve its performance.

The key step is to minimize the Foldit client while a recipe is running. This eliminates the need for the client to constantly redraw the protein, saving a lot of processing power.

The only drawback is for GUI recipes. These recipes essentially stop running when you minimize the client. You'll need to keep the client window visible when using a GUI recipe. (Most of these recipes have "GUI" in their names as a reminder.)

If you're running a GUI recipe or you want to watch while the recipe runs, use the View Options menu to reduce the amount of drawing:

  • uncheck the options to show clashes, voids, and exposeds
  • uncheck all the "show bonds" options
  • uncheck "show expected residue burials
  • use the hydro coloring option
  • use the trace line protein view
  • use "Don't show (fast)" for View Sidechains
  • uncheck "show sidechains with clashes or exposeds"
  • uncheck "pulse when working"

When using a GUI recipe, moving the protein out of the visible window may improve performance. The protein can be re-centered in the window using the "q" shortcut, or the "Home" key on Windows.

Reducing the size of the client window may also help performance.

Many players use all these steps -- adjusting the view options, moving the protein off the screen, reducing the size of the client window, and minimizing the client window -- when running recipes, in an effort to extract the maximum possible performance.

Recipe outputEdit

Recipes can print output showing what the recipe is doing and what results it's achieved.

By default, recipe output goes to a file called scriptlog.default.xml, which is found in the folder or directory the Foldit client was started from.

The scriptlog file is overwritten each time you run a new recipe.

If you use the tracks feature, the name of the scriptlog file changes to:


where *trackname* is the name of the current track.

You can put a shortcut to the scriptlog file on your desktop and right click to open it using Notepad or Notepad++. Although the file has an "xml" extension, it's really a text file with a few XML tags at the beginning and the end.

See this feedback suggestion for a discussion of using scripts to copy the scriptlog file for future reference.

Modifying recipesEdit

The recipe editor in the cookbook can be used to modify existing recipes.

Hover over the recipe name in the cookbook and click on the "notepad" icon. This opens the recipes in the Foldit recipe editor.

For GUI recipes, you must use the Foldit recipe editor. GUI recipes don't have a "source code" format.

For non-GUI recipes, written the the Lua] programming language, it best to use an external editor. The Foldit recipe editor lets you export recipes to a file using "Save As" then "Export". Adding the extension ".lua" to the exported file allows many editors, such as Notepad++, to apply the correct syntax highlighting.

The Foldit recipe editor has no syntax highlighting, no search and replace, and only limited cut-and-paste. Avoid this editor for anything but the most minor changes.

After making changes in your external editor, use the "Load" then "Import" options in the Foldit recipe editor to load the modified recipe back into the cookbook for testing.

You can also use copy-and-paste in the Foldit recipe editor, but this often creates problems with carriage return/line feeds, which show up as Little Square Boxes (LSB) at the end of each line.

Editor's note: everything up to here was revised 20 March 2017. The stuff below has not been touched. Some of the sections really don't belong on this page, so be prepared for things to move around in the near future.

Tip (video here): use an external text (.txt) editor, or even a script editors like Notepad++.

Editing Scripts in Foldit, An Introduction (English version)

Editing Scripts in Foldit, An Introduction (English version)

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.

Create recipesEdit

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.

The online book Programming in Lua (first edition) explains Lua in depth.

To create the more powerful Lua scripts, read the tutorials, starting wih Lua Scripting Tutorial (Beginner 1).

Also see Lua scripting and Tlaloc Script Standards

The list of available functions for V2 is automatically created and updated: Foldit Lua Functions v2.

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 runningEdit

In the Selection interface only while a script is running, you can:

  • edit, add, save, and upload recipes the same way as you do without scripts runnin.
  • change the script you are running -- the change will take effect the next time you run the script

Sharing recipesEdit

Once you are satisfied with your recipes, consider sharing them with other players. Simply click the Share button in the Edit window and choose how you want to share. You can "Share with Public", which makes the recipe available to all players. If you're the member of a group, "Share with Group" makes the recipe available only to group members. The "Share with Me" option stores the recipe on the Foldit server, but only you can access it.

Sharing recipes across machines Edit

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 cookbook, any recipes you want to use on multiple machines.

Community content is available under CC-BY-SA unless otherwise noted.