Anonymous

Module:SCValue: Difference between revisions

From Melvor Idle
m
no edit summary
(Created page with "local p = {} local Shared = require('Module:Shared') local Shop = require('Module:Shop') local Items = require('Module:Items') --local Debug = require('Module:Debug') local function getPurchase(itemName) return Shop.getPurchase(itemName) end local function getPurchaseValue(purchase) if purchase == nil or purchase.cost == nil or purchase.contains == nil then return 0 end local costs = purchase.cost local sales = purchase.contains local function getItemValues...")
 
mNo edit summary
Line 20: Line 20:
local gpVal = 0
local gpVal = 0
if items ~= nil then
if items ~= nil then
for _, v in pairs(items) do
for _, item in pairs(items) do
gpVal = gpVal + Items.getItemValueByID(v['id']) * v['quantity']
gpVal = gpVal + Items.getItemValueByID(item['id']) * item['quantity']
end
end
end
end
2,875

edits