Editing Module:AlchemistList

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
local lang = mw.getContentLanguage()
local lang = mw.getContentLanguage()
local plist = require('Module:ProfessionList')
local plist = require('Module:ProfessionList')
local purge = require('Module:Purge')._purge
local rts = require('Module:RecipeTreeSearch')


local p = {}
local p = {}
Line 10: Line 10:
function p.main()
function p.main()
local queryString = '[[Category:Alchemist]] AND [[Category:Pages with recipes]]'
local queryString = '[[Category:Alchemist]] AND [[Category:Pages with recipes]] OR [[Category:Pages with activities]]'
local function screenFunction(item)
local function screenFunction(item)
Line 38: Line 38:
-- iterate through products
-- iterate through products
for _, item in ipairs(results) do
for _, item in ipairs(results) do
-- list of all pages to edit, if edit is needed
item.allPageEdits = { item.pageName }
for _,intermediate in ipairs(item.intermediateMaterials) do
table.insert(item.allPageEdits,intermediate.name)
end


-- profitability
-- profitability
Line 50: Line 44:
-- 40 seconds to buy new supplies and travel and deposit and everything, per 12 potions
-- 40 seconds to buy new supplies and travel and deposit and everything, per 12 potions
local batchSize = 12
local batchSize = 12
if item.product=='10% Potion Healing' then
batchSize = 24
end
local downtime = 40
local downtime = 40
item.duration = item.duration and item.duration + downtime/batchSize
item.duration = item.duration and item.duration + downtime/batchSize
Line 75: Line 66:
local out = mw.html.create('table')
local out = mw.html.create('table')
:addClass('wikitable sortable')
:addClass('wikitable sortable')
:tag('caption')
:wikitext('This list is updated dynamically. '..purge())
:done()
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
Line 134: Line 122:
-- materials
-- materials
:IF(item.type=='recipe')
:node(plist.one_column_image_text(item.materials))
:node(plist.currency_cell(item.buyPrice))
:node(plist.one_column_image_text(item.materials))
:node(plist.currency_cell(item.sellPrice))
:node(plist.currency_cell(item.buyPrice))
:node(plist.currency_cell(item.sellPrice))
:ELSE()
:tag('td')
:addClass('table-na')
:css{ ['text-align'] = 'center' }
:attr{ colspan = '21' }
:wikitext('N/A')
:done()
:END()
:node(plist.currency_cell(item.profit))
:node(plist.currency_cell(item.profit))
:node(plist.currency_cell(item.profitPerHour))
:node(plist.currency_cell(item.profitPerHour))


Line 146: Line 145:
:done()
:done()
:ELSE()
:ELSE()
:node(plist.unknown_value_edit_cell(item.allPageEdits,1))
:node(plist.unknown_value_cell(1))
:END()
:END()
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores: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

This page is a member of a hidden category: