Editing Module:ProfessionList

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 37: Line 37:
-- use within :node()
-- use within :node()
function p.unknown_value_edit_cell(page,N)
function p.unknown_value_edit_cell(page,N)
local url = tostring(mw.uri.fullUrl(page,'action=edit'))
if type(page) == 'string' then
page = {page}
end
local textstring = ''
for _,p in ipairs(page) do
local url = tostring(mw.uri.fullUrl(p,'action=edit'))
local link = '['..url.." '''?''' (edit)]<br>"
textstring = textstring .. link
end
return mw.html.create('td')
return mw.html.create('td')
:addClass('table-bg-gray')
:addClass('table-bg-gray')
:css{ ['text-align'] = 'center' }
:css{ ['text-align'] = 'center' }
:attr{ colspan = tostring(N) }
:attr{ colspan = tostring(N) }
:wikitext(textstring)
:wikitext('['..url.." '''?''' (edit)]")
:done()
:done()
end
end
Line 156: Line 148:
local fullRecipe = search.main(item.product)
local fullRecipe = search.main(item.product)
-- overwrite any parameters from the original recipe with their counterparts from the full recipe
-- overwrite any parameters from the original recipe with their counterparts from the full recipe
-- parameters which dont exist in the fullRecipe wont be overwritten,
-- when product is nil, no data is overwritten
-- first need to nil the xp, kp, and duration, since if they are nil in the fullRecipe they must stay nil
item.xp = nil
item.kp = nil
item.duration = nil
for key,value in pairs(fullRecipe) do
for key,value in pairs(fullRecipe) do
item[key] = value
item[key] = value
Line 166: Line 154:
-- include the price of selling the product
-- include the price of selling the product
local sell = search.getShopSellPrice(item.product)
item.sellPrice = search.getShopSellPrice(item.product)
local qty = item.output[1].quantity
item.sellPrice = sell and qty and sell * qty
item.profit = item.buyPrice and item.sellPrice and item.sellPrice - item.buyPrice
item.profit = item.buyPrice and item.sellPrice and item.sellPrice - item.buyPrice
item.profitPerXP = item.profit and item.xp and item.profit / item.xp
end
end
return output
return output
end

function p.one_column_image_text(materials)
local materialCell = mw.html.create('td')

for _, mat in ipairs(materials) do
materialCell:wikitext(mat.quantity .. ' &times; [[File:' .. mat.name .. '.png|18px|link=' .. mat.name .. ']] [[' .. mat.name .. ']]<br>')
end
return materialCell
end
end
Line 215: Line 187:
:addClass('plinkt-image no-border')
:addClass('plinkt-image no-border')
:css{ ['border-left'] = '0', ['padding-left'] = '0' }
:css{ ['border-left'] = '0', ['padding-left'] = '0' }
:wikitext('[[' .. image .. '|link=' .. link .. '|30px]]')
:wikitext('[[File:' .. image .. '.png|link=' .. link .. '|30px]]')
:done()
:done()
:tag('td')
:tag('td')
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: