Code Monkey home page Code Monkey logo

gw2-arbitrage's People

Contributors

iiridayn avatar t-mw avatar timmooney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gw2-arbitrage's Issues

Crash when running

...
Loaded 26395 trading post prices
Loading detailed trading post listings
Fetching https://api.guildwars2.com/v2/commerce/listings?ids=4239,4243,8968,8995,9011,9061,9095,9130,9190,9250,10262,10264,10265,10282,10449,10691,10699,10702,10707,10709,10710,10722,10766,10767,10769,10786,10787,10791,10792,10796,10829,10830,10833,10834,10853,10854,10872,10874,10894,10961,11121,11126,11167,11247,11248,11295,11341,11389,11408,11409,11412,11431,11454,11455,11473,11477,11494,11508,11536,11538,11543,11573,11598,11603,11670,11834,11835,12007,12011,12013,12053,12055,12074,12076,12078,12097,12109,12128,12130,12134,12136,12138,12142,12143,12144,12153,12155,12156,12157,12158,12163,12166,12176,12178,12202,12229,12236,12253,12263,12271,12314,12324,12327,12347,12357,12394,12405,12438,12455,12459,12466,12467,12469,12472,12475,12507,12510,12513,12531,12532,12535,12544,12545,12557,12561,12590,12615,12634,12641,12642,12649,12662,12665,12670,12680,12806,12807,12808,12810,12811,12812,12813,12814,12816,12817,12818,12819,12823,12824,12825,12828,12829,12830,12831,12832,12833,12835,12836,12838,12841,12842,12844,12846,12847,12850,12851,12853,12854,12856,12859,12862,12865,12866,12868,12870,12871,12875,12878,12880,12883,12884,12886,12889,12890,12893,12894,12900,12901,12904,12910,12916,12917,12919,12920,12922,12925,12929,12930,12931,12935
Fetching https://api.guildwars2.com/v2/commerce/listings?ids=12936,12937,12943,12950,12951,12954,12955,12957,12960,12961,12967,12971,12973,12974,12975,12976,12977,12980,12981,12982,12984,12986,12988,12989,12990,12992,12993,12996,12999,13002,13005,13013,13014,13021,13022,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049,13050,13053,13055,13060,13061,13063,13064,13065,13068,13069,13070,13071,13072,13073,13074,13084,13085,13087,13088,13091,13093,13094,13095,13096,13098,13099,13100,13105,13106,13123,13124,13125,13126,13127,13128,13129,13130,13131,13132,13133,13134,13144,13145,13147,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13162,13163,13183,13184,13185,13186,13187,13188,13189,13190,13193,13194,13224,13225,13226,13227,13228,13229,13243,13245,13247,13251,13254,13255,13256,13259,13260,13261,13263,13265,13266,13278,13281,13283,13288,13290,13301,13302,13304,13307,13336,13342,13363,13425,13445,13520,13526,13527,13529,13531,13537,13538,13545,13546,13550,13552,13566,13571,13575,13719,13739,14051,14053,14056,14057,14061,14072,14079,14093,14096,14098,14102,14106,14122,14126,14184,14185,14188,14216,14517,14563,14566,14648,14765,14809,14819,14830,14845,14849,14870,14874,14949,14951,14981,14989,15314,15352,15423,15427
Fetching https://api.guildwars2.com/v2/commerce/listings?ids=15603,15607,15614,15615,15625,15626,15628,15631,15635,15666,15670,15688,15695,15696,15698,15713,15719,15730,15740,15751,15752,15761,15763,19679,19680,19681,19682,19683,19684,19685,19686,19687,19688,19697,19698,19699,19700,19701,19702,19703,19704,19709,19710,19711,19712,19713,19714,19718,19719,19720,19721,19722,19723,19724,19725,19726,19727,19728,19729,19730,19731,19732,19733,19734,19735,19736,19737,19738,19739,19740,19741,19742,19743,19744,19745,19746,19747,19748,19750,19757,19758,19761,19763,19767,19783,19789,19790,19791,19792,19793,19794,19795,19797,19799,19800,19802,19816,19869,19871,19880,19881,19882,19883,19884,19885,19886,19897,19899,19900,19901,19903,19919,19920,19924,19934,19935,19936,19937,19938,19939,19940,19941,19942,19943,19944,19945,19946,19947,19960,19962,19963,19964,19965,19966,19967,19968,19972,19975,24272,24273,24274,24275,24276,24277,24278,24279,24280,24282,24284,24285,24286,24287,24288,24290,24291,24292,24293,24294,24295,24296,24297,24298,24299,24302,24330,24341,24342,24343,24344,24346,24347,24348,24350,24351,24353,24354,24356,24357,24359,24360,24464,24465,24466,24467,24468,24469,24470,24471,24472,24474,24477,24478,24480,24483,24488,24494,24501,24503,24504,24506
Fetching https://api.guildwars2.com/v2/commerce/listings?ids=24507,24527,24534,24535,24748,24773,24872,24873,24875,24884,24898,24899,24900,24904,24906,24907,24908,24911,24912,24916,24917,29988,35524,36734,36756,36769,36773,37174,37178,37179,37897,37907,38139,38151,38166,38179,38264,43773,44941,45603,45616,45622,45629,45642,45731,45737,45759,45765,45798,45811,45911,45924,45995,46005,46008,46018,46180,46186,46262,46272,46298,46314,46327,46340,46353,46708,46713,46747,48609,48612,48614,49424,49425,49426,49427,49428,49429,49430,49431,49432,49433,49434,49435,49436,49437,49438,49439,49522,50082,62951,66637,66650,67528,67530,68063,70437,70647,70670,70714,70842,71049,71136,71225,71307,71336,71428,71583,71692,71702,71776,72048,72194,72349,72433,72549,72579,72752,72781,72807,72955,73034,73286,73471,74090,74202,74719,74852,74877,74982,75015,75181,75270,75570,75739,75857,76216,76297,76411,76478,76518,76614,76708,76839,77112,77256,82125,82582,82642,82678,82749,82796,82991,83103,83284,83757,84277,86601,91350,93397,93417,93440,93454,93596,93597
Loaded 742 detailed trading post listings
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src\crafting.rs:271:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Application failed to run due to an issue in calculating crafting. Looking at the source, it looks like check at 269 is not covering all cases.

