Lua Features in Foldit

Started by Tlaloc

jeff101 Lv 1

I like infjamc's command-line option idea. It would let people try out sequences of commands on the fly before formalizing them into recipes. It would also let people who enjoy scripting be able to use scripting commands during manual interventions. It might also make script-writing easier to learn.

In Matlab, the command-line option is called the Command Window. The same commands that work in scripts can also be executed directly within the Command Window, you can even set/view/change variables and execute loops within the Command Window. Matlab also has commands like the following:

  • x -- If you type the name of a variable, here x, you can see what value it has.
  • who, whos -- List all the variables presently declared.
  • keyboard -- Used inside a script to break out into the Command Window (called keyboard mode). It is very helpful for debugging. You can also use it in error-handling routines in your scripts.
  • return -- Lets you return from a break to the Command Window (return from keyboard mode). The script that was broken out of will then continue executing, now with new variables if you change any during keyboard mode. If you don't change any variables during keyboard mode, the script will continue executing as if the break to keyboard mode had never occurred.
  • type x -- Lists the asci file named x. Handy for viewing the contents of scripts.
  • clear -- Lets you clear certain variables from memory.
  • save x -- Lets you save all variables into a file named x. In Foldit, this could help if you just made a complicated LUA table, for example, and wanted to save it for later.
  • load x -- Lets you load previously saved variables from the file named x.
  • !x -- Lets you execute DOS or other operating system commands (here the one named x) from within Matlab.
  • diary -- I think this one records into a file all the Command Window things you type. If you made a similar thing in Foldit, you could let diary's output file be used as a recipe.
  • help x -- Gives you a brief description of a certain command (here the one named x) and its syntax.
  • arrows -- Hitting the up or down arrows retypes previous commands in the Command Window. Once you find the previous command you want, you can edit it before pressing enter to execute it. Also, if you type the first few letters of a command before hitting the arrow keys, it will only pick previous commands that start with these same letters.
    </UL>

    For more details, see http://www.mathworks.com/help/techdoc/matlab_env/f0-32574.html.