|
| 1 | +--- |
| 2 | +description: >- |
| 3 | + This Step will Extract all Constants and put them into an Array at the |
| 4 | + beginning of the script |
| 5 | +--- |
| 6 | + |
| 7 | +# ConstantArray |
| 8 | + |
| 9 | +### Settings |
| 10 | + |
| 11 | +| Name | type | description | |
| 12 | +| -------------------- | ------- | ------------------------------------------------------------------------------------------------------------ | |
| 13 | +| Treshold | number | The relative amount of nodes that will be affected" | |
| 14 | +| StringsOnly | boolean | Wether to only Extract Strings | |
| 15 | +| Shuffle | boolean | Wether to shuffle the order of Elements in the Array | |
| 16 | +| Rotate | boolean | Wether to rotate the String Array by a specific (random) amount. This will be undone on runtime. | |
| 17 | +| LocalWrapperTreshold | number | The relative amount of nodes functions, that will get local wrappers | |
| 18 | +| LocalWrapperCount | number | The number of Local wrapper Functions per scope. This only applies if LocalWrapperTreshold is greater than 0 | |
| 19 | +| LocalWrapperArgCount | number | The number of Arguments to the Local wrapper Functions | |
| 20 | +| MaxWrapperOffset | number | The Max Offset for the Wrapper Functions | |
| 21 | + |
| 22 | +### Example |
| 23 | + |
| 24 | +{% code title="in.lua" %} |
| 25 | +```lua |
| 26 | +print("1") |
| 27 | +print("2") |
| 28 | +print("3") |
| 29 | +print("4") |
| 30 | +``` |
| 31 | +{% endcode %} |
| 32 | + |
| 33 | +{% code title="out.lua" %} |
| 34 | +```lua |
| 35 | +-- LocalWrapperCount = 3 |
| 36 | +-- LocalWrapperArgCount = 5 |
| 37 | +local F = {"4", "3", "2", "1"} |
| 38 | +do |
| 39 | + local y, G = 1, 4 |
| 40 | + while y < G do |
| 41 | + F[y], F[G] = F[G], F[y] |
| 42 | + y, G = y + 1, G - 1 |
| 43 | + end |
| 44 | + y, G = 1, 3 |
| 45 | + while y < G do |
| 46 | + F[y], F[G] = F[G], F[y] |
| 47 | + y, G = y + 1, G - 1 |
| 48 | + end |
| 49 | + y, G = 4, 4 |
| 50 | + while y < G do |
| 51 | + F[y], F[G] = F[G], F[y] |
| 52 | + y, G = y + 1, G - 1 |
| 53 | + end |
| 54 | +end |
| 55 | +local function y(y) |
| 56 | + return F[y + 440] |
| 57 | +end |
| 58 | +local G = {cb = function(F, G, R, p, b) |
| 59 | + return y(G - 2277) |
| 60 | + end, n = function(F, G, R, p, b) |
| 61 | + return y(p + 47178) |
| 62 | + end, B = function(F, G, R, p, b) |
| 63 | + return y(F + 31775) |
| 64 | + end} |
| 65 | +print(G.cb(1575, 1840, 2367, 1293, 1280)) |
| 66 | +print(G.B(-32213, -31781, -31538, -32780, -32728)) |
| 67 | +print(G.B(-32214, -33004, -31973, -32125, -31855)) |
| 68 | +print(G.B(-32211, -31884, -31217, -32222, -31210)) |
| 69 | + |
| 70 | +``` |
| 71 | +{% endcode %} |
0 commit comments