Icon representing a recipe

Recipe: Behaviour wiggle fuze v2

created by Bruno Kestemont

Profile


Name
Behaviour wiggle fuze v2
ID
109188
Shared with
Public
Parent
Behaviour wiggle fuze v1
Children
Created on
September 25, 2025 at 14:11 PM UTC
Updated on
September 25, 2025 at 17:27 PM UTC
Description

Wiggle all with high importance for several options importances like hiding, clashing, bonding etc. Code revised by AI.

Best for


Code


function SaveBest() local ss = current.GetScore() local g = ss - BestScore local tb = filter.GetBonusTotal() local bg = tb - BestBonus if g > 0 and bg >= 0 then print("Gained another " .. g .. " | Score: " .. ss .. " | Bonus: " .. tb) BestScore = ss BestBonus = tb save.Quicksave(3) else print(":(" .. " no gain") end end function RunFuze(name, setImportanceFunc, resetImportanceFunc) print(name) save.Quickload(3) recentbest.Save() setImportanceFunc(Importance) structure.WiggleAll(25, true, true) recentbest.Restore() SaveBest() resetImportanceFunc() end -- Initialisation save.Quicksave(3) BestScore = current.GetScore() BestBonus = filter.GetBonusTotal() print("Click on behavior - RECIPE SCORE MODDING before to run") -- Boucle principale for importance = 3, 0.5, -0.5 do print("Testing Importance = " .. importance) Importance = importance RunFuze("SidechainHbond", behavior.SetSidechainHBondImportance, function() behavior.SetSidechainHBondImportance(1) end) RunFuze("BackboneHbond", behavior.SetBackboneHBondImportance, function() behavior.SetBackboneHBondImportance(1) end) RunFuze("Pairwise", behavior.SetPairwiseImportance, function() behavior.SetPairwiseImportance(1) end) RunFuze("Packing", behavior.SetPackingImportance, function() behavior.SetPackingImportance(1) end) RunFuze("Hiding", behavior.SetHidingImportance, function() behavior.SetHidingImportance(1) end) RunFuze("Clashing", function() behavior.SetClashImportance(0.9) end, function() behavior.SetClashImportance(1) end) save.Quickload(3) end print("Final Best Score: " .. BestScore .. " | Bonus: " .. BestBonus)

Comments


bravosk8erboy Lv 1

That's Clean code and harder to read.
Lua is funny, you can pass a function to a function. resetImportanceFunc in RunFuze() is a function it's self. AI is the only one I have ever seen code like this lol.