Icon representing a recipe

Recipe: Wiggle Shake Wiggle 0.2.0

created by Pikamander2

Profile


Name
Wiggle Shake Wiggle 0.2.0
ID
103276
Shared with
Public
Parent
None
Children
Created on
March 02, 2020 at 17:03 PM UTC
Updated on
March 02, 2020 at 17:03 PM UTC
Description

A simple script that wiggles the protein at a semi-random clash importance, then shakes/wiggles it at a 1.0 clash importance.

Options and such will be added later.

Best for


Code


function switch_to_highest_power() if (behavior.HighPowerAllowed() == true) then behavior.SetWigglePower('h') else behavior.SetWigglePower('m') end end function wiggle_shake_until_done() behavior.SetClashImportance(1); wiggle_shake_improvement = nil repeat score_before_wiggle_shake = current.GetScore() structure.WiggleAll(1) structure.ShakeSidechainsAll(1); wiggle_shake_improvement = current.GetScore() - score_before_wiggle_shake print("Wiggle shake improvement: " .. wiggle_shake_improvement) until (wiggle_shake_improvement < 1) end random_seed = os.time(); math.randomseed(random_seed); print("Using " .. random_seed .. " as the random seed"); --Lua's documentation recommends calling math.random() at least once before actually using it math.random(); --save.Quicksave(1) --best_score = 0 print("Initial score is " .. current.GetScore()) switch_to_highest_power(); while true do print("Starting a new round") clash_importance = (0.00 + math.random() * (1.00 - 0.00)); print("Setting clash importance to " .. clash_importance); behavior.SetClashImportance(clash_importance); print("Wiggling..."); structure.WiggleAll(1); print("Setting clash importance to 1"); behavior.SetClashImportance(1); print("Wiggle shaking until done"); wiggle_shake_until_done(); --score_after = current.GetScore(); --if (score_after > best_score) then --best_score = score_after; --print("New high score: " .. best_score); --save_puzzle_in_next_free_slot(); --else --print("Score (" .. score_after .. ") is lower than: " .. best_score); --end end

Comments