Module:Test

From Roat Pkz
Revision as of 22:24, 3 April 2024 by Hefner (talk | contribs)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Test/doc

-- Module table
local prices = {}

-- Function to get price by item name
function prices.getPrice(itemName)
    mw.log("Attempting to retrieve price for item:", itemName) -- Debug print
    local data = mw.loadData("Module:GEPrices/data")
    if not data then
        mw.log("Error: Module 'GEPrices/data' not found or failed to load.")
        return nil
    end
    mw.log("Data loaded successfully:", data) -- Debug print
    local price = data[itemName]
    mw.log("Price found:", price) -- Debug print
    return price or nil
end

return prices