Editing Module:Sandbox/User:Alsang
Jump to navigation
Jump to search
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 4: | Line 4: | ||
local currency = require('Module:Currency') |
local currency = require('Module:Currency') |
||
local lang = mw.getContentLanguage() |
local lang = mw.getContentLanguage() |
||
local xpdata = mw.loadData('Module:Experience/data') |
|||
local p = {} |
local p = {} |
||
Line 54: | Line 53: | ||
itemNew.duration = activityJSON.duration |
itemNew.duration = activityJSON.duration |
||
itemNew.product = activityJSON.output[1].name |
itemNew.product = activityJSON.output[1].name |
||
itemNew.XPperHour = itemNew.XP and tonumber(itemNew.XP) and itemNew.duration and tonumber(itemNew.duration) and tonumber(itemNew.XP) * 3600 / tonumber(itemNew.duration) |
itemNew.XPperHour = itemNew.XP and tonumber(itemNew.XP) and itemNew.duration and tonumber(itemNew.duration) and tonumber(itemNew.XP) * 3600 / tonumber(itemNew.duration) |
||
itemNew.fitXP = xpdata.knowledge[itemNew.lvl]*4*0.0005 |
|||
if itemNew.lvl>=200 then |
|||
itemNew.fitXP = itemNew.fitXP * 4 |
|||
end |
|||
itemNew.fitXP = math.floor(itemNew.fitXP * 100 ) / 100 |
|||
local query = mw.smw.ask('[[Sold item::' .. itemNew.product .. ']][[Shop sell price::!~N/A]]|?Shop sell price=data|mainlabel=-') |
|||
if type(query)=='table' then |
|||
-- price is returned as a number |
|||
itemNew.productSellPrice = tonumber(query[1].data)*0.005 |
|||
else |
|||
-- will return nil if the item is not in a shop, or if it is in a shop but can only be sold to the shop |
|||
itemNew.productSellPrice = nil |
|||
end |
|||
table.insert(resultsScreened,itemNew) |
table.insert(resultsScreened,itemNew) |
||
end |
end |
||
Line 115: | Line 97: | ||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('Duration') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('XP/hr') |
||
:done() |
:done() |
||
-- :tag('th') |
|||
-- :wikitext('Duration') |
|||
-- :done() |
|||
-- :tag('th') |
|||
-- :wikitext('XP/hr') |
|||
-- :done() |
|||
:done() |
:done() |
||
Line 148: | Line 124: | ||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.duration) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.XPperHour) |
||
:done() |
:done() |
||
-- :tag('td') |
|||
-- :wikitext(item.duration) |
|||
-- :done() |
|||
-- :tag('td') |
|||
-- :wikitext(item.XPperHour) |
|||
-- :done() |
|||
:done() |
:done() |