modify shopping list printout to include ( N x stacks + remainder) when ingredient_count > 250

Hi!

I can program in several languages, but Rust isn't one of them. I'm trying to modify the shopping list printout so that instead of
output like this:

============
Shopping list for 1298 x Sheet of Fine Paper = 3.29.81g profit (7 / step)
============
1234 Cotton Scrap
681 Bolt of Cotton
3894 Seasoned Wood Log

I instead get output something like this:

============
Shopping list for 1298 x Sheet of Fine Paper = 3.29.81g profit (7 / step)
============
1234 (4 stacks + 234) Cotton Scrap
681 (2 stacks + 181) Bolt of Cotton
3894 (15 stacks + 144) Seasoned Wood Log

In other words, make it report the number of stacks + remainder in the case when the buy order is larger than the stack size. I don't care if it says "N stacks + ###" or "Nx250 + ###" or something else, just that it does the math for me and makes it clear how many full stacks plus partial amount is required.

I made a clumsy attempt to do this myself by adding the following to your area containing constants:

// GW2 uses a "stack size" of 250
const ITEM_STACK_SIZE: i32 = 250;

and then as a first attempt I changed the recipe-printing code to:

        println!("============");
        for (ingredient_id, ingredient_count) in &purchased_ingredients {
            if ingredient_count > ITEM_STACK_SIZE {
                let num_stacks = ingredient_count / ITEM_STACK_SIZE;
                let remainder  = ingredient_count % ITEM_STACK_SIZE;
                println!(
                    "{} ({}x{} +{}) {}",
                    ingredient_count.ceil().to_integer(),
                    num_stacks,
                    ITEM_STACK_SIZE,
                    remainder,
                    items_map
                        .get(ingredient_id)
                        .map(|item| item.name.as_ref())
                        .unwrap_or("???")
                );
            } else {
                println!(
                    "{} {}",
                    ingredient_count.ceil().to_integer(),
                    items_map
                        .get(ingredient_id)
                        .map(|item| item.name.as_ref())
                        .unwrap_or("???")
                );
            }
        }

        return Ok(());

