Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- added info about contenders skins to menu
- removed the use of platform/level
- made inaccessible menu option of adding an account using username
  • Loading branch information
ucarno committed Dec 18, 2022
1 parent 2e2f324 commit cd79c35
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .scripts/start.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
..\venv\Scripts\activate&cd ..&title Overwatch League Token Farmer&python main.py
..\venv\Scripts\activate&cd ..\src&title Overwatch League Token Farmer&python main.py
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 21 additions & 19 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand All @@ -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 '
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'

Expand All @@ -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')

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit cd79c35

Please sign in to comment.