• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to run a lot of functions codespace-efficiently (4-Step Tutorial with Example)

Heptor

New member
Overlord
Joined
Sep 6, 2020
Messages
3
Reaction score
3
Note: This will only save codespace if you need to run more than 5 functions in a row.

Step 1: Create a local variable as a list of all the function names. For this tutorial, I'll call this "funcList".
Step 2: Repeat for each in the list "funcList" with a local variable for the object in the list. In here, I'll call this "funcName".
Step 3: Make a Call Function block with the name "%var(funcName)", or whatever you named the local variable in the repeat. Don't worry if it gets cut off on the sign, it'll still work.
Step 4: Finally, add a Control » Wait with 0 ticks into the repeat.
[Example in Web View]
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
64
What scenario would you need to call 5 functions in a row?
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
64
Also, you could compact this to two code blocks per by making the repeat it's own function, then when you need it set the function list and call the function
 

Prox

Moderator
Moderator
Joined
Sep 9, 2020
Messages
384
Reaction score
30
Also, you could compact this to two code blocks per by making the repeat it's own function, then when you need it set the function list and call the function
Then it'd be efficient for needing to do three or more functions, which is way more common
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
64
Then it'd be efficient for needing to do three or more functions, which is way more common
But don't do it unless there are multiple places you are using 3 or more functions!
 

stinkey

Forum adept
Joined
Sep 8, 2020
Messages
225
Reaction score
74
i dont see the point of this. like my signature says, why sacrifice readability and simplicity just to save a few code block's space?
 
Top Bottom