Board Thread:Support Requests - Getting Technical/@comment-45606548-20200622132701/@comment-45606548-20200623102356

TableWiz wrote:
 * two element
 * a single-column, 3-row table with a header
 * weaknesses
 * neutral
 * resisted damage

I use Lua to do this.

Having a quick look at pages, "Nature" or "Fire" is variable "elem1"? So you could use "elem1" to pick the Lua module. Then I use to pick the #switch row. And the 3 parts are split by #explode.

Then slot the 3 parts into the 3 rows of the table via - Lua module location.

Assuming this is the part

Yes, elements are "elem1" and "elem2" variables and this is the part ^^

I didn't get into Lua yet so I don't fully understand what you suggested, but the table has to be based on both elements (so for example if elements are Nature and Water, the dragon won't be weak to fire because fire is weak to water. In effect Fire will do neutral damage).

What I'm trying to achieve is automatically showing proper contents in the table depending only on the 2 element variables. I made an experiment with parser #ifeq: and it almost works (Light/Dark elements show up twice), but it takes some place in the code and looks like this:

And it's only one cell. Is it possible to make that logic in Lua? Could it be easier/better for the page?