Yes, it's an ugly way to do that (based on a couple hours of research I'm guessing using fmt!() to pre-format each line and then
output it would be better), but as I said, this is my first time trying to modify Rust code. I'm trying to get the basics working before making it clean code.

I'm running into an issue because of Rust's strong type system, though. I can't compare ingredient_count to ITEM_STACK_SIZE, I'm getting a mismatched types error:

error[E0308]: mismatched types
   --> src/main.rs:466:26
    |
466 |             if ingredient_count > ITEM_STACK_SIZE {
    |                                   ^^^^^^^^^^^^^^^ expected `&Ratio<i32>`, found `i32`
    |
    = note: expected reference `&Ratio<i32>`
                    found type `i32`

error: aborting due to previous error

Any suggestions on how to pacify the type system?

Thanks!

solstice.1847

no longer possible to filter by discipline

Hey, thanks for creating such an awesome tool!

In the previous version, it was possible to filter recipes by discipline by modifying the list in main.rs:

<!--StartFragment-->const FILTER_DISCIPLINES: &amp;[&amp;str] = &amp;[
      
      
            "Armorsmith",
      
      
            "Artificer",
      
      
            "Chef",
      
      
            "Huntsman",
      
      
            "Jeweler",
      
      
            "Leatherworker",
      
      
            "Scribe",
      
      
            "Tailor",
      
      
            "Weaponsmith",
      
      
        ]; <span class="pl-c">// only show items craftable by these disciplines</span><!--EndFragment-->

Now that the program is an executable, I no longer see a way to modify the list, and exporting to CSV and filtering the list each time is cumbersome. Is it possible to add this back in as a cmd line option, or to read in a config file to filter disciplines?

add missing timegated recipes to is_timegated?

For the past couple days, the Dragon Hatchling Doll Frame has been appearing in the general output from gw2-arbitrage. That's a time-gated recipe (daily), but it's not included in the list of output_item_ids in is_timegated, so it's output even when -t is not passed to gw2-arbitrage.

Would you be interested in a patch that adds all the remaining output_item_id from the wiki Category for time-gated recipes ? That type of patch should be simple enough for me to get right.

Thanks!

solstice.1847

Threshold command switch / config option

It'd be nice to have the large table somewhat smaller; an easy concept would be a threshold value. When scanning the table I usually ignore anything below a certain value or value/step, etc. Value per step or time (hour/min/etc) would probably be the most useful threshold.

This is probably another "accepting pull requests" issue; wishlist type feature, especially since the CSV export currently means you could filter in another tool.

Opt out of showing mystic forge recipes by default

From #7 (comment):

Some Mystic Forge recipes which are added have a chance to produce the listed item - "Endless Gift Dolyak Tonic" and "Mini Steam Minotaur" are two examples. They actually produce a net negative due to the random output, though the tool (based on the data; I probably need to open a bug for those on the upstream) currently reports a positive.

Mystic forge recipes should only be included when you opt-in through an option flag, since there are already enough things that people need to be aware of with the non-mystic forge recipes. Remove "Mystic Forge" from the list of VALID_DISCIPLINES.

Use a well-defined location for 'recipes.bin'/'items.bin'

My rust skills are non-existent, but, starting at

let recipes_path = "recipes.bin";

I've been using

-    let recipes_path = "recipes.bin";
-    let items_path = "items.bin";
+    let data_path = "/home/FOO/.local/share/gw2-arbitrage";
+    let recipes_path = format!("{}recipes.bin", data_path);
+    let items_path = format!("{}items.bin", data_path);

This allows putting the gw2-arbitrage executable anywhere on the path, which I find more convenient than running from the source directory :)

Default cache API calls for a few minutes

