WP:Lua Project |
WT:Lua Project talk |
Help |
To do |
Requests |
Resources en: m: mw: external |
Lua scripts on Wikipedia are similar to templates but useful for performing more complex tasks for which templates are too complex or slow. Common examples include numeric computations, string manipulation and parsing, and decision trees. You can use this page to request help from Lua developers in writing a Lua module for a specific task on Wikipedia or another Wikimedia Foundation project. Both debugging help and full implementation are available.
To start a request, just make a new section below and describe what you need. You may wish to first check Special:PrefixIndex/Module: to see if you can find a suitable existing script.
It may help developers to provide examples of where the task is likely to be useful within Wikipedia. If the proposal would replace or improve upon existing templates, please note which ones.
Why are module main objects called p?
I'm curious to know what the p stands for? Is it program? public? --Psychoslave (talk) 12:50, 25 November 2015 (UTC)
- I think it might be "package", as used in PIL here, but I might be wrong. — Mr. Stradivarius ♪ talk ♪ 14:04, 25 November 2015 (UTC)
Is Lua the right way to do a table lookup?
The current {{Zodiac date}} gives wrong answers for 2015. The approach of finding an empirical formula to predict dates of astronomical events is both not feasible and original research. I'm thinking of creating a Lua program that would have 12 tables, one for each sign of the zodiac. Each table would have a list of years from 2015 through 2050 (which is as far as my reliable source will predict). The index of the table would be the year, and the result from the table would be a day of the year (e.g "Feb. 18". Each table would have 35 rows.
I haven't programmed in Lua before, but I've programmed in many other languages from System/370 assembler to C#, so I'm not worried about figuring out the language. But I am concerned that having such a large template might be detrimental to the articles that include the template. Am I on the right track? — Preceding unsigned comment added by Jc3s5h (talk • contribs) 14:30, 29 November 2015 (UTC)
- Yes. Module:Citation/CS1/Configuration, for example, is nothing but tables, some of them rather larger than your zodiac tables will be.
- —Trappist the monk (talk) 15:02, 29 November 2015 (UTC)
- We also have mw.loadData to make doing this kind of thing more efficient if two different #invokes on a page use the same data table. — Mr. Stradivarius ♪ talk ♪ 22:01, 29 November 2015 (UTC)
-
-
- Thanks. It will take some time for me to generate the necessary data and write the template. (The reliable source is the US Naval Observatory's Multi-year Computer Interactive Almanac; it does not directly spit out the required dates, so the available information must be generated and then interpolated to find the dates.) Jc3s5h (talk) 22:14, 29 November 2015 (UTC)
-