User blog comment:Nanamin/Lua-based Fleet Composition Template/@comment-25683568-20150412051502/@comment-25683568-20150413002650

To test, you have either the debug console (p in the debug console is the returned value of the currently edited module, so =p:Table would have executed the Table function of the module you were editing), or you can use function to render the result of a module onto a page instead of leaving it as a module invocation, which allows you to look at the resulting wikitext and manipulate it easily (useful for experimenting on an already existing template).

For arguments, first of all, I should tell you that getArgs does some groundwork for you, which you can look through at Wikipedia:Module:Arguments, but be careful; because of how Wikia implements Scribunto (the extension that implements Lua modules) some functions don't work. Passing the frame.getParent to getArgs instead of just frame is due to this. This getArgs is also slightly different from the wikipedia version. The version on this wiki is the one in the scribunto repository; due to be included as a built-in Scribunto library as the future. See Wikipedia:Module_talk:Arguments.

However, the reason why your !hq and !route were not being processed was because of the equals signs, which turn them into keyword arguments. It works the same way as normal templates: arguments with no equals sign are positional arguments referred to by their position in the arguments list; arguments with equals sign are keyword arguments referred to by the part before the equals sign. I would recommend you not use ! to start a keyword argument name in the future, since it prevents you from just doing self._args.hq and self._args.route, which looks much better. (I suppose you did it for easy parsing?)

To check for locked you can call the row[1]:slots in NanaminFleet:equip, which gives you the amount of slots the ship has. If the slot# is > slots, then it's locked. As for unequipped, you'd have to delegate to the declarations, since the user decides whether or not a slot is unequipped, right?