As a matter of courtesy and so I'd be more comfortable re-running the script to refresh output, it'd be nice to cache api calls for a bit, and add a flag to refresh api data. Maybe it's only relevant when I'm testing, as I hit the API a bunch, and when not testing I don't mind having live data.

Use my API key to check if I know the recipe

This one is probably an "I'd love a pull request" issue; it also opens potential for discussion of cross-platform configuration files, which is usually not a favorite topic. Opening this so it's available for discussion.

I might work on this when I'm more comfortable with Rust - I do not know enough yet to get file caching for #7 working successfully.

Don't suggest crafting using deprecated recipes

Splitting this issue from #7 as it's actually not related to the custom recipes; Minor Rune of the Air is suggested by the live code.

https://wiki.guildwars2.com/wiki/Minor_Rune_of_the_Air (and likely similar recipes) show historical recipes which are no longer accurate, and do not reflect the true cost of producing the item.

gw2efficiency/issues#1532 pointed out that these recipes come from the API and similarly suggested a blacklist (I really would rather not manually maintain a blacklist). I noted in that issue that the API return for the deprecated recipe lists no disciplines; would that be a reasonable way to detect them?

It might be worth discussing the issue there and possibly following the same resolution (especially if a custom blacklist is required; SSOT and all).

Convert steps into gold per hour

Splitting this off from #7 as it's not related.

Recipes that require assembly could be another opt-in. Ideally I'd want to be able to keep them in the default output, and accurately calculate the time required for each recipe. Then recipes could be ranked by gold per time. Unfortunately as far as I could tell the crafting times from the API weren't accurate, so I added crafting steps as an approximation of time required.

I noted:

I've also been thinking about a gold per hour calculation, and recognized steps as a proxy for it; I hadn't realized the crafting times were included in the API. Could it be the API crafting time is for a single item? Crafting multiple items provides a speed bonus for each - https://wiki.guildwars2.com/wiki/Crafting says:

When crafting a stack of items, the process speeds up progressively: each item queued will craft in half the time of the previous item. For example, if it takes two seconds to create a single bronze ingot, it will take only one second to create the second, and a half second to craft a third. There is a limit to how fast items can be crafted.

I suspect the halving ends after 4-5 times; but it should be pretty easy to craft a stack of mithril ore or something (do it all the time...) and time the duration. I'll check it out.

Two problems with assembler recipes:

  1. Users might not have access to the assembler in any guild, or the guild may not have the recipe unlocked
  2. Crafting assembler recipes ties you to the computer every 5.5 minutes, unlike other recipes which you autocraft many stacks of. Showing an accurate crafting duration might reasonably answer this point though. Also, "many stacks" still is almost universally less than 5.5 minutes.

Show recipe price, if recipe must be crafted/bought

Thank you very much for this - this is a tool I have considered building, and I hopefully would have thought to account for market liquidity while I was building it (I had intended to account for trade volume to forecast, so not entirely dissimilar). One feature I had hoped to build in my hypothetical tool was to account for recipe cost.

Currently, "Feast of Roasted Parsnips" is the top item to produce, but requires a mystic forge recipe which costs >108g (199g on the TP). While an investment of 108g for a profit of 8g seems valuable if repeatable 14 times, I'm not sure enough "Feast of Roasted Parsnips" move to justify the investment. I suspect most of the buy volume comes from traders canceling trades, and am hesitant to produce an item which will only be resold, but (almost) never actually used.

While the "feast" recipes are available on the TP (but ideally should show the cheaper of the sell price or Mystic Forge recipe), others, like the "Sunspear Smasher" are account bound, requiring various currencies to purchase (estimating the total value of those in gold can be hard, and is likely best left to the [fast] website or another dedicated tool).

This would likely require bothering the wiki or an aggregator of the wiki data, as I don't believe this data is available in the API. The wiki has an API returning the wikitext, which might be simpler to parse than the HTML; ie, at https://wiki.guildwars2.com/rest.php/v1/page/Recipe:_Feast_of_Roasted_Parsnips.

It looks like https://github.com/gw2efficiency/custom-recipes is a good wiki data aggregator for non-api recipes. Something similar would be feasible for recipe acquisition data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.