Allow custom logging

Case number:699969-2009477
Topic:General
Opened by:Pikamander2
Status:Open
Type:Suggestion
Opened on:Thursday, April 16, 2020 - 06:26
Last modified:Thursday, April 16, 2020 - 22:33

I'm interested in doing some analysis of how well early-game protein designs score in the late game.

Doing this by hand would be very tedious, whereas automating it would make things fairly simple. However, without being able to log the relevant data to a text file, I would have to rely on copying the data from the console, which is slower and takes a lot more effort, plus the console has a relatively small max number of lines.

It would be great if Foldit had a shared text file that recipes could log output to. To avoid taking up too much space, the program could compress/archive old logs and delete them after 30 days or whatever.

(Thu, 04/16/2020 - 06:26  |  4 comments)


jeff101's picture
User offline. Last seen 15 hours 10 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

Foldit already writes the Recipe Output into a file
called scriptlog.default.xml (at least on Windows)
found in your C:\Foldit directory. When a new Recipe
starts, it overwrites the old version of this file.
If you want to keep records of things, rename the
file each time you quit a recipe. I use names like
scriptlog1824a1.txt (for the 1st recipe run on client
a for puzzle 1824) and scriptlog1824c2.txt (for the
2nd recipe run on client c for puzzle 1824). I also
move all such files for a certain puzzle into a
special directory like puzz1824 when I am finished
with a puzzle. I move all the *ir_solution files
for that same puzzle into the same directory.

For more details, see:
https://foldit.fandom.com/wiki/Foldit_file_and_directory_structure#Scriptlog_files
https://foldit.fandom.com/wiki/Foldit_file_and_directory_structure#Puzzle_gameplay_files

Susume's picture
User offline. Last seen 1 day 8 hours ago. Offline
Joined: 10/02/2011

The filename for script output also includes the track name. If you are running in default track it is scriptlog.default.xml, but if you are running in track solo_1 the filename is scriptlog.solo_1.xml. I always include the puzzle number in my track names (eg 1824_solo1) so the scriptlog files are easy to identify. This also means a script run in one track will not overwrite the scriptlog from a different track, only the last scriptlog from the same track. Note that if you run a script with no printed output it will still overwrite that track's scriptlog.

In Lua you can set the delimiter for print statements with the delim command, for example
delim = "\t"
When you pass your printable data as comma-separated arguments to the print function, it will print them with the delimiter you have chosen. This makes it easy to produce tab-separated or comma-separated lines for easy loading into a spreadsheet.

You can also use Lua's string.format() with C-style formatting.

jeff101's picture
User offline. Last seen 15 hours 10 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

https://fold.it/portal/node/2009229
does some magic on scriptlog.default.xml
files using autohotkey.

jeff101's picture
User offline. Last seen 15 hours 10 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

The DistMap* series of recipes:
https://fold.it/portal/recipe/101659 DistMap0
https://fold.it/portal/recipe/101679 DistMap1
https://fold.it/portal/recipe/101868 DistMap1.1
output several charts to scriptlog.default.xml
in formats that can be copied into spreadsheet
programs like Excel. They also output a
section in the format of an *.eps file
(a kind of image file that can be viewed
using GSView/Ghostscript).

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons