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

Add strategy NUMBER_X #454

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,14 @@ Allowed values for `chat` are:
- **PERCENTAGE**: Select the option with the highest percentage based on odds (It's the same that show Twitch) - Should be the same as select LOWEST_ODDS
- **SMART_MONEY**: Select the option with the highest points placed. [#331](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/331)
- **SMART**: If the majority in percent chose an option, then follow the other users, otherwise select the option with the highest odds
- **NUMBER_1**: Always select the 1st option, BLUE side if there are only two options
- **NUMBER_2**: Always select the 2nd option, PINK side if there are only two options
- **NUMBER_3**: Always select the 3rd option.
- **NUMBER_4**: Always select the 4th option.
- **NUMBER_5**: Always select the 5th option.
- **NUMBER_6**: Always select the 6th option.
- **NUMBER_7**: Always select the 7th option.
- **NUMBER_8**: Always select the 8th option.

![Screenshot](https://raw.githubusercontent.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/master/assets/prediction.png)

Expand Down
30 changes: 30 additions & 0 deletions TwitchChannelPointsMiner/classes/entities/Bet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ class Strategy(Enum):
PERCENTAGE = auto()
SMART_MONEY = auto()
SMART = auto()
NUMBER_1 = auto()
NUMBER_2 = auto()
NUMBER_3 = auto()
NUMBER_4 = auto()
NUMBER_5 = auto()
NUMBER_6 = auto()
NUMBER_7 = auto()
NUMBER_8 = auto()

def __str__(self):
return self.name
Expand Down Expand Up @@ -235,6 +243,12 @@ def __return_choice(self, key) -> int:
largest = index
return largest

def __return_number_choice(self, number) -> int:
if (len(self.outcomes) > number):
return number
else:
return 0

def skip(self) -> bool:
if self.settings.filter_condition is not None:
# key == by , condition == where
Expand Down Expand Up @@ -283,6 +297,22 @@ def calculate(self, balance: int) -> dict:
self.decision["choice"] = self.__return_choice(OutcomeKeys.ODDS_PERCENTAGE)
elif self.settings.strategy == Strategy.SMART_MONEY:
self.decision["choice"] = self.__return_choice(OutcomeKeys.TOP_POINTS)
elif self.settings.strategy == Strategy.NUMBER_1:
self.decision["choice"] = self.__return_number_choice(0)
elif self.settings.strategy == Strategy.NUMBER_2:
self.decision["choice"] = self.__return_number_choice(1)
elif self.settings.strategy == Strategy.NUMBER_3:
self.decision["choice"] = self.__return_number_choice(2)
elif self.settings.strategy == Strategy.NUMBER_4:
self.decision["choice"] = self.__return_number_choice(3)
elif self.settings.strategy == Strategy.NUMBER_5:
self.decision["choice"] = self.__return_number_choice(4)
elif self.settings.strategy == Strategy.NUMBER_6:
self.decision["choice"] = self.__return_number_choice(5)
elif self.settings.strategy == Strategy.NUMBER_7:
self.decision["choice"] = self.__return_number_choice(6)
elif self.settings.strategy == Strategy.NUMBER_8:
self.decision["choice"] = self.__return_number_choice(7)
elif self.settings.strategy == Strategy.SMART:
difference = abs(
self.outcomes[0][OutcomeKeys.PERCENTAGE_USERS]
Expand Down