xvwyh / BuildPad

A build storage plugin for ArcDPS
https://buildpad.gw2archive.eu
MIT License
29 stars 3 forks source link

Would you consider add get recommend build from build webs ? #2

Open jiangyi0923 opened 4 years ago

xvwyh commented 4 years ago

I was considering it as a potential feature in the future, but when it comes down to the design of it, there are two possible options:

jiangyi0923 commented 4 years ago

You are right, I also considered reposting the build code, but this will put a lot of burden on me. Unless some website gives us an API

deadpyxel commented 3 years ago

One thing that could work is to provide an API around one of those sites for your addon to interact. I would be interested in trying to get something like that up and running unless we already have that and I'm not aware.

xfouloux commented 3 years ago

we could ask LN/Snowcrows/Hardstuck maybe to release an api.

I don't think metabattle would, because they want some ads on the website to pays bills.

But making an easy parser to provide an API to your project can always be done quite easily i think, no moderation or such, it would parse and store builds

"website.com/api/class" would return a json

could buildpad be able to open a browser from the pc to go on the build page to the provided link ?

it would be real good i guess, do you think if i or someone do this, you would be able to implement it easily ? Would it be against the ToS ? Because basicaly having this easy retrieval of templates could cause players to not even buy slots or account slots

xfouloux commented 3 years ago

i've started coding some stuff, i'm able to scrape luck-noob so far from a formated json with URLs, this is the result from my script

