Module:ItemSources: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "local p = {} local hc = require('Module:Param Parse').has_content local pcp = require('Module:Profession clickpic')._main function p.main(frame) local args = frame:getParent().args local out = mw.html.create('table') :addClass('wikitable') :tag('tr') :tag('th') :wikitext('Source') :done() :tag('th') :wikitext('Level') :done() :tag('th') :wikitext('Quantity') :done() :tag('th') :wikitext('Frequency') :done() :done() re...")
 
No edit summary
Line 5: Line 5:
function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
local args = frame:getParent().args
return p._main(args)
end

function base_query(item)
local ret = {
'[[Dropped item::' .. item .. ']]',
'?Dropped from=source',
'?Dropped quantity=quantity',
'?Rarity=rarity'
}
return ret
end

function p._main(args)
local item = args[1] or mw.title.getCurrentTitle().fullText
local query = mw.smw.ask(base_query(item))
mw.logObject(query)
local out = mw.html.create('table')
local out = mw.html.create('table')

Revision as of 13:19, 28 November 2024

Module documentation
This documentation is transcluded from Module:ItemSources/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:ItemSources/doc. [edit]
Module:ItemSources's function main is invoked by Template:ItemSources.
Module:ItemSources requires Module:Param Parse.
Module:ItemSources requires Module:Profession clickpic.

local p = {}
local hc = require('Module:Param Parse').has_content
local pcp = require('Module:Profession clickpic')._main

function p.main(frame)
	local args = frame:getParent().args
	return p._main(args)
end

function base_query(item)
	local ret = {
		'[[Dropped item::' .. item .. ']]',
		'?Dropped from=source',
		'?Dropped quantity=quantity',
		'?Rarity=rarity'
	}
	return ret
end

function p._main(args)
	local item = args[1] or mw.title.getCurrentTitle().fullText
	
	local query = mw.smw.ask(base_query(item))
	
	mw.logObject(query)
	
	local out = mw.html.create('table')
		:addClass('wikitable')
		:tag('tr')
			:tag('th')
				:wikitext('Source')
			:done()
			:tag('th')
				:wikitext('Level')
			:done()
			:tag('th')
				:wikitext('Quantity')
			:done()
			:tag('th')
				:wikitext('Frequency')
			:done()
		:done()
	
	return out
end

return p