From cd79c35a2b08ee303aa4389cf843d05faea0a736 Mon Sep 17 00:00:00 2001 From: Dmitri Romanov <32498097+ucarno@users.noreply.github.com> Date: Sun, 18 Dec 2022 18:45:21 +0200 Subject: [PATCH] Update - added info about contenders skins to menu - removed the use of platform/level - made inaccessible menu option of adding an account using username --- .scripts/start.cmd | 2 +- README.md | 16 +++++++++++----- src/config.py | 4 +--- src/main.py | 40 +++++++++++++++++++++------------------- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.scripts/start.cmd b/.scripts/start.cmd index f9358dc..f17b829 100644 --- a/.scripts/start.cmd +++ b/.scripts/start.cmd @@ -1 +1 @@ -..\venv\Scripts\activate&cd ..&title Overwatch League Token Farmer&python main.py \ No newline at end of file +..\venv\Scripts\activate&cd ..\src&title Overwatch League Token Farmer&python main.py \ No newline at end of file diff --git a/README.md b/README.md index aad3ca4..997ce08 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -# OWL Tokens and Contenders Skins farmer bot -This is a command line bot that "watches" league and contenders streams for you, without the need to worry about +# OWL Tokens and Contenders Skins[*](https://github.com/ucarno/ow-league-tokens#issues) farmer bot +This is a command line bot that "watches" league and contenders[*](https://github.com/ucarno/ow-league-tokens#issues) streams for you, without the need to worry about missing some. -**No password or other sort of authentication required. Just your username.** +**No password or other sort of authentication required. +[Just your ~~username~~ ID](https://github.com/ucarno/ow-league-tokens#issues).** [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/) @@ -29,12 +30,17 @@ watch league streams on an official Overwatch League website. 3. Move your `config.json` file from old location to new location. ## Issues +* Due to profiles' API change new accounts can no longer be added using username (consider adding +account manually [using your ID](https://github.com/ucarno/ow-league-tokens#manually-getting-your-account-id)). +* Contenders Skins earning is broken (but may occasionally start working), see +[this issue](https://github.com/shirokumacode/overwatch-omnic-rewards/issues/28#issuecomment-1194812086). + Feel free to [create new issue](https://github.com/ucarno/ow-league-tokens/issues/new) if something is not working for you. -Please note that getting your tokens can take up to 48 hours and getting extra rewards could take even more time. +Please note that getting your tokens can take up to 48 hours (sometimes even weeks!) and getting extra rewards could take even more time. ## Command line arguments Program can be started without menu using `python main.py nomenu` command. But to do this you need to -configure program using menu or use arguments. +configure program using menu first or use arguments. ### Arguments Arguments can be used only when starting program using `nomenu` command: diff --git a/src/config.py b/src/config.py index 2cfed66..697642d 100644 --- a/src/config.py +++ b/src/config.py @@ -14,9 +14,7 @@ def load(self) -> dict: if 'account_id' in old_config: config = self.get_default() config['accounts'][old_config['account_id']] = { - 'username': 'UNKNOWN', - 'platform': 'UNKNOWN', - 'level': 'UNKNOWN', + 'username': f'ID:{old_config["account_id"]}' } else: config = old_config diff --git a/src/main.py b/src/main.py index 7461871..cc457b3 100644 --- a/src/main.py +++ b/src/main.py @@ -92,7 +92,7 @@ def interrupt(t: str): bot_text, # option 1 - '&s(+)&r Add an account', + '&s(+)&r Add an account by username &f(NOT WORKING)', # option 2 '&s(+)&r Add an account manually (using account ID)', @@ -111,7 +111,7 @@ def interrupt(t: str): # option 6 f'{stop_text if c.config["earn_owc"] else start_text} earning Contenders Skins ' - f'{earning if c.config["earn_owc"] else not_earning} &e(experimental!)&r', + f'{earning if c.config["earn_owc"] else not_earning} &e(experimental!*)&r', # option 7 f'{"&fDisable" if c.config["debug"] else "&sEnable"}&r debug messages ' @@ -152,6 +152,13 @@ def interrupt(t: str): # adding an account elif option == 1: print_fmt('\n&nAdding an account...&r') + interrupt('&fBlizzard has made changes to their profiles API, so ID is now irretrievable this way. ' + 'Consider manually getting your ID and using &eoption 3&f. ' + 'To get your ID, just follow instructions from here: ' + '&ehttps://github.com/ucarno/ow-league-tokens#manually-getting-your-account-id') + continue + + # leaving the code in case there is another way of retrieving ID using username or API will change while True: print_fmt('What is your username? (for example &nmyUsername&r or &nmyUsername#1234&r) ' '- leave &oblank&r to exit') @@ -189,9 +196,7 @@ def interrupt(t: str): else: print_fmt(f'Found &n{len(users)}&r users with that username. You are..?') for index, item in enumerate(users): - print_fmt(f' &o{index + 1}.&r &n{item["name"]}&r ' - f'(level: {item["playerLevel"]}, ' - f'platform: {item["platform"].upper()})') + print_fmt(f' &o{index + 1}.&r &n{item["battleTag"]}&r') print_fmt('&o Leave blank to leave&r') while True: @@ -243,7 +248,7 @@ def interrupt(t: str): elif option == 2: print_fmt('\n&nAdding an account using account ID&r') print_fmt('Where to get your account ID: ' - 'https://github.com/ucarno/ow-league-tokens#manually-getting-your-account-id') + 'https://github.com/ucarno/ow-league-tokens#manually-getting-your-account-id') leave_text = '&sAlright!&r' @@ -266,11 +271,7 @@ def interrupt(t: str): continue else: - c.config['accounts'][number] = { - 'username': f'ID:{number}', - 'level': '???', - 'platform': '???', - } + c.config['accounts'][number] = {'username': f'ID:{number}'} c.save() print_fmt('&sAccount added!&r') @@ -302,10 +303,7 @@ def interrupt(t: str): else: print_fmt('What account do you want to remove?') accounts = [(key, value) for key, value in accounts.items()] - accounts_str = '\n'.join([( - f' &o{i + 1}.&r {a[1]["username"]} ' - f'({a[1]["platform"].upper()} - LVL {a[1]["level"]}+)' - ) for i, a in enumerate(accounts)]) + accounts_str = '\n'.join([f' &o{i + 1}.&r {a[1]["username"]} ' for i, a in enumerate(accounts)]) print_fmt(accounts_str) print_fmt('&oLeave blank to exit.&r') @@ -348,10 +346,7 @@ def interrupt(t: str): interrupt('&fThere are no accounts.&r') accounts = [(key, value) for key, value in accounts.items()] - accounts_str = '\n'.join([( - f' &o{i + 1}.&r {a[1]["username"]} ' - f'({a[1]["platform"].upper()} - LVL {a[1]["level"]}+)' - ) for i, a in enumerate(accounts)]) + accounts_str = '\n'.join([f' &o{i + 1}.&r {a[1]["username"]} ' for i, a in enumerate(accounts)]) interrupt(accounts_str) # switching owl tokens @@ -369,6 +364,13 @@ def interrupt(t: str): text = f'You will &fno longer earn&r Contenders Skins.' if c.config['earn_owc'] else \ 'You will &snow earn&r Contenders Skins!' c.config['earn_owc'] = not c.config['earn_owc'] + + if c.config['earn_owc']: + print_fmt('&fPlease note that contenders skins earning is not working for now (18.12.2022). ' + 'It may and may not occasionally start working in future, no one knows. ' + 'You can find more info about this issue here: ' + '&ehttps://github.com/shirokumacode/overwatch-omnic-rewards/issues/28#issuecomment-1194812086&r') + c.save() interrupt(text)