Learn Scripting!

Started by themarquis

themarquis Lv 1

Hi folks,

I just wanted everyone to know that there are now three Lua Scripting tutorials up on the wiki that you can find here: http://foldit.wikia.com/wiki/Lua_Scripting . Lua is an easy-to-use programming language that we can now use to manipulate proteins. Like cookbook recipes, scripts are a great way to automate repetitive folding tasks, help you fold while you're not home or sleeping :), and maybe increase your score!! I designed these tutorials for beginners (thanks to mat747 for helping get them at a good level for "absolute" beginners), so you don't have to know anything about programming to use them. If you have never programmed before, you will want to start with:

Beginner 1
http://foldit.wikia.com/wiki/Lua_Scripting_Tutorial_(Beginner_1)
This tutorial will get you to the point of downloading and running other people's scripts.

Beginner 2
http://foldit.wikia.com/wiki/Lua_Scripting_Tutorial_(Beginner_2)
This tutorial gets you to the level of modifying scripts and understanding some basics of commands.

There will be a Beginner 3 tutorial soon (I'll update this thread when it's up) which will work with the rest of the commands and get you to the point of writing your own script with any commands you like in it.

Currently, there is also a very long intermediate tutorial on the wiki ( http://foldit.wikia.com/wiki/Lua_Scripting_Tutorial_(Intermediate) ). I recommend it for folks who either have worked through the beginner tutorials and want more to sink their teeth into or who have some programming experience and want to go at a more accelerated pace (it is actually a standalone tutorial so you don't need to have read Beginner). I will most likely split it into three bits like I did for beginner and then add more, but it is up now and complete for folks who want to take a look.

Scripting is a really fun way of getting deeper into Foldit, learning some basic programming concepts, and maybe even discovering new and exciting ways of folding that no one has used before. There's been some criticism of the addition of scripting to foldit, but my position is that it won't automate our folding completely or make what we do by hand obsolete – rather, it's a way of taking our unique folding abilities – our spatial sensibilities – and extending, deepening, and codifying them. In this sense, scripting becomes a tool we can use to realize our human folding abilities in the form of heuristics, rather than a wholesale automation of folding that would replace us.

Please let me know if you have any suggestions or ideas for the current (and future) tutorials, and of course everyone is invited to modify them directly on the wiki and/or add their own!

themarquis Lv 1

Crashguard, your tutorials look great!

I was actually just thinking about "advanced" tutorials – my skills are still quite rudimentary, so I think Intermediate is as far as I can reasonably go with tutorials. But … you might just be the perfect man for the job!!

I'd be happy to provide assistance or edit for grammar, etc. if you like!

Crashguard303 Lv 1

That would be good, because I'm just writing english all the time, but I'm not used anymore to speak it, so partwise, I'm just guessing.

Plus, there are some programming-routines I maybe take myself for granted or self-evident, but it will make other people scratching their head and wonder, so it is good if there is someone, who can say: "This point I don't understand, it's not explained percisely enough".

When I've done the Gamma-ray therapy tomorrow and feel good these days, I will create a tutorial for the new script.

regards,
Alex

Crashguard303 Lv 1

Themarquis, are you just on the way to explain functions or should I explain them in the advanced tutorial?
I've created some basic math functions,which are not accessible in the game like integer, absolute and sinus (just beagan), for example.

I've already made a placeholder for your Beginner 3 Tutorial and a placeholder for my advanced tutorial.

There are two question anymore:

1.: If we want to discuss changes in the wikia, which link should be use?
On the german Wiki we have a site

, but I couldn't find 'the right one' on the english one, as the discussion page was deleted.

2.: May I give some extra information about your tutorials in brackets at the links on the wiki?

For example:
Lua Scripting Tutorial (Beginner 1)

Transform to:
Lua Scripting Tutorial (Beginner 1: browse and load scripts, output window)

This won't change the name of link, but give some extra info for the one who wants to know in brief what this tuoriual is dealing, and we know, which info is alerady given.

Crashguard303 Lv 1

According to so many requests, I plan to write tutorials for the functions Rescale (very important!!!),
Multi-Tool, Smart-Rebuild and Random Bonds.

But please be patient, as I now go to work again, so I'm not that long time at home and I'm still not that pretty fit, which is normal for the next 6 months after ray-treatment.

But be sure I participate more in writing codes and Wiki than playing FoldIt at the time.

Extra:
Because I must to get it working, I'm on the way to create some basic math functions, which are locked here, as far as the standard library is not included in the game.

Absolute, Integer and morph/scaling functions (percentage for example) are finished (a text-percentage-bar can be created, too), now I do some research on Sinus (including factorial function), sawtooth, triangle and rectangle.

Crashguard303 Lv 1

I plan to start explaining functions with a simple factorial-function, then percentage-calculation, and the Rescale (a better version of percentage).

Crashguard303 Lv 1

Rachel, you CAN overwrite recipes!!!

Just click into the recipe info (do as if you were changing the script information), and then leave the info box!

The SAVE-button will appear again!