Foldit Lua Functions
Comments0this wiki
Note: This page is automatically generated. Any modifications to the page will be wiped out the next time that it is generated. Instead, click the 'details' link and add comments there. There are four main poses (which are representations of the protein): absolutebest, creditbest, current, and recentbest. The current pose is what you are working with. You can save to the recentbest pose. The absolutebest, creditbest, and recentbest poses get updated automatically when the current pose beats their score. In the case of creditbest, this only happens when credit is received for the score.
help
Edit
Function: void help(function Func)
Description: Prints the signature and description of Func, or signature of all Foldit functions if no argument is given.
V1 Function Name:
More Information: Details
print
Edit
Function: void print([arg1,...,argN])
Description: Print values to the output window and log file.
V1 Function Name: print
More Information: Details
absolutebest.AreConditionsMet
Edit
Function: boolean absolutebest.AreConditionsMet()
Description: Return whether the absolute best pose satisfies all conditions.
V1 Function Name: New to V2
More Information: Details
absolutebest.GetEnergyScore
Edit
Function: number absolutebest.GetEnergyScore()
Description: Get the score for the absolute best pose.
V1 Function Name: New to V2
More Information: Details
absolutebest.GetExplorationMultiplier
Edit
Function: number absolutebest.GetExplorationMultiplier()
Description: Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name: New to V2
More Information: Details
absolutebest.GetScore
Edit
Function: number absolutebest.GetScore()
Description: Get the score for the absolute best pose.
V1 Function Name: New to V2
More Information: Details
absolutebest.GetSegmentEnergyScore
Edit
Function: number absolutebest.GetSegmentEnergyScore(integer segmentIndex)
Description: Get the current score of the given segment.
V1 Function Name: New to V2
More Information: Details
absolutebest.GetSegmentEnergySubscore
Edit
Function: number absolutebest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description: Get the current score part of the given segment.
V1 Function Name: New to V2
More Information: Details
absolutebest.Restore
Edit
Function: void absolutebest.Restore()
Description: Load the absolute best pose.
V1 Function Name: restore_abs_best
More Information: Details
band.Add
Edit
Function: integer band.Add(integer segmentOrigin, integer segmentXAxis, integer segmentYAxis, number rho, number theta, number phi, [integer atomIndexOrigin], [integer atomIndexXAxis], [integer atomIndexYAxis])
Description: Add a band to empty space. Returns band number.
V1 Function Name: New to V2
More Information: Details
band.AddBetweenSegments
Edit
Function: integer band.AddBetweenSegments(integer segmentIndex1, integer segmentIndex2, [integer atomIndex1], [integer atomIndex2])
Description: Add a band between the two segments. By default bands to the backbone. Specify an atom number from 1 to structure.GetAtomCount() to band to a different atom. Returns band number.
V1 Function Name: band_add_segment_segment
More Information: Details
band.AddToBandEndpoint
Edit
Function: integer band.AddToBandEndpoint(integer segmentIndex, integer bandIndex, [integer atomIndex])
Description: Add a band to the endpoint of an existing band. Returns band number.
V1 Function Name: New to V2
More Information: Details
band.Delete
Edit
Function: void band.Delete(integer bandIndex)
Description: Delete a band.
V1 Function Name: Similar to band_delete
More Information: Details
band.DeleteAll
Edit
Function: void band.DeleteAll()
Description: Delete all bands.
V1 Function Name: band_delete()
More Information: Details
band.Disable
Edit
Function: void band.Disable(integer bandIndex)
Description: Disable a band.
V1 Function Name: Similar to band_disable
More Information: Details
band.DisableAll
Edit
Function: void band.DisableAll()
Description: Disable all bands.
V1 Function Name: band_disable()
More Information: Details
band.Enable
Edit
Function: void band.Enable(integer bandIndex)
Description: Enable a band.
V1 Function Name: Similar to band_enable
More Information: Details
band.EnableAll
Edit
Function: void band.EnableAll()
Description: Enable all bands.
V1 Function Name: band_enable()
More Information: Details
band.GetCount
Edit
Function: number band.GetCount()
Description: Get the number of bands.
V1 Function Name: get_band_count
More Information: Details
band.GetGoalLength
Edit
Function: number band.GetGoalLength(integer bandIndex)
Description: Get the goal length of a band.
V1 Function Name: New to V2
More Information: Details
band.GetLength
Edit
Function: number band.GetLength(integer bandIndex)
Description: Get the current length of a band.
V1 Function Name: New to V2
More Information: Details
band.GetStrength
Edit
Function: number band.GetStrength(integer bandIndex)
Description: Get the strength of a band.
V1 Function Name: New to V2
More Information: Details
band.IsEnabled
Edit
Function: boolean band.IsEnabled(integer bandIndex)
Description: Return whether a band is enabled.
V1 Function Name: New to V2
More Information: Details
band.SetGoalLength
Edit
Function: void band.SetGoalLength(integer bandIndex, number length)
Description: Set the goal length of a band. (Range 0.0 to 10000.0)
V1 Function Name: band_set_length
More Information: Details
band.SetStrength
Edit
Function: void band.SetStrength(integer bandIndex, number strength)
Description: Set the strength of a band. (Range 0.0 to 10.0)
V1 Function Name: band_set_strength
More Information: Details
behavior.GetClashImportance
Edit
Function: number behavior.GetClashImportance()
Description: Get the clashing importance.
V1 Function Name: New to V2
More Information: Details
behavior.SetClashImportance
Edit
Function: void behavior.SetClashImportance(number importance)
Description: Set the clashing importance. (Range 0.0 to 1.0)
V1 Function Name: set_behavior_clash_importance
More Information: Details
behavior.GetWiggleAccuracy
Edit
Function: number behavior.GetWiggleAccuracy()
Description: Get the wiggle accuracy.
V1 Function Name: New to V2 (removed/disabled)
More Information: Details
behavior.SetWiggleAccuracy
Edit
Function: void behavior.SetWiggleAccuracy(number accuracy)
Description: Set the wiggle accuracy. (Range 0.0 to 7.0)
V1 Function Name: New to V2 (removed/disabled)
More Information: Details
behavior.GetShakeAccuracy
Edit
Function: integer behavior.GetShakeAccuracy()
Description: Get the shake accuracy.
V1 Function Name: New to V2 (removed/disabled)
More Information: Details
behavior.SetShakeAccuracy
Edit
Function: void behavior.SetShakeAccuracy(integer accuracy)
Description: Set the shake accuracy. (Range 0 to 4)
V1 Function Name: New to V2 (removed/disabled)
More Information: Details
contactmap.IsContact
Edit
Function: bool contactmap.IsContact(integer segmentIndex1, integer segmentIndex2)
Description: Gets whether two segments are in contact.
V1 Function Name: New to V2
More Information: Details
contactmap.GetHeat
Edit
Function: number contactmap.GetHeat(integer segmentIndex1, integer segmentIndex2)
Description: Gets the heat of two segments.
V1 Function Name: New to V2
More Information: Details
creditbest.AreConditionsMet
Edit
Function: boolean creditbest.AreConditionsMet()
Description: Return whether the credit best pose satisfies all conditions.
V1 Function Name: New to V2
More Information: Details
creditbest.GetEnergyScore
Edit
Function: number creditbest.GetEnergyScore()
Description: Get the current energy score.
V1 Function Name: New to V2
More Information: Details
creditbest.GetExplorationMultiplier
Edit
Function: number creditbest.GetExplorationMultiplier()
Description: Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name: New to V2
More Information: Details
creditbest.GetScore
Edit
Function: number creditbest.GetScore()
Description: Get the score for the credit best pose.
V1 Function Name: New to V2
More Information: Details
creditbest.GetSegmentEnergyScore
Edit
Function: number creditbest.GetSegmentEnergyScore(integer segmentIndex)
Description: Get the current score of the given segment.
V1 Function Name: New to V2
More Information: Details
creditbest.GetSegmentEnergySubscore
Edit
Function: number creditbest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description: Get the current score part of the given segment.
V1 Function Name: New to V2
More Information: Details
creditbest.Restore
Edit
Function: void creditbest.Restore()
Description: Load the credit best pose.
V1 Function Name: restore_credit_best
More Information: Details
current.AreConditionsMet
Edit
Function: boolean current.AreConditionsMet()
Description: Return whether the current pose satisfies all conditions.
V1 Function Name: are_conditions_met
More Information: Details
current.GetEnergyScore
Edit
Function: number current.GetEnergyScore()
Description: Get the current energy score.
V1 Function Name: get_score(true)
More Information: Details
current.GetExplorationMultiplier
Edit
Function: number current.GetExplorationMultiplier()
Description: Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name: get_exploration_score
More Information: Details
current.GetScore
Edit
Function: number current.GetScore()
Description: Get the current score.
V1 Function Name: get_ranked_score(true)
More Information: Details
current.GetSegmentEnergyScore
Edit
Function: number current.GetSegmentEnergyScore(integer segmentIndex)
Description: Get the current score of the given segment.
V1 Function Name: Similar to get_segment_score
More Information: Details
current.GetSegmentEnergySubscore
Edit
Function: number current.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description: Get the current score part of the given segment.
V1 Function Name: Similar to get_segment_score_part
More Information: Details
dialog.AddButton
Edit
Function: table dialog.AddButton(string label, integer value)
Description: Add button.
V1 Function Name: New to V2
More Information: Details
dialog.AddCheckbox
Edit
Function: table dialog.AddCheckbox(string label, boolean value)
Description: Add checkbox.
V1 Function Name: New to V2
More Information: Details
dialog.AddLabel
Edit
Function: table dialog.AddLabel(string label)
Description: Add label.
V1 Function Name: New to V2
More Information: Details
dialog.AddSlider
Edit
Function: table dialog.AddSlider(string label, number value, number minimum, number maximum, number precision)
Description: Add slider.
V1 Function Name: New to V2
More Information: Details
dialog.AddTextbox
Edit
Function: table dialog.AddTextbox(string label, string value)
Description: Add textbox.
V1 Function Name: New to V2
More Information: Details
dialog.CreateDialog
Edit
Function: table dialog.CreateDialog(string title)
Description: Create a dialog.
V1 Function Name: New to V2
More Information: Details
dialog.Show
Edit
Function: integer dialog.Show(table dialogTable)
Description: Show dialog.
V1 Function Name: New to V2
More Information: Details
freeze.Freeze
Edit
Function: void freeze.Freeze(integer segmentIndex, boolean backbone, boolean sidechain)
Description: Freeze a segment's backbone and/or sidechain.
V1 Function Name: New to V2
More Information: Details
freeze.FreezeAll
Edit
Function: void freeze.FreezeAll()
Description: Freeze all segments. Freezes both the backbone and the sidechains.
V1 Function Name: New to V2
More Information: Details
freeze.FreezeSelected
Edit
Function: void freeze.FreezeSelected(boolean backbone, boolean sidechain)
Description: Freeze the selected segments. The backbone and sidechain arguments indicate which parts of the segment to freeze.
V1 Function Name: do_freeze
More Information: Details
freeze.GetCount
Edit
Function: integer,integer freeze.GetCount()
Description: Get the count of frozen segments. Returns backbone and sidechains counts.
V1 Function Name: New to V2
More Information: Details
freeze.IsFrozen
Edit
Function: boolean,boolean freeze.IsFrozen(integer segmentIndex)
Description: Returns whether the backbone and/or sidechain is frozen.
V1 Function Name: New to V2
More Information: Details
freeze.Unfreeze
Edit
Function: void freeze.Unfreeze(integer segmentIndex, boolean backbone, boolean sidechain)
Description: Unfreeze a segment's backbone and/or sidechain.
V1 Function Name: New to V2
More Information: Details
freeze.UnfreezeAll
Edit
Function: void freeze.UnfreezeAll()
Description: Unfreeze all segments.
V1 Function Name: do_unfreeze_all
More Information: Details
puzzle.GetDescription
Edit
Function: string puzzle.GetDescription()
Description: Get the description of the puzzle.
V1 Function Name: New to V2
More Information: Details
puzzle.GetExpirationTime
Edit
Function: integer puzzle.GetExpirationTime()
Description: Get the date and time that the puzzle expires.
V1 Function Name: New to V2
More Information: Details
puzzle.GetName
Edit
Function: string puzzle.GetName()
Description: Get the name of the puzzle.
V1 Function Name: New to V2
More Information: Details
puzzle.GetPuzzleID
Edit
Function: string puzzle.GetPuzzleID()
Description: Get the ID Number of the puzzle.
V1 Function Name: New to V2
More Information: Details
puzzle.StartOver
Edit
Function: void puzzle.StartOver()
Description: Reset puzzle to the starting pose.
V1 Function Name: reset_puzzle
More Information: Details
recentbest.AreConditionsMet
Edit
Function: boolean recentbest.AreConditionsMet()
Description: Return whether the recent best pose satisfies all conditions.
V1 Function Name: New to V2
More Information: Details
recentbest.GetEnergyScore
Edit
Function: number recentbest.GetEnergyScore()
Description: Get the current energy score.
V1 Function Name: New to V2
More Information: Details
recentbest.GetExplorationMultiplier
Edit
Function: number recentbest.GetExplorationMultiplier()
Description: Get the Exploration multiplier. If the current puzzle is not an exploration puzzle, returns 0.
V1 Function Name: New to V2
More Information: Details
recentbest.GetScore
Edit
Function: number recentbest.GetScore()
Description: Get the score for the recent best pose.
V1 Function Name: New to V2
More Information: Details
recentbest.GetSegmentEnergyScore
Edit
Function: number recentbest.GetSegmentEnergyScore(integer segmentIndex)
Description: Get the current score of the given segment.
V1 Function Name: New to V2
More Information: Details
recentbest.GetSegmentEnergySubscore
Edit
Function: number recentbest.GetSegmentEnergySubscore(integer segmentIndex, string scorePart)
Description: Get the current score part of the given segment.
V1 Function Name: New to V2
More Information: Details
recentbest.Restore
Edit
Function: void recentbest.Restore()
Description: Load the recent best pose.
V1 Function Name: restore_recent_best
More Information: Details
recentbest.Save
Edit
Function: void recentbest.Save()
Description: Save the current pose as the recent best pose.
V1 Function Name: reset_recent_best
More Information: Details
recipe.CompareNumbers
Edit
Function: boolean recipe.CompareNumbers(number num1, number num2)
Description: Returns true if the two real numbers are the same to the precision that Lua prints.
V1 Function Name: New to V2
More Information: Details
recipe.GetRandomSeed
Edit
Function: number recipe.GetRandomSeed()
Description: Returns a good seed for the math.randomseed() function.
V1 Function Name: New to V2
More Information: Details
recipe.ReportStatus
Edit
Function: number recipe.ReportStatus()
Description: Reports the current status to the recipe output window and log file. Returns the improvement to the score from the SectionStart call.
V1 Function Name: New to V2
More Information: Details
recipe.SectionEnd
Edit
Function: number recipe.SectionEnd()
Description: Ends a reporting section. Returns the improvement to the score from the SectionStart call.
V1 Function Name: New to V2
More Information: Details
recipe.SectionStart
Edit
Function: void recipe.SectionStart(string sectionName)
Description: Starts a reporting section.
V1 Function Name: New to V2
More Information: Details
rotamer.GetCount
Edit
Function: integer rotamer.GetCount(integer segmentIndex)
Description: Return the number of rotamers the sidechain at the given index can snap to. This number may change if the backbone moves.
V1 Function Name: get_sidechain_snap_count
More Information: Details
rotamer.SetRotamer
Edit
Function: void rotamer.SetRotamer(integer segmentIndex, integer position)
Description: Snap the sidechain at the given segment to a rotamer. (Range 1 to rotamer.GetCount()).
V1 Function Name: do_sidechain_snap
More Information: Details
save.LoadSecondaryStructure
Edit
Function: void save.LoadSecondaryStructure()
Description: Load previously saved structure assignment.
V1 Function Name: load_structure
More Information: Details
save.Quickload
Edit
Function: void save.Quickload(integer slot)
Description: Quickload from a slot.
V1 Function Name: quickload
More Information: Details
save.Quicksave
Edit
Function: void save.Quicksave(integer slot)
Description: Quicksave to a slot. (Range 1 to 100)
V1 Function Name: quicksave
More Information: Details
save.SaveSecondaryStructure
Edit
Function: void save.SaveSecondaryStructure()
Description: Save current structure assignment.
V1 Function Name: save_structure
More Information: Details
scoreboard.GetGroupRank
Edit
Function: integer scoreboard.GetGroupRank()
Description: Get the group rank.
V1 Function Name: New to V2
More Information: Details
scoreboard.GetGroupScore
Edit
Function: number scoreboard.GetGroupScore()
Description: Get the group score.
V1 Function Name: New to V2
More Information: Details
scoreboard.GetRank
Edit
Function: integer scoreboard.GetRank([scoretype])
Description: Get the rank.
V1 Function Name: New to V2
More Information: Details
scoreboard.GetScore
Edit
Function: number scoreboard.GetScore([scoretype])
Description: Get the score.
V1 Function Name: New to V2
More Information: Details
scoreboard.GetScoreType
Edit
Function: scoretype scoreboard.GetScoreType()
Description: Get the current type of score. Returns one of the scoretype enum values.
V1 Function Name: New to V2
More Information: Details
selection.Deselect
Edit
Function: void selection.Deselect(integer segmentIndex)
Description: Deselect the segment at the given index
V1 Function Name: Similar to deselect_index
More Information: Details
selection.DeselectAll
Edit
Function: void selection.DeselectAll()
Description: Deselect all segments.
V1 Function Name: deselect_all
More Information: Details
selection.GetCount
Edit
Function: integer selection.GetCount()
Description: Get the number of selected segments.
V1 Function Name: New to V2
More Information: Details
selection.IsSelected
Edit
Function: boolean selection.IsSelected(integer segmentIndex)
Description: Returns whether a segment is selected.
V1 Function Name: New to V2
More Information: Details
selection.Select
Edit
Function: void selection.Select(integer segmentIndex)
Description: Select segment at the given index.
V1 Function Name: Similar to select_index
More Information: Details
selection.SelectAll
Edit
Function: void selection.SelectAll()
Description: Select all segments.
V1 Function Name: select_all
More Information: Details
selection.SelectRange
Edit
Function: void selection.SelectRange(integer segmentIndex1, integer segmentIndex2)
Description: Select segments from segmentIndex1 to segmentIndex2.
V1 Function Name: select_index_range
More Information: Details
structure.CanMutate
Edit
Function: boolean structure.CanMutate(integer segmentIndex, string aminoAcid)
Description: Returns whether a segment is mutable into the given amino acid.
V1 Function Name: New to V2
More Information: Details
structure.GetAminoAcid
Edit
Function: string structure.GetAminoAcid(integer segmentIndex)
Description: Get amino acid type.
V1 Function Name: Similar to get_aa
More Information: Details
structure.GetAtomCount
Edit
Function: integer structure.GetAtomCount(int segmentIndex)
Description: Return the number of atoms in a segment.
V1 Function Name: New to V2
More Information: Details
structure.GetCount
Edit
Function: integer structure.GetCount()
Description: Return the number of segments.
V1 Function Name: get_segment_count
More Information: Details
structure.GetDistance
Edit
Function: number structure.GetDistance(integer segmentIndex1, integer segmentIndex2)
Description: Return distance between two segments.
V1 Function Name: get_segment_distance
More Information: Details
structure.GetNote
Edit
Function: string structure.GetNote(integer segmentIndex)
Description: Gets the note assigned to a segment.
V1 Function Name: New to V2
More Information: Details
structure.GetSecondaryStructure
Edit
Function: string structure.GetSecondaryStructure(integer segmentIndex)
Description: Get segment secondary structure type.
V1 Function Name: Similar to get_ss
More Information: Details
structure.IsHydrophobic
Edit
Function: boolean structure.IsHydrophobic(integer segmentIndex)
Description: Returns segment hydrophobicity.
V1 Function Name: Similar to is_hydrophobic
More Information: Details
structure.IsMutable
Edit
Function: boolean structure.IsMutable(integer segmentIndex)
Description: Returns whether a segment is mutable.
V1 Function Name: New to V2
More Information: Details
structure.LocalWiggleAll
Edit
Function: void structure.LocalWiggleAll(integer iterations[, backbone, sidechains])
Description: Local wiggle all segments.
V1 Function Name: New to V2
More Information: Details
structure.LocalWiggleSelected
Edit
Function: void structure.LocalWiggleSelected(integer iterations[, backbone, sidechains])
Description: Local wiggle selected segments.
V1 Function Name: Similar to do_global_wiggle_all
More Information: Details
structure.MutateSidechainsAll
Edit
Function: void structure.MutateSidechainsAll(integer iterations)
Description: Mutate all sidechains.
V1 Function Name: New to V2
More Information: Details
structure.MutateSidechainsSelected
Edit
Function: void structure.MutateSidechainsSelected(integer iterations)
Description: Mutate selected sidechains.
V1 Function Name: Similar to do_mutate
More Information: Details
structure.RebuildSelected
Edit
Function: void structure.RebuildSelected(integer iterations)
Description: Run rebuild on selection.
V1 Function Name: do_local_rebuild
More Information: Details
structure.SetAminoAcid
Edit
Function: void structure.SetAminoAcid(integer segmentIndex, string aminoAcid)
Description: Replace amino acid.
V1 Function Name: New to V2
More Information: Details
structure.SetAminoAcidSelected
Edit
Function: void structure.SetAminoAcidSelected(string aminoAcid)
Description: Changed the selected segments to the specified amino acid.
V1 Function Name: replace_aa
More Information: Details
structure.SetNote
Edit
Function: void structure.SetNote(integer segmentIndex, string note)
Description: Sets the note assigned to a segment.
V1 Function Name: New to V2
More Information: Details
structure.SetSecondaryStructure
Edit
Function: void structure.SetSecondaryStructure(integer segmentIndex, string secondaryStructure)
Description: Set segments secondary structure. Valid values are e=sheet, h=helix, l=loop, m=molecule.
V1 Function Name: New to V2
More Information: Details
structure.SetSecondaryStructureSelected
Edit
Function: void structure.SetSecondaryStructureSelected(string secondaryStructure)
Description: Set the selected segments secondary structure. Valid values are e=sheet, h=helix, l=loop, m=molecule.
V1 Function Name: replace_ss
More Information: Details
structure.ShakeSidechainsAll
Edit
Function: void structure.ShakeSidechainsAll(integer iterations)
Description: Shake all sidechains.
V1 Function Name: New to V2
More Information: Details
structure.ShakeSidechainsSelected
Edit
Function: void structure.ShakeSidechainsSelected(integer iterations)
Description: Shake selected sidechains.
V1 Function Name: Similar to do_shake
More Information: Details
structure.WiggleAll
Edit
Function: void structure.WiggleAll(integer iterations[, boolean backbone, boolean sidechains])
Description: Global wiggle all segments.
V1 Function Name: New to V2
More Information: Details
structure.WiggleSelected
Edit
Function: void structure.WiggleSelected(integer iterations[, boolean backbone, boolean sidechains])
Description: Global wiggle selected segments.
V1 Function Name: Similar to do_global_wiggle_all
More Information: Details
ui.AlignGuide
Edit
Function: void ui.AlignGuide([integer segmentIndex])
Description: Aligns the guide. Aligns to a given segmentIndex if passed in.
V1 Function Name: New to V2
More Information: Details
ui.CenterViewport
Edit
Function: void ui.CenterViewport()
Description: Centers the viewport.
V1 Function Name: New to V2
More Information: Details
ui.GetTrackName
Edit
Function: string ui.GetTrackName()
Description: Gets the track name.
V1 Function Name: New to V2
More Information: Details
user.GetGroupID
Edit
Function: integer user.GetGroupID()
Description: Gets the group name.
V1 Function Name: New to V2
More Information: Details
user.GetGroupName
Edit
Function: string user.GetGroupName()
Description: Gets the group name.
V1 Function Name: New to V2
More Information: Details
user.GetPlayerID
Edit
Function: integer user.GetPlayerID()
Description: Gets the user name.
V1 Function Name: New to V2
More Information: Details
user.GetPlayerName
Edit
Function: string user.GetPlayerName()
Description: Gets the user name.
V1 Function Name: New to V2
More Information: Details