Skip to content

Commit 28d881a

Browse files
authored
Merge pull request #454 from honomoa/feature/strategy_number
Add strategy NUMBER_X
2 parents 06c6555 + a353c0c commit 28d881a

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,14 @@ Allowed values for `chat` are:
590590
- **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
591591
- **SMART_MONEY**: Select the option with the highest points placed. [#331](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/331)
592592
- **SMART**: If the majority in percent chose an option, then follow the other users, otherwise select the option with the highest odds
593+
- **NUMBER_1**: Always select the 1st option, BLUE side if there are only two options
594+
- **NUMBER_2**: Always select the 2nd option, PINK side if there are only two options
595+
- **NUMBER_3**: Always select the 3rd option.
596+
- **NUMBER_4**: Always select the 4th option.
597+
- **NUMBER_5**: Always select the 5th option.
598+
- **NUMBER_6**: Always select the 6th option.
599+
- **NUMBER_7**: Always select the 7th option.
600+
- **NUMBER_8**: Always select the 8th option.
593601

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

TwitchChannelPointsMiner/classes/entities/Bet.py

+30
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class Strategy(Enum):
1414
PERCENTAGE = auto()
1515
SMART_MONEY = auto()
1616
SMART = auto()
17+
NUMBER_1 = auto()
18+
NUMBER_2 = auto()
19+
NUMBER_3 = auto()
20+
NUMBER_4 = auto()
21+
NUMBER_5 = auto()
22+
NUMBER_6 = auto()
23+
NUMBER_7 = auto()
24+
NUMBER_8 = auto()
1725

1826
def __str__(self):
1927
return self.name
@@ -235,6 +243,12 @@ def __return_choice(self, key) -> int:
235243
largest = index
236244
return largest
237245

246+
def __return_number_choice(self, number) -> int:
247+
if (len(self.outcomes) > number):
248+
return number
249+
else:
250+
return 0
251+
238252
def skip(self) -> bool:
239253
if self.settings.filter_condition is not None:
240254
# key == by , condition == where
@@ -283,6 +297,22 @@ def calculate(self, balance: int) -> dict:
283297
self.decision["choice"] = self.__return_choice(OutcomeKeys.ODDS_PERCENTAGE)
284298
elif self.settings.strategy == Strategy.SMART_MONEY:
285299
self.decision["choice"] = self.__return_choice(OutcomeKeys.TOP_POINTS)
300+
elif self.settings.strategy == Strategy.NUMBER_1:
301+
self.decision["choice"] = self.__return_number_choice(0)
302+
elif self.settings.strategy == Strategy.NUMBER_2:
303+
self.decision["choice"] = self.__return_number_choice(1)
304+
elif self.settings.strategy == Strategy.NUMBER_3:
305+
self.decision["choice"] = self.__return_number_choice(2)
306+
elif self.settings.strategy == Strategy.NUMBER_4:
307+
self.decision["choice"] = self.__return_number_choice(3)
308+
elif self.settings.strategy == Strategy.NUMBER_5:
309+
self.decision["choice"] = self.__return_number_choice(4)
310+
elif self.settings.strategy == Strategy.NUMBER_6:
311+
self.decision["choice"] = self.__return_number_choice(5)
312+
elif self.settings.strategy == Strategy.NUMBER_7:
313+
self.decision["choice"] = self.__return_number_choice(6)
314+
elif self.settings.strategy == Strategy.NUMBER_8:
315+
self.decision["choice"] = self.__return_number_choice(7)
286316
elif self.settings.strategy == Strategy.SMART:
287317
difference = abs(
288318
self.outcomes[0][OutcomeKeys.PERCENTAGE_USERS]

0 commit comments

Comments
 (0)