Module:MinerList: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(offload much of the search, screen, and format functions to the new ProfessionList module, so they work the same for all tables)
(downtime calculations and xp when dropping)
Line 49: Line 49:
end
end
-- downtime is very important for gathering-type professions
-- profitability
-- initial guesses
item.profitPerXP = item.profit and item.xp and item.profit / item.xp
item.downtime = 60
-- these numbers are based roughly on how far the nodes are from a storage rift or shop or bank
-- DOWNTIME VERY IMPORTANT FOR GATHERING TYPE PROFESSIONS
-- 20s per room to traverse
item.downtime = 60 -- THIS IS AN INITIAL GUESS, DO NOT USE THIS VALUE
-- duration and relocation times arent used for miner, only respawn time and number of nodes
if item.hideCells then
item.downtime = 0
item.nodes = 1
item.respawn = item.duration
elseif string.find(item.pageName,'Iron Ore') then
item.downtime = 20
item.nodes = 10
elseif string.find(item.pageName,'Cabranese Ore') then
item.downtime = 120 -- teleport to mine south west to bank and run back
item.nodes = 10
elseif string.find(item.pageName,'Flantium Ore') then
item.downtime = 100
item.nodes = 10
elseif string.find(item.pageName,'Adathril Ore') then
item.downtime = 60
item.nodes = 10
elseif string.find(item.pageName,'Flint') then
item.downtime = 20
item.nodes = 6
elseif string.find(item.pageName,'Basalt') then
item.downtime = 60
item.nodes = 6
elseif string.find(item.pageName,'Andesite') then
item.downtime = 60
item.nodes = 6
elseif string.find(item.pageName,'Granite') then
item.downtime = 20
item.nodes = 6
elseif string.find(item.pageName,'Deathstone') then
item.downtime = 120 -- includes getting more explosives
item.nodes = 6
end

--products per hour
item.batch = 24
item.batch = 24
item.productPerHour = item.duration and 1 / (item.duration + item.downtime / item.batch) * 3600
item.durationEffective = item.respawn and item.respawn / item.nodes
item.productPerHour = item.durationEffective and math.floor(1 / (item.durationEffective + item.downtime / item.batch) * 3600)
item.productPerHourDropping = item.durationEffective and 1 / (item.durationEffective) * 3600


-- properties per hour
-- properties per hour
item.xpPerHour = item.xp and item.productPerHour and math.floor(item.xp * item.productPerHour)
item.xpPerHour = item.xp and item.productPerHour and math.floor(item.xp * item.productPerHour)
item.xpPerHourDropping = item.xp and item.productPerHourDropping and math.floor(item.xp * item.productPerHourDropping)
item.profitPerHour = item.profit and item.productPerHour and math.floor(item.profit * item.productPerHour)
item.profitPerHour = item.profit and item.productPerHour and math.floor(item.profit * item.productPerHour)
end
end
Line 103: Line 141:
:tag('th')
:tag('th')
:wikitext('XP/hr')
:wikitext('XP/hr')
:done()
:tag('th')
:wikitext('XP/hr<br>(Discarding)')
:done()
:done()
:done()
:done()
Line 159: Line 200:
:tag('td')
:tag('td')
:wikitext(item.xpPerHour and lang:formatNum(tonumber(item.xpPerHour)))
:wikitext(item.xpPerHour and lang:formatNum(tonumber(item.xpPerHour)))
:done()
:ELSE()
:node(plist.unknown_value_cell(1))
:END()
-- XP per hour
:IF(item.xpPerHourDropping)
:tag('td')
:wikitext(item.xpPerHourDropping and lang:formatNum(tonumber(item.xpPerHourDropping)))
:done()
:done()
:ELSE()
:ELSE()