FANDOM


  • I'm working on this module, which is invoked from a template, which is called on an article with data

    {{Test|c1=20|bp1=2|tk1=5|c2=40|tk2=10xp2=2000|...}}

    I know how to work through the parent arguments and etc. I just wanna know how I can return the value of total "c", "tk", "xp", etc. (providing all are numbers. I wanna know how to write the iterative function using for i,v in ipairs(???) or any other way.

    I want the data to return like this:

    c bp tk xp cumulative c cumulative tk cumulative bp cumulative xp
    20 2 5 0 20 5 2 0
    40 0 10 2000 40 15 2 2000
    ...
      Loading editor
    • ipairs will not help u. use pairs:
      for i, v in pairs(args) do
          mw.log(i, v)
      end
      
      sure, u have to parse names by urself, in order to get c1-cn in same column.
        Loading editor
    • I figured it out using for i=1,steps do Thanks for your help

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.