Hi,
I've recently taken on a shop in Eleusis and looking for scripts to make it easier. I've got one now that helps with the pricing of items, which is great. Now I'm looking for one to help me see what's actually been sold or is missing from the store.. So what I'm looking for is something like...
I do "checkstore", and the script goes wares, adds everything in the store to a database.
The next time I do "checksales", it goes wares again, and then in a neat format displays what's now missing or has been added.
When I'm done restocking I'll do "checkstore" again to update the database.
If no one has anything like that I'd be interested in paying someone 50 credits to make it for me!
0
Comments
However, development resources are limited, so they can't do everything; saying "hasn't just done" completely ignores how much work this would actually be, and what else doesn't get done as a result of doing it. Things are rarely simple when you're talking about complicated - and, in Achaea's case, often very old - systems.
Results of disembowel testing | Knight limb counter | GMCP AB files
Results of disembowel testing | Knight limb counter | GMCP AB files
Results of disembowel testing | Knight limb counter | GMCP AB files
Though, for this script, you can just save the tables when you use the shopcheck alias or whatever it is, so that won't be an issue.
I check my shop stock every day but I only restock after a certain amount of items has sold because this allows me to take inventory and refresh stock more easily. Stockroom space is very limited, so I cycle items sold to make things look fresh.
To this end, I keep pretty extensive spreadsheets haha. I could do better with them, but haven't really had the time.
And @Skye I don't know if you know this, but I secretly LOVE your marketing messages. The salesmanship and humor is unparalleled. Even though I haven't bought food in ..well, since mutton.. I absolutely love the thought of you wandering the streets like the Peanut guy at a ballpark, hawking your wares. (totally serious)
Run updateInventory() when you're saving your normal stocking levels.
run compareInventory() when you want to see what's missing since you ran updateInventory()
function asInventoryList(gmcpItems)
local tableResult = {}
for _, item in ipairs(gmcpItems) do
local listItem = tableResult[item.name]
if not listItem then
tableResult[item.name] = 0
end
tableResult[item.name] = tableResult[item.name] + 1
end
return tableResult
end
function updateInventory()
inventoryList = asInventoryList(gmcp.Char.Items.List.items)
saveInventory()
end
function saveInventory()
if string.char(getMudletHomeDir():byte()) == "/"
then _sep = "/"
else _sep = "\\"
end -- if
shop_inventory = getMudletHomeDir() .. _sep .. "shop_inventory.lua"
table.save(shop_inventory, inventoryList)
end -- func
function loadInventory()
if string.char(getMudletHomeDir():byte()) == "/"
then _sep = "/"
else _sep = "\\"
end -- if
shop_inventory = getMudletHomeDir() .. _sep .. "shop_inventory.lua"
if (io.exists(shop_inventory)) then
table.load(shop_inventory, inventoryList)
end -- if
end -- func
function compareInventory()
tempinventoryList = asInventoryList(gmcp.Char.Items.List.items)
loadInventory()
missingItems = {}
for name, count in pairs(inventoryList) do
if not tempinventoryList[name] or tempinventoryList[name] < count then
local currentCount = tempinventoryList[name] or 0
table.insert(missingItems, { name = name, diff = count - currentCount })
end
end
for _, v in ipairs(missingItems) do
cecho("\n<green>Item: " ..v.name.. " - <blue>Sold: " ..v.diff)
end
end
Edit: My only suggestion if this is ever updated again is if it can me made to monitor multiple shops instead of one. I spoke to @Kogan and he told me he could do it with what's there if I needed him to (not sure yet), but I think that'd be highly beneficial for Chancellors who run multiple city shops.
You could do that, but there's no real need. It's just a change to a few lines of code to get it to support multiple shops, just by making "inventoryList" a dictionary using room number as the key, rather than a list for just a single room's worth of items. Hopefully @Kipposhi doesn't mind me making some tweaks to his stuff. If you've already got an inventory list saved, you'll probably want to go and update it after updating the script.
Results of disembowel testing | Knight limb counter | GMCP AB files
I am not guilty for my sleep deprivation.
2: codecodecodecode '2
3: codecodecodecode 'D
4: codecodecodecode '2
5: codecodecodecode 'R
6: codecodecodecode '2
I got you bae