Profile


Name
V1_V2_xref
ID
104122
Shared with
Public
Parent
None
Children
None
Created on
November 20, 2020 at 02:30 AM UTC
Updated on
November 20, 2020 at 02:30 AM UTC
Description

For documentation purposes, this recipe generates a list of V1 functions and their V2 equivalents. The result is a table in wiki markup. See https://foldit.fandom.com/wiki/Lua_functions_V1_to_V2

Best for


Code


local histtabl = { _print = "print", absolutebest_Restore = "restore_abs_best", band_AddBetweenSegments = "band_add_segment_segment", band_Delete = "band_delete", band_DeleteAll = "band_delete", band_Disable = "Similar to band_disable", band_DisableAll = "band_disable", band_Enable = "Similar to band_enable", band_EnableAll = "band_enable", band_GetCount = "get_band_count", band_SetGoalLength = "band_set_length", band_SetStrength = "band_set_strength", behavior_SetClashImportance = "set_behavior_clash_importance", creditbest_Restore = "restore_credit_best", current_AreConditionsMet = "are_conditions_met", current_GetExplorationMultiplier = "get_exploration_score", current_GetScore = "get_ranked_score(true)", current_GetSegmentEnergyScore = "Similar to get_segment_score", current_GetSegmentEnergySubscore = "Similar to get_segment_score_part", freeze_FreezeSelected = "do_freeze", freeze_UnfreezeAll = "do_unfreeze_all", puzzle_StartOver = "reset_puzzle", recentbest_Restore = "restore_recent_best", recentbest_Save = "reset_recent_best", rotamer_GetCount = "get_sidechain_snap_count", rotamer_SetRotamer = "do_sidechain_snap", save_LoadSecondaryStructure = "load_structure", save_Quickload = "quickload", save_Quicksave = "quicksave", save_SaveSecondaryStructure = "save_structure", selection_Deselect = "Similar to deselect_index", selection_DeselectAll = "deselect_all", selection_Select = "Similar to select_index", selection_SelectAll = "select_all", selection_SelectRange = "select_index_range", structure_GetAminoAcid = "Similar to get_aa", structure_GetCount = "get_segment_count", structure_GetDistance = "get_segment_distance", structure_GetSecondaryStructure = "Similar to get_ss", structure_IsHydrophobic = "Similar to is_hydrophobic", structure_LocalWiggleSelected = "Similar to do_local_wiggle", structure_MutateSidechainsSelected = "Similar to do_mutate", structure_RebuildSelected = "do_local_rebuild", structure_SetAminoAcidSelected = "replace_aa", structure_SetSecondaryStructureSelected = "replace_ss", structure_ShakeSidechainsSelected = "Similar to do_shake", structure_WiggleSelected = "Similar to do_global_wiggle_all", ui_GetPlatform = "get_platform", _are_conditions_met = "current.AreConditionsMet", _band_add_segment_segment = "band.AddBetweenSegments", _band_delete = "band.Delete", _band_disable = "band.Disable", _band_enable = "band.Enable", _band_set_length = "band.SetGoalLength", _band_set_strength = "band.SetStrength", _deselect_all = "selection.DeselectAll", _deselect_index = "similar to selection.Deselect", _do_freeze = "similar to freeze.FreezeSelected ", _do_global_wiggle_all = "similar to structure.WiggleSelected", _do_global_wiggle_backbone = "similar to structure.WiggleSelected", _do_global_wiggle_sidechains = "similar to structure.WiggleSelected", _do_local_rebuild = "structure.RebuildSelected", _do_local_wiggle = "structure.LocalWiggleSelected", _do_mutate = "structure.MutateSidechainsSelected", _do_shake = "structure.ShakeSidechainsSelected", _do_sidechain_snap = "rotamer.SetRotamer", _do_unfreeze_all = "freeze.UnfreezeAll", _get_aa = "structure.GetAminoAcid", _get_band_count = "band.GetCount", _get_exploration_score = "current.GetExplorationMultiplier", _get_platform = "ui.GetPlatform", _get_ranked_score = "current.GetScore", _get_score = "current.GetScore", _get_segment_count = "structure.GetCount", _get_segment_distance = "structure.GetDistance", _get_segment_score = "current.GetSegmentEnergyScore", _get_segment_score_part = "current.GetSegmentEnergySubscore", _get_sidechain_snap_count = "rotamer.GetCount", _get_ss = "structure.GetSecondaryStructure", _is_hydrophobic = "structure.IsHydrophobic", _load_structure = "save.LoadSecondaryStructure", _quickload = "save.Quickload", _quicksave = "save.Quicksave", _replace_aa = "structure.SetAminoAcidSelected", _replace_ss = "structure.SetSecondaryStructure", _reset_puzzle = "puzzle.StartOver", _reset_recent_best = "recentbest.Restore", _restore_abs_best = "absolutebest.Restore", _restore_credit_best = "creditbest.Restore", _restore_recent_best = "recentbest.Restore", _save_structure = "save.SaveSecondaryStructure", _select_all = "selection.SelectAll", _select_index = "similar to selection.Select", _select_index_range = "selection.SelectRange", _set_behavior_clash_importance = "behavior.SetClashImportance", } print ( "{|class=\"wikitable sortable\"" ) print ( "!v1 name" ) print ( "!v2 name" ) for kk, vv in pairs ( histtabl ) do --print ( "key = \"" .. kk .. "\", value = \"" .. vv .. "\"" ) if kk:sub ( 1, 1 ) == "_" then local kkx = kk:sub ( 2 ) print ( "|-" ) print ( "|" .. "[[Foldit_Lua_Function_" .. kkx .. "|" .. kkx .. "]]" ) local sim = vv:match ( "similar to " ) if sim == nil then print ( "|" .. "[[Foldit_Lua_Function_" .. vv .. "|" .. vv .. "]]" ) else local car = vv:sub ( sim:len () ) print ( "|" .. sim .. "[[Foldit_Lua_Function_" .. car .. "|" .. car .. "]]" ) end end end print ( "|}" )

Comments


LociOiling Lv 1

This recipe generates the table seen on Lua functions V1 to V2 on the Foldit wiki.

The first column gives the V1 function name. The second column gives the V2 function name, and links to the detail page for the function. Where it's not a perfect match, the second column says "similar to".

Most of the V1 functions show up in red, since they don't have a detail page. See Foldit Lua Functions (v1) for more on these functions. In the future, we may auto-generate the detail pages, but for now it's a manual process.