Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line colors for easy distinction #45

Closed
Yishaqel opened this issue Feb 3, 2021 · 8 comments · Fixed by #82
Closed

Command line colors for easy distinction #45

Yishaqel opened this issue Feb 3, 2021 · 8 comments · Fixed by #82
Labels
enhancement New feature or request

Comments

@Yishaqel
Copy link

Yishaqel commented Feb 3, 2021

After a few days using this program, I have realized that it is not easy to distinguish some things and I thought it would be easier if some parts were colored.

For example, in the bets several messages are shown but it is not easy to read the streamer who you are betting on.

I imagine something similar to this but with colors:

Start betting for EventPrediction: Please star this repo owned by streamer-username (xxx points)
+12 → streamer-username (xxx points) - Reason: WATCH.

The bold text would be in random color, the same for the percentages in the bets.

Thanks for your work!

@Yishaqel Yishaqel added the enhancement New feature or request label Feb 3, 2021
@Yishaqel
Copy link
Author

Yishaqel commented Feb 3, 2021

I think it would be easier to distinguish when you have a lot of text on the screen and also to know what you have gained from the previous prediction. I don't understand programming so I don't know if it can be easily implemented.

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Feb 3, 2021

The coloured terminal was my first idea to integrate in the logging module, but I switched to emoji.
Personally, I don't have any issue to distinguish the message because I have the emoji. I can work on terminal colour, but I'm scared that we can have a problem on Windows and then working for nothing 😞

@Yishaqel
Copy link
Author

Yishaqel commented Feb 3, 2021

I have previously used command line programs that worked with colors and so I thought it could be implemented but still it is not something that is urgent or essential. Thanks for taking it into account anyway!

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Feb 3, 2021

Check if you are able to run https://github.com/tartley/colorama on your machine.
You can create a new file called color-test.py, the following code should be enough

from colorama import init
init()

from colorama import Fore, Back, Style
print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Style.RESET_ALL)
print('back to normal now')

Remember also to do pip install colorama

@Rakambda
Copy link
Contributor

Rakambda commented Feb 3, 2021

They seem to work on Windows 10, with cmd and windows terminal.

cmd_2021-02-03 14 57 57 765_FU7qK5p3H6

For example, in the bets several messages are shown but it is not easy to read the streamer who you are betting on.

I totally agree with that part. The betting logs are a lot and you don't really know if the bet has been placed (last log is Going to place the bet for EventPrediction: xxx but no bet placed or something of the kind).

Also I kinda agree with the colors a bit, the terminal colors seems to be more widely working on different terminals. Like cmd for example, it supports the colors but not the emojis. Windows terminal supports both but isn't really the default in Windows for now.

Though I kinda agree with @Tkd-Alex though more, the emojis already give an easy way to see what lines correspond to what kind of event. They are already somewhat colored by themselves (but need to have them enabled and can be a problem on windows for example).

Using colors may be hard (IMO) to find enough colors that are readable. Having a background to the text seems ugly, and the font color itself will also depend on what is the background of the terminal. Some likes it black, some gray, some kinda transparent... So what renders well on one side, may not on the other.

I guess this is kinda a tradeoff between implementing colors in the code or having users using a not too old terminal so that it supports emojis.


Though as readability is mentioned here, I have one point with the emojis that is rather hard to read: the online/offline (🥳 / 😞 ). The faces are quite small and if not up close not that distinguishable. Something like ✔️ / ❌ seems more readable.

@Rakambda
Copy link
Contributor

Rakambda commented Feb 3, 2021

Just to add a bit about the prediction logs, while working on #46 I added a log line into prediction-made to see the points that are placed:

03/02 15:02:10 - �  -3580 → iskall85 (35.8k points) - Reason: PREDICTION.

And I have to say that this is quite convenient to have the info directly under the eye instead of searching in the 4ish lines when the bet is being placed. Though I guess that #41 can help towards that by having technical stuff as a debug log and the actual bet sent as an info log summarizing the thing.

@Yishaqel
Copy link
Author

Yishaqel commented Feb 3, 2021

For me colorama is working correctly.

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Feb 4, 2021

Most of the logs are only for DEBUG, I've added for tested and never deleted or moved on DEBUG instead INFO.
About the prediction's logs. If #41 will be successful we definitely remove the Browser class and all the related logs:

04/02/21 14:35:22 - INFO - [start_bet]: 🔧  Starting betting for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!) owned by Streamer(username=username, channel_id=0000, channel_points=1.3k)

04/02/21 14:35:33 - INFO - [__open_coins_menu]: 🔧  Opening coins menu for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)
04/02/21 14:35:35 - INFO - [__click_on_bet]: 🔧  Clicking on the bet for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)
04/02/21 14:35:37 - INFO - [__enable_custom_bet_value]: 🔧  Enable input of custom value for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)

04/02/21 14:35:39 - INFO - [on_message]: ⏰  Place the bet after: 18.21s for: EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)

04/02/21 14:35:57 - INFO - [place_bet]: 🔧  Going to complete bet for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!) owned by Streamer(username=username, channel_id=0000, channel_points=1.3k)
04/02/21 14:35:58 - INFO - [place_bet]: 🔧  Decision: Yes (BLUE), Points: 7k, Users: 22 (46.81%), Odds: 4.07 (24.57%)
04/02/21 14:35:58 - INFO - [place_bet]: 🔧  Going to write: 65 channel points on input A
04/02/21 14:36:00 - INFO - [place_bet]: 🔧  Going to place the bet for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)

Will be only:

04/02/21 14:35:39 - INFO - [on_message]: ⏰  Place the bet after: 18.21s for: EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!)
04/02/21 14:35:57 - INFO - [place_bet]: 🍀  Going to complete bet for EventPrediction(event_id=xxxx-yyyy-zzzz, title=Please leave a star on this repo!) owned by Streamer(username=username, channel_id=0000, channel_points=1.3k)
04/02/21 14:35:58 - INFO - [place_bet]: 🍀  Place 2345 channel points on Yes (BLUE), Points: 7k, Users: 22 (46.81%), Odds: 4.07 (24.57%)

Of course, we can also add a single-line when the bet was confirmed by Twitch ws.


In queue:

Something like ✔️ / ❌ seems more readable.

@Tkd-Alex Tkd-Alex linked a pull request Feb 21, 2021 that will close this issue
5 tasks
1v pushed a commit to 1v/Twitch-Channel-Points-Miner-v2 that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants