Foldit Wiki
Register
Advertisement
Recipe in NotepadPlusPlus

A recipe in Notepad++ (click for larger view). The print command and other Lua language features are automatically highlighted.

Foldit recipes can be written in Lua, a simple programming language. Lua is also used for scripting in World of Warcraft (WOW) and Angry Birds, although those scripts are no doubt very different than Foldit recipes.

Like GUI recipes, recipes written in Lua contain Foldit commands, such as shake and wiggle. Compared to GUI recipes, Lua recipes have many more Foldit commands available, and have much more flexibility in how the commands are used.

Lua recipes also use a full array of programming features, such as variables, if-then-else statements, loops, and functions, which are not available in GUI recipes.

The Foldit Lua Interface is the set of commands (functions) that a Lua recipe can use. Version 2 of the Foldit Lua interface has been available since 2011, and is the preferred version for new recipes. Recipes written using version 1 are still supported, but the command set of version 1 is not being updated. Version 1 recipes also don't have access to several Lua standard libraries, like "string" and "math".

Getting started[]

Lua is easy enough to learn that everyone can use it, even people who have never programmed or scripted before.

The best place to get started if you don't have any programming experience is to work through the beginner scripting tutorials. Each of these tutorials also has a technical supplement with additional background information.

Tutorial Tech
Supplement
Beginner 1 Tech 1
Beginner 2 Tech 2
Beginner 3 Tech 3
Beginner 4 Tech 4
Beginner 5 Tech 5

If, on the other hand, you have some programming experience or want to get a quicker start, begin with Lua Scripting Tutorial (Intermediate). This intermediate tutorial starts from the ground up and assumes no prior knowledge but moves through material at a more rapid pace, including basics about how to run and modify scripts as well as core programming concepts like looping and variables.

Another option for experienced programmers is to use the full Lua Interface listing (below) in combination with the Lua Reference Manual to learn the material on your own. If you already know how to program, you'll find that it's just a matter of learning Lua's simple syntax and the Foldit command set. Additional resources for working with Lua are listed below, including guides to exporting and importing scripts.

Category-Script Tutorial

Resources[]

Cookbook / Recipe Scripting Tutorials[]

Commands / Functions[]

Recipes[]

External / Other[]

Lua Language[]

See Lua language reference.

Foldit Lua Interface[]

See Foldit Lua Interface.

Advertisement