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
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+