Board Thread:Lua Help/@comment-8335270-20150412220820/@comment-24473195-20150413100444

ChickenBar wrote: Hello, just wondering if there's a better way to do this.

Test page

TranslationExamples, Module in question

ChickenTest2, Module that the argument need to pass to. This is a fork of FactionScript.

Basically I intended to pass a string argument from TranslationExamples to FactionScript "grineer" function to do a conversion, so TranslationExamples can generate a table with the result returned in FactionScript.

However, the "grineer" function originally uses frame to get arguments so doing script.grineer("blah") did not work. My temporary solution, as seen in ChickenTest2, is to create another function "gineer_pass" and modify "grineer" to retrieve arguments using variables.

The temp solution works fine but it seems a bit ghetto to me, wondering if there's a proper way to do this. Thanks!

edit: the module is still wip so please ignore the incorrect table syntax. There are several ways of doing this (See Lua_templating/Tips_and_tricks.

The method you describe is the best because it avoids messing around with the method called by a page or template, so you only worry about the code for the function, and what arguments it needs.