{
    "warrior": {
        "berserker": {
            "raid": {
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQIEHzMWEhbyEgAAxBIAANcSAACpAAAAwhIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/berserker-power-dps"
                },
                "Power Banner": {
                    "builds": {
                        "Power Banner": "[&DQIEHzMWEhXyEgAAqgAAAKwAAACpAAAAwhIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-banner-berserker"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQIkLTM1EiryEgAA3BIAANcSAAChEgAAwhIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-dps-berserker"
                },
                "Condition Banner": {
                    "builds": {
                        "Condition Banner": "[&DQIkLTM1EiryEgAA3BIAAKwAAACqAAAAwhIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-banner-berserker"
                }
            }
        }
    },
    "guardian": {
        "dragonhunter": {
            "raid": {
                "Heal Quickness": {
                    "builds": {
                        "Virtues": "[&DQExKS4qPjZLFwAAehYAAFMXAABJAQAAiRIAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Radience": "[&DQEQJjEpPjZLFwAAehYAAFMXAAD+AAAAiRIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/heal-quickness-firebrand"
                },
                "Condition Quickness": {
                    "builds": {
                        "Condition Quickness": "[&DQEQGi4fPjpLFwAAMQEAAHoWAABMAQAAiRIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-quickness-firebrand"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQEQGi4fPj1LFwAAMQEAAHoWAABMAQAANwEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-dps-firebrand"
                },
                "Power DPS": {
                    "builds": {
                        "Radiance": "[&DQEqOhA+GzkmDwAAihIAAEgBAAD+AAAAtRIAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Radiance PI": "[&DQEqOhAuGzkmDwAAihIAAEgBAAD+AAAAtRIAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Virtues": "[&DQEqOi4VGzkmDwAAihIAAEgBAAD+AAAAtRIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-dragonhunter"
                },
                "Core": {
                    "builds": {
                        "Radiance": "[&DQEqOhA+LhUmDwAAeAEAAEgBAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Radiance PI": "[&DQEqOhAuLhUmDwAAeAEAAEgBAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/core-guardian"
                }
            }
        }
    },
    "revenant": {
        "renegade": {
            "raid": {
                "Condition DPS": {
                    "builds": {
                        "Condition DPS Devastation": "[&DQkOHQ82PyrcEQAAKxIAANQRAAAGEgAAyhEAAAQFAADUESsSBhIAAAAAAAA=]",
                        "Condition DPS Beschw\u00f6rungInvocation": "[&DQkOHQMmPyrcEQAAKxIAANQRAAAGEgAAyhEAAAQFAADUESsSBhIAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-renegade"
                },
                "Condition Alacrity": {
                    "builds": {
                        "Condition Alacrity Devastation": "[&DQkOHQ82PzrcEQAAKxIAANQRAAAGEgAAyhEAAAQFAADUESsSBhIAAAAAAAA=]",
                        "Condition Alacrity Invocation": "[&DQkOHQMmPzrcEQAAKxIAANQRAAAGEgAAyhEAAAQFAADUESsSBhIAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-alacrity-renegade"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS Invocation": "[&DQkDJg86PxncEQAA1BEAACsSAAAGEgAAyhEAAAIFAADUESsSBhIAAAAAAAA=]",
                        "Power DPS Retribution": "[&DQkJHg86PxncEQAA1BEAACsSAAAGEgAAyhEAAAIFAADUESsSBhIAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-dps-renegade"
                },
                "Power Alacrity": {
                    "builds": {
                        "Power Alacrity": "[&DQkDJg82Pz3cEQAA1BEAACsSAAAGEgAAyhEAAAIFAADUESsSBhIAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-alacrity-renegade"
                },
                "Heal Alacrity": {
                    "builds": {
                        "Heal Alacrity": "[&DQkMPw82Pz/cEQAAKxIAAAYSAADUEQAAyhEAAAYFAADUESsSBhIAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/heal-alacrity-renegade"
                },
                "Power Boon": {
                    "builds": {
                        "Power Boon": "[&DQkDNg8mNCbcEQAA1BEAACsSAAAGEgAAyhEAAAIBAAAGEisS1BEAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/boon-herald"
                },
                "Handkite": {
                    "builds": {
                        "Handkite": "[&DQkJOgw7NC3cEQAAKxIAAAYSAADUEQAAyhEAAAYBAAAGEisS1BEAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/handkite-herold"
                }
            }
        }
    },
    "ranger": {
        "soulbeast": {
            "raid": {
                "Handkite": {
                    "builds": {
                        "Handkite": "[&DQQhLhkuNxt4AAAANBYAAMIAAAD6FgAAlwEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/handkite-soulbeast"
                },
                "Hybrid DPS": {
                    "builds": {
                        "Hybrid DPS": "[&DQQePSA/Ny55AAAApQEAAOkWAAC/AAAALhYAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/hybrid-soulbeast"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQQeNyA7Nz55AAAApQEAALUAAACsAQAALhYAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-soulbeast"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS Torch": "[&DQQeHSE3Ny55AAAA6RYAALoAAAC/AAAALhYAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Condition DPS Shortbow": "[&DQQeHSAfNy55AAAA6RYAALoAAAC/AAAALhYAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-soulbeast"
                },
                "Condition Heal": {
                    "builds": {
                        "Condition Boon": "[&DQQeFRkaBRYlDwAAvQAAALwAAAC/AAAAlwEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-druid-heal"
                },
                "Heal": {
                    "builds": {
                        "Heal": "[&DQQeNRkeBRYlDwAAvAAAAL0AAAC5AAAAlwEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Heal Push": "[&DQQIPxkeBRolDwAAvQAAALkAAACoEgAAlwEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/druide-heal"
                }
            }
        }
    },
    "thief": {
        "daredevil": {
            "raid": {
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQUcGyw9BxmUEgAALwEAAD4BAAALAQAAKAAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-daredevil"
                },
                "Power Rifle": {
                    "builds": {
                        "Power DPS": "[&DQUcPSMbOh0MAQAAMwEAAB8WAAAgFwAAPRYAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Pylon Kite": "[&DQUcPSM7OhUMAQAAMwEAAFcBAABYAAAAPRYAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/de-rifle"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQUcPSMbBzmFAAAAMwEAAFcBAACwEgAAKAAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-daredevil"
                },
                "Power Boon": {
                    "builds": {
                        "Power Boon": "[&DQUcLSwtBzuFAAAAMwEAAFcBAACwEgAAKAAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/segens-draufgaenger"
                },
                "Boon": {
                    "builds": {
                        "Power Boon": "[&DQUcKTYpLCUkDwAAMwEAAFkBAABUAQAADgEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/boon-core-dieb"
                }
            }
        }
    },
    "engineer": {
        "holosmith": {
            "raid": {
                "Superspeed": {
                    "builds": {
                        "Power Superspeed": "[&DQMdGRUmOR6EAAAAYQEAADUWAABfAQAAmAEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/superspeed-holosmith"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQMGKyY5OTcqDwAAhgAAAAcBAACTAQAA8BUAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-holosmith"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQMGOyYvKz0qDwAAhgAAAKMAAACuEgAAiQEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/scrapper-power"
                },
                "Power Quickness": {
                    "builds": {
                        "Power Quickness": "[&DQMGOyYvKy3ZEgAAhgAAACcTAACuEgAAgxIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/scrapper-quickness"
                },
                "Heal Quickness": {
                    "builds": {
                        "Heal Quickness": "[&DQMvOR0XKyWEAAAADhMAACcTAACVAQAAmAEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/scrapper-heal"
                }
            }
        }
    },
    "elementalist": {
        "weaver": {
            "raid": {
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQYfFRomOBV0AAAAywAAAHIAAAA1FwAAEhcAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condi-weaver"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQYfHSkrMBvHEgAAQgEAAL4BAADLAAAAlwAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-tempest"
                },
                "Heal": {
                    "builds": {
                        "Heal": "[&DQYpKREqMD/HEgAApRIAAMMSAAB0EgAAmRIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/tempest-heal"
                }
            }
        }
    },
    "mesmer": {
        "chronomancer": {
            "raid": {
                "Condition Axe": {
                    "builds": {
                        "Condition DPS Axe": "[&DQcBJy09Ox8jDyMPgwFkAWQBZwGBAbYBRhe8AQAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/mirage-condition"
                },
                "Condition Staff": {
                    "builds": {
                        "Condition DPS Staff": "[&DQcBJS0dOxXuFQAAgwEAAIEBAADgFQAARhcAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/mirage-alac-staff"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQcBJxg/KD4jDwAAgwEAAIEBAABrAQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-dps-chronomancer"
                },
                "Condition Support": {
                    "builds": {
                        "Condition Boon Dueling": "[&DQcBJxg/KC8jDwAAgAEAAIcSAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Condition Boon Inspiration": "[&DQcXOxg/KC8jDwAAgAEAAIcSAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-support-chronomancer"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS Focus": "[&DQcKGgEdKDYjDwAAjwEAAGkBAABrAQAAsxIAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Power DPS Greatsword": "[&DQcKGQEdKDYjDwAAjwEAAGkBAAAEEwAAsxIAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-chronomancer"
                },
                "Power Support": {
                    "builds": {
                        "Domination/Dueling Greatsword": "[&DQcKGQEdKC4jDwAAzxIAAI8BAABrAQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Domination/Dueling Focus": "[&DQcKGgEdKC4jDwAAzxIAAI8BAABrAQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Domination/Inspiration Greatsword": "[&DQcKGhc7KC4jDwAAgAEAAM8SAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Domination/Inspiration Focus": "[&DQcKGRc7KC4jDwAAgAEAAM8SAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Dueling/Inspiration": "[&DQcBHRc7KC4jDwAAgAEAAM8SAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Illusions/Inspiration": "[&DQcXOxgZKC4jDwAAgAEAAM8SAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]",
                        "Chaos/Inspiration": "[&DQctORc7KC8jDwAAgAEAAM8SAAC2AQAAvAEAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-chrono-support"
                }
            }
        }
    },
    "necromancer": {
        "reaper": {
            "raid": {
                "Heal": {
                    "builds": {
                        "Heal": "[&DQgTNTIZPBV+FgAAdwEAACQXAABvAQAAlQAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/scourge-heal"
                },
                "Condition DPS": {
                    "builds": {
                        "Condition DPS": "[&DQgnNjI1PCYoDwAAcAEAAIAAAABvAQAAkgAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/condition-scourge"
                },
                "Power DPS": {
                    "builds": {
                        "Power DPS": "[&DQg1KTIlIjabAAAAgQAAAEABAAB1AQAAlQAAAAAAAAAAAAAAAAAAAAAAAAA=]"
                    },
                    "url": "https://lucky-noobs.com/builds/power-reaper"
                }
            }
        }
    }
}
xfouloux commented 3 years ago

it is almost all automated,

BACKEND :

API FRONTEND :

xfouloux commented 3 years ago

https://github.com/xfouloux/gw2-buildpad-api/

xfouloux commented 3 years ago

@xvwyh can you tell me if you would do anything around this, before i continue =) ?

deadpyxel commented 3 years ago

@xfouloux I believe this would be a great addition in general, not only in the context of buildpad, I could try to help you in get it up and running. I would have to work on it in my spare time, but probably can help with a thing or two if you are interested.

One thing that could work for your API would be to use selenium headless mode, or just fetch the page data and parse with BeautifulSoap (as I saw you are doing). The work comes in finding good strategies to parse it up and serve as a public API (probably split by class or spec), or by gamemode.

We can discuss more in your own repo if you want

xfouloux commented 3 years ago

Biggest issue i saw so far is Snowcrows website is poorly done with no ids or easy classes to get and might be hard to parse, also, i might have issues doing a frontend api from a json, i need to check how to do this ^^

Don't know really if selenium is needed, but maybe if i can't parse some.

i'll continue to work on it this week, check my repo for updates, and we will see how it goes from there =) !

xvwyh commented 3 years ago

First of, python scripts are of no use to me. My webserver only has PHP on it, so the absolute best I could do would be to load pages with PHP and parse them, and cache the results for some time. And I have no desire to code anything whatsoever in PHP.

If the intention is for me to run those scripts myself and upload the results somewhere, then that's a no: I have no interest in adding anything that requires manual maintenance. They change the website layout - and I would need to update the parser.

And lastly, I no longer have any personal interest in adding anything like this to the addon. The game's community has proven itself to me to be completely inadequate in making informed decisions and understanding the breadth of options they have, and would rather just follow the herd. The last thing I want is to help them in that, by reducing the complexities of buildcrafting down to picking an item from a list. There are a lot more considerations and nuances regarding what build to play than just picking a build template code. Considerations that are to be made by studying and comparing alternatives. Nuances that are better explained in a long piece of text on a website. Give the people, who put in all this effort for you, a credit and visit their website, and study their work, instead of thinking that copying a build code is all you need to succeed. Hell, it obviously isn't enough, because there's no telling what gear you need to run with it, you would need to open the website anyway!

The addon is a build storage. A notepad. Not an all-in-one service for all your build needs. Sorry.

xfouloux commented 3 years ago

I get all that,

my intent was more i run the python (backend) and something (frontend) on my servers, and your buildpad would only do a curl on my frontend/api/classname to get all this classname builds templates code.

It was mainly a need for myself at start, because even with all 24 templates slots + toons templates, i'm often having to open browser to get another build because lack of space and i had to drop it (mainly for my mesmer and guard, doing raids + www + pvp)

Also i play on 2 computers, so i need to store the builds multiple times, when a build gets an update, same i have to do it twice... i was merely seeing a quality of life improvment of your plugin.

well @deadpyxel i don't think i'll continue doing anything on my end then because i see no real use to agregate all builds if we can't have a simple way to load them in game from the plugin, unless you see something i don't. feel free to fork.

xvwyh commented 3 years ago

You are, of course, welcome to fork this repo and do whatever you want with it, make it fit your needs, that's the reason open source exists. There's plenty of examples inside on how to make web requests and parse json, can't be that difficult to build something on top of it.

xfouloux commented 3 years ago

@xvwyh yeah i did some c++ a long time ago so might be if i have time but unlikely. i'm wondering one thing, where are buildpad build stored ? Because if i could generate a file containing builds that buildpad would load it would be at least great i don't see anything in the folder of buildpad, and nothing in the addon folder in mydocuments found it. Oh i see you replied =)

xvwyh commented 3 years ago

Guild Wars 2\addons\arcdps\arcdps.buildpad\config.ini =version|code|flags|iconflags|keybind|name Bit of an abuse of .ini structure. The key name is empty (the part before before =) :D. Gets read and written here: https://github.com/xvwyh/BuildPad/blob/b50c4c89ecc7a97f0dab4c20b9d8f9c24535e5d5/arcdps_buildpad/buildpad/BuildStorage.cpp#L152

xfouloux commented 3 years ago

awesome, i'll see if i can do anything using this at least =)

xvwyh commented 3 years ago

nothing in the addon folder in mydocuments

It's.... in my documents?.. *gulp* I may have made a symlink ages ago. Now I have no idea whether I'm doing the same that other addons are doing...

No, it states

config will be created in 'gw2 install dir/addons/arcdps/'.

on arcdps's website... It shouldn't be in my documents... Unless that info is outdated...

xfouloux commented 3 years ago

Yep no i edited my comment, it's in the game folder like you said =) !

I'm trying to see how i can flag builds now as a bonus.

But i shoud be able to generate without issue a build like to put inside the .ini file and load it then ! Better than nothing =)

xvwyh commented 3 years ago

Flags are here: https://github.com/xvwyh/BuildPad/blob/b50c4c89ecc7a97f0dab4c20b9d8f9c24535e5d5/arcdps_buildpad/buildpad/Build.h#L12