Thomas GENTILHOMME

LUA - Load external lua code

Discussion created by Thomas GENTILHOMME Champion on Apr 14, 2017
Latest reply on Apr 24, 2017 by Thomas GENTILHOMME

Hi 

 

There may be situations where you want to write "big" lua scripts where you repeat many functions or metatables. For an interval script or a manual script (Dont do this on arrival, or only for 2/3 functions). 

 

My example only take ~1millisecond to load (Very clean).

 

external.txt with the tdump function : 

 

 

On on my script : 

 

 

Note ( My chunk memory is optimized for my case ). So if you want to load multiple files (like a set of metatables) you have to change the structure. 

 

You can also return directly _a(_s(buf)) to delete this useless variable assignment.

 

Hope this can be useful for some people ! 

 

Best Regards,

Thomas

Outcomes