You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will allow for real-time function calls if you create a macro that generates commands similar to the following code: (simulating using C#)
voidcallToFunction(stringname,object[]args){stringr="/data modify storage MCScriptFunctions "+name+".arguments set value [";for(inti=0;i<args.length;i++)r+=args[i];r+="]\n"r+="/function "+name;}
This could probably be optimized in many ways regarding to recursion etc (can be solved by storing arguments in temp variables), but this is the overall picture.
The text was updated successfully, but these errors were encountered:
This could still be useful, but not precisely in this way. The new macro system still requires a lot of glue code to achieve somewhat dynamic behavior. I recommend watching this video by Cloud Wolf.
Originally created for mcscript by @WilliamRagstad here: Stevertus/mcscript#23
There is a poly-fill trick for supporting arguments to functions using the new
/data get storage [name] [path]
.Format example:
This will allow for real-time function calls if you create a macro that generates commands similar to the following code: (simulating using C#)
This could probably be optimized in many ways regarding to recursion etc (can be solved by storing arguments in temp variables), but this is the overall picture.
The text was updated successfully, but these errors were encountered: