t-mw / gw2-arbitrage

Finds items in Guild Wars 2 that can be sold on the trading post for a higher price than the cost of crafting the item.
28 stars 5 forks source link

Fix items file for SoTO and other changes #46

Closed Iiridayn closed 1 year ago

Iiridayn commented 1 year ago

Sorry this is not a clean PR - can accept or let me know you'd rather just the API changes. Useful to have at least the names and allow new computers to work w/the API changes. Haven't had time to work on this much lately.

Iiridayn commented 1 year ago

Fixed where the tests get the included code. There are some rounding differences in calculate_crafting_profit_agony_infusion_profitable_test - not sure if my changes in a prior pull request made the prices more precise or less accurate. Don't have time right now to compute it all out by hand, though I noted in src/money.rs that I was accepting being off by 1 copper here and there. Let me know how you'd like to handle it - the test is a bit too expensive for me to try to get ground truth from the trading post, but you presumably used a real example then.

As an aside, there's a bug I've not had time to track down when making Rich Campfire Treat, where this strongly prefers to craft 1-2 (x10) Dry Baker's Ingredients instead of buying them, despite preferring to buy all the rest at the exact same cost from the TP. Given time (heh) I hope to stick that in as a test case and track it down. Something similar is going on with silk patches.

t-mw commented 1 year ago

Thanks! The test with the rounding difference is already failing on master, the expected crafting cost should already be calculated precisely in the test but it's not important