Editing Module:ChefList

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 94: Line 94:
-- iterate through materials, adding buy price to running total (individuals not needed)
-- iterate through materials, adding buy price to running total (individuals not needed)
-- also need to keep track of how many materials are needed from each shop
item.buy = 0
item.buy = 0
item.fishShopTrips = 0
item.vegShopTrips = 0
for _, material in ipairs(item.materials) do
for _, material in ipairs(item.materials) do
Line 113: Line 110:
item.buy = item.buy and item.buy + shopPrice * material.quantity
item.buy = item.buy and item.buy + shopPrice * material.quantity
-- query which shop sold it, add to running total
local shopNameQuery = '[[:+]][[Sold item::' .. material.name .. ']]|?Sold by|mainlabel=' .. material.name
local shopNameResult = mw.smw.ask(shopNameQuery) or {}
local shopName = ''

if shopNameResult[1] and shopNameResult[1]["Sold by"] then
shopName = shopNameResult[1]["Sold by"] or ''
end
if shopName=="The Frequently Fresh Fish Stall" then
item.fishShopTrips = item.fishShopTrips + 1
elseif shopName=="Kevin's Ingredients" then
item.vegShopTrips = item.vegShopTrips + 1
end

end
end
Line 174: Line 156:
item.profitPerXP = item.profit and item.XP and math.floor(item.profit / item.XP * 100) / 100
item.profitPerXP = item.profit and item.XP and math.floor(item.profit / item.XP * 100) / 100


-- there will be extra time spent buying and selling items, and moving between stations
-- 40 seconds to buy new supplies and travel and deposit and everything, per 12 products
-- this part will be tricky for Chef since different recipes do different size batches, and travel to different shops
-- assume make one trip to buy 24 of each material from each shop per batch of 24 food
local batchSize = 24
local batchSize = 12
local downtime = 60
-- 20 seconds moving between stations per 24 made
-- 30 seconds per trip to Kevin's Ingredients
-- 60 seconds per trip to the fish shop
-- are these results optimal? no. are they approximate? yes
local downtime = 20 + item.vegShopTrips * 30 + item.fishShopTrips * 60
item.duration = item.duration and item.duration + downtime/batchSize
item.duration = item.duration and item.duration + downtime/batchSize
item.productPerHour = item.duration and 1 / item.duration * 3600
item.productPerHour = item.duration and 1 / item.duration * 3600
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: