Merge pull request #454 from honomoa/feature/strategy_number

Add strategy NUMBER_X
This commit is contained in:
Roman Davydov
2024-02-29 21:39:05 +03:00
committed by GitHub
2 changed files with 38 additions and 0 deletions

View File

@@ -590,6 +590,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 - **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_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 - **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) ![Screenshot](https://raw.githubusercontent.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/master/assets/prediction.png)

View File

@@ -14,6 +14,14 @@ class Strategy(Enum):
PERCENTAGE = auto() PERCENTAGE = auto()
SMART_MONEY = auto() SMART_MONEY = auto()
SMART = 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): def __str__(self):
return self.name return self.name
@@ -235,6 +243,12 @@ class Bet(object):
largest = index largest = index
return largest return largest
def __return_number_choice(self, number) -> int:
if (len(self.outcomes) > number):
return number
else:
return 0
def skip(self) -> bool: def skip(self) -> bool:
if self.settings.filter_condition is not None: if self.settings.filter_condition is not None:
# key == by , condition == where # key == by , condition == where
@@ -283,6 +297,22 @@ class Bet(object):
self.decision["choice"] = self.__return_choice(OutcomeKeys.ODDS_PERCENTAGE) self.decision["choice"] = self.__return_choice(OutcomeKeys.ODDS_PERCENTAGE)
elif self.settings.strategy == Strategy.SMART_MONEY: elif self.settings.strategy == Strategy.SMART_MONEY:
self.decision["choice"] = self.__return_choice(OutcomeKeys.TOP_POINTS) 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: elif self.settings.strategy == Strategy.SMART:
difference = abs( difference = abs(
self.outcomes[0][OutcomeKeys.PERCENTAGE_USERS] self.outcomes[0][OutcomeKeys.PERCENTAGE_USERS]