Player/coders: How can the devs empower you to create scripts that enhance the the Flash game?

The dev team is actively pursuing various pathways for giving Eterna player/coders a more open development platform.  You’ll be hearing more about this in the weeks leading up to, and at, Eternacon.

At the moment, the active development is a framework for executing player-written EternaScripts from within the RNA design mode of the flash app.  These scripts could vary in complexity from a generalized stamper tool to an interactive RNA design bot that allows the player to make a few basic decisions and then does all the computational grunt work of filling in the details of making the design work.

The most basic API functions that the Flash app needs to provide are

  • get_sequence: get the current design sequence
  • set_sequence ( ): replace the current design sequence.
    But this is only the beginning.  What else do you want?

Here’s my immediate thoughts.

Wishlist of library functions (mostly what’s in EternaScript Lib, but a couple extra things that I feel are missing):

  • Set/Get Sequence per state
  • Set (where applicable)/Get Target structure per state
  • Get natural structure per state
  • Set/Get Energy Model
  • Get free energy per state
  • Get constraints & which are passing and failing (all states?)
  • Get mappings of pairs (i.e. base 5 is paired to base 10) per state
  • Get other EternaScript
  • Submit? Maybe?
    Also would like a way to create a UI for I/O with the user, thinking something like in Foldit’s scripting (though not necessarily exactly):
1 Like

To write scripts that respond to keyboard and mouse activity, we would need to be able to install event handlers for those.

I’d also want to be able to query some of the flash apps UI state.  Take for example a script that will create a static hairpin out of the bases between positions x and y.  While we could prompt the user for x and y, it would be nicer for the user to select the sequence (perhaps with the existing shift-drag action), and click on a “make hairpin” icon.

1 Like

Currently, the approach being taken for interacting with the applet requires checks and timeouts in order to use any applet functions. I would prefer if all applet functions could be synchronous, so get_sequence would just run, without the scripter needing to do anything else.

Assuming these will be through EternaScript, there should be a separate category for these (as-is, there aren’t enough categories, ie all the constraints should be in a category, in general there should be a better way to find out what scripts exist, for example using “folders”, but that’s not really critical for this topic).

How about just adding an applet.ready event, analogous to the window.ready event?

The current EternaScript timeout mechanism prevents a booster from using non-modal dialogs, unless the booster loading script does something to disable the timeout mechanism.

By non-modal dialog, I’m not referring to a new library feature, as LFP proposed.  Rather, I envision these as simply being normal HTML controls, either added to the existing window containing the flash player or in a newly created window.  Any code executed from these controls would be run long after the original booster script completed, yet the timeout code “automagic” added to the script will still stop the code from running if it has any loops.

That would be a great start, but there seems to be a common failure with functions like the existing get_full_structure and set_full_structure.

That timeout functionality could be an issue. Definitely cool if theres some overlay or something that could be just customized with HTML, and Im thinking of making an EternaScript UI library anyhow.

That would get the science moving. I enjoyed the Foldit’s scripting and it spread the knowledge.

@LFP6:  Until you had embedded the flash app into an EternaScript for the purpose of generating predicted foldings, I hadn’t put 2 and 2 together.  But we already have a very powerful, mature,  UI capability for EternaScript – HTML. 

For those who haven’t seen it yet, check out It  appends HTML input controls to the window containing the flash app to provide a very useful tool.  When nando and caleb work out the rest of the details for “boosters”, it will be possible to invoke it on demand from within the app, rather than having to run it from the EternaScript section.

1 Like

Nice :slight_smile:

@Omei: Yes, but it would also be nice to give players an easy way to use UI elements like those used on the Eterna site, to help improve the visual “comfort” of using the tools a bit.

1 Like

I realize there is a legitimate use for being able to set UI state (r.g. the black markers, blue glue, shifter) as well.