Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Special pages
Random page
Wiki Discord
Contents
Neighbors
Galaxy
> Hexia
> Norvan
> Pashah
> Taffeh
Creatures
> Insects
> Fishes
> Shore-Dwellers
Items
> Dishes
> Furniture
Game Systems
> Dress Up
> Luca Arbor
> Loomix Footprints
> Loomix Vehicle Services
> Loomix Homes
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Editing
Module
:
Drop Tables
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local lib = require('Module:Feature') local Item = require('Module:Item')._main local category = mw.html.create():wikitext('[[Category:Drop Tables]]') local TS = lib.thousandsSeparator local total = {} function p.main(frame) local args = require('Module:Arguments').getArgs(frame) if tonumber(frame:callParserFunction('#var:transclude', '') or '0') == 1 then args.nocat = 1 end return p._main(args) end function p._main(args) local out = mw.html.create('table'):addClass('article-table wikitable sortable ' .. (args.class or '')) local delim = args.delim or ';;' -- Header row local tr = out:tag('tr') tr:tag('th'):wikitext('Item') if lib.isNotEmpty(args.note) then tr:tag('th'):wikitext('Notes') end -- Table body for _, raw in ipairs(args) do local data = p.splitParams(raw, delim) data.size = data.size or args.size or '35' -- first column image size data.cost_delim = data.cost_delim or args.cost_delim or ',' out:tag('tr'):node(p.ItemRow(data, args)) end -- Footer row if next(total) ~= nil and tonumber(args.total) == 1 then local tr = out:tag('tr') tr:tag('th'):wikitext('Total cost for all items') local th = tr:tag('th'):attr('colspan', 3 + (lib.isNotEmpty(args.refresh) and 1 or 0) + (lib.isNotEmpty(args.note) and 1 or 0)) for name, info in lib.spairs(total) do th:node(Item{ name = name, link = name, count = TS(info.base) .. (info.base2>0 and (' (' .. TS(info.base2) .. ')') or ''), size = 25 }):wikitext('<br />') end end if not args.dtable or mw.title.getCurrentTitle().rootText == args.dtable then out:node(require('Module:Namespace detect').main{main=category}) end return out end function p.ItemRow(data, args) local row = mw.html.create() local cost = data[2] function getCost(i) i.mult = tonumber(i.mult) or 1 i.mult2 = tonumber(i.mult2) or 0 if not data[1] and lib.isNotEmpty(data.x) and data.x ~= '1' then i.cell:wikitext('×', data.x, ' per ') end if tonumber(i.value) == nil then local items = lib.split(i.value, data.cost_delim or ',') for a, item in ipairs(items) do local name, amount = string.match(item, '^(.-)%*(.-)$') amount = tonumber((amount:gsub(',', ''))) if name == currency then i.cell:attr('data-sort-value', amount) end i.cell:node(Item{ name = name, link = name, count = (TS(amount * i.mult) .. (i.mult2 > 0 and (' (' .. TS(amount * i.mult2) .. ')') or '')), notext = 1, size = 25 }):wikitext('<br />') if (args.nocat == nil and i.nocat == nil) then category:wikitext('[[Category:', name, ' Drop Tables]]') end end end end if data[1] then local info = {} local specific = data.specific or lib.ternary(tonumber(data.blueprint)==1, 'Blueprint: ' .. data[1], data[1]) info.name = data[1] info.size = data.size info.count = data.x info.link = data.link or specific info.text = data.text or specific info['type'] = data['type'] --So we don't have dupe pages for Inspo Cards (etc.) and thousands of redirects. if (data['type'] == 'Inspo Card') then info.text = ('Inspo Card: ' .. info.text) end if (data['type'] == 'Eye Color') then info.text = ('Eye Color: ' .. info.text) end if (data['type'] == 'Eye Style') then info.text = ('Eye Style: ' .. info.text) end if (data['type'] == 'Hair Color') then info.text = ('Hair Color: ' .. info.text) end if (data['type'] == 'Hairstyle') then info.text = ('Hairstyle: ' .. info.text) end row:tag('td'):node(Item(info)) if (not args.nocat) then category:wikitext('[[Category:Contains ', specific, '|', specific, ']]') end end if data.refresh or args.refresh then refreshKeys = {d = 'Daily', w = 'Weekly', m = 'Monthly', v = 'Per Version'} row:tag('td'):wikitext(refreshKeys[data.refresh or 1] or data.refresh or '') end if data.note or args.note then row:tag('td'):wikitext(data.note or '') end return row end function p.splitParams(entry, paramDelim) entry = lib.split(entry, paramDelim) local returns = {} for i, param in ipairs(entry) do local name, val = string.match(param, '^%s*(.-)%s*{?{?=}?}?%s*(.-)%s*$') if name ~= nil and name ~= '' and val ~= nil then --named params returns[name] = val elseif param ~= nil and param ~= '' then --unnamed params table.insert(returns, param) end end return returns end return p
Summary:
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Petit Planet Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
File Pages
==Summary==
==Licensing==
{{Fairuse}}
{{File|}}
Dynamic Page List
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
¹
^2{
}^2
^2{¹}^2
Parser Functions
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder|}}
Magic Words
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
HTML Entities
—
,
­
Pages included on this page:
Template:Documentation/Header
(
edit
)
Template:Documentation/styles.css
(
edit
)
Template:T
(
edit
)
Template:TOC Right
(
edit
)
Module:Arguments
(
edit
)
Module:Arguments/i18n
(
edit
)
Module:Common/i18n
(
edit
)
Module:Config
(
edit
)
Module:Documentation
(
edit
)
Module:Documentation/config
(
edit
)
Module:Documentation/i18n
(
edit
)
Module:Drop Tables/doc
(
edit
)
Module:Entrypoint
(
edit
)
Module:Exists
(
edit
)
Module:Fallbacklist
(
edit
)
Module:Feature
(
edit
)
Module:Formatting
(
edit
)
Module:I18n
(
edit
)
Module:Languages
(
edit
)
Module:TableTools
(
edit
)
Module:Yesno
(
edit
)
This page is a member of 2 hidden categories:
Category:Pages using DynamicPageList4 parser function
Category:Pages using DynamicPageList4
Search
Search
Editing
Module
:
Drop Tables
Add topic