Here was my comment in pm to Heather's post above.
Hello Heather – I'm so happy that you're working on learning scripting!! I had to take a bit of a break from writing tutorials because I've been very busy with work, but I will get back to it soon!
1) I'm not totally sure what you're referring to here. Are you having trouble saving a new script? I have noticed that occasionally I save a script and it does not appear in the recipes list (if that is what you are refering to). But if I exit the new interface and go to the old interface, it suddenly appears in the list. YOu could try this or try closing foldit and then re-opening it and see if your new recipe shows up.
2) I'd be happy to look at your scripts before you run them – please feel free to post them in one of the forum threads going on about scripting (or we can make a new one titled something like "help me with my script!"). Or you can message them to me… of course one issue is that you cannot cut/paste from the foldit script window. Grr!
One way to do it is to write scripts in an external editor. So for example, you can use windows notepad. Then when you're done writing them, cut and paste them into foldit (this works even though it doesn't work to cut/paste FROM foldit – why I don't know!). So then if you'd like some feedback, just cut and paste the script from notepad into a forum post or a message.
Here is another way to get the text of your scripts. Navigate to C:\Documents and Settings\All Users\Application Data\foldit . Find all.macro and open it with notepad or a text editor. It will look like a bunch of garbage but your script is hidden somewhere in it! Just use edit » find and type in the word "script". Now you may have to hit the find next button a few times but you will eventually see your script. It will not be formatted very nicely, but you can cut and paste it from there.
Re: crashing your computer, there are a couple things that can crash things in scripts. First, if you have any segments frozen when you run the script, it will not like that. So make sure you unfreeze everything before running scripts (and in answer to your question, no, we can't use freeze in scripts, but you can use select to do all the things that freeze does. It is like the reverse of freeze – so instead of freezing areas around the segments you want to manipulate, simply select the segments you want to manipulate and then run some commands.) Second, if you try to exit a script while it's running, it sometimes crashes things.
Another way to crash is to use too many bands. This is not really a script problem – it can happen even if you're not running a script. There is a limit on the number of bands that can be placed in foldit. I don't know what it is, but when you have a larger protein and band each segment or each other segment or whatever, sometimes you will hit the limit and it will crash foldit.
Finally, the one other thing I can think of that causes issues is something called an "infinite loop". This is something that can happen in programming any language – basicaally, you are looping (maybe using a "for" loop, for example) but there is nothing in your loop that tells the computer when to STOP looping, so it will loop forever! Oops! So in Lua, we say:
for int i = 1, i < 10 (or something like that!)
and what if inside your loop you do something to i … like …
i = i - 1
well, this is a problem, because the loop will only stop when it hits 10, but it will never hit 10 because every time it increments (it goes up by 1 automatically each time around the loop) it also decrements (goes down by one).
Finally, you mentioned "crashing" when not using end. This probably shouldn't crash foldit, but you will get error messages in your output window. My advice to you would be to forge through and go ahead and run your scripts, look carefully at what the error is telling you, and then try to correct it and run it again. This is called "debugging" and it is something that programmers in every language do a lot of! It's hard to write programs perfectly, so you have to just run them and see what happens. Believe me, I do this A LOT!
Hope that all helps! Let me know if you have more questions/thoughts and I'll try to address them. I'm happy you're getting into scripting – it's fun, isn't it?