Tkd-Alex / Twitch-Channel-Points-Miner-v2

A simple script that will watch a stream for you and earn the channel points.
GNU General Public License v3.0
1.21k stars 669 forks source link

No bets placed anymore #250

Closed hoak2 closed 3 years ago

hoak2 commented 3 years ago

There are several channels where the script used to place bets in the past, and it doesnt work anymore. Runtime of the bets is always arround 2 minutes. There are less then 400 people in the channels and only a handful of them place a bet.

For each bet I see the similar two lines in my log, but no bet is placed for many many days now. There is no other entry before or after these two lines in regards to this bet event.

I tired to modify the delay to no avail.

Any Idea what I'm doing wrong or is going wrong?

LOG: 12/08/21 16:56:12 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #0 - Received: {"type":"MESSAGE","data":{"topic":"predictions-channel-v1.28868142","message":"{$ 12/08/21 16:56:12 - INFO - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: Place the bet after: 0.78s for: EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, s$ 12/08/21 16:56:13 - INFO - TwitchChannelPointsMiner.classes.Twitch - [make_predictions]: Going to complete bet for EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, streamer=$ 12/08/21 16:56:13 - DEBUG - TwitchChannelPointsMiner.classes.TwitchWebSocket - [send]: #0 - Send: {"type":"PING"}

CONFIG: streamer_settings=StreamerSettings( make_predictions=True, # If you want to Bet / Make prediction follow_raid=True, # Follow raid to obtain more points claim_drops=True, # We can't filter rewards base on stream. Set to False for skip viewing counter increase and you will never obtain a drop reward from this script. Is$ watch_streak=True, # If a streamer go online change the priotiry of streamers array and catch the watch screak. Issue #11 join_chat=True, # Join irc chat to increase watch-time bet=BetSettings( strategy=Strategy.SMART, # Choose you strategy! percentage=5, # Place the x% of your channel points percentage_gap=20, # Gap difference between outcomesA and outcomesB (for SMART stragegy) max_points=5000, # If the x percentage of your channel points is gt bet_max_points set this value stealth_mode=True, # If the calculated amount of channel points is GT the highest bet, place the highest value minus 1-2 points #33 delay_mode=DelayMode.FROM_START, delay=0.8, filter_condition=FilterCondition( by=OutcomeKeys.TOTAL_USERS, # Where apply the filter. Allowed [PERCENTAGE_USERS, ODDS_PERCENTAGE, ODDS, TOP_POINTS, TOTAL_USERS, TOTAL_POINTS] where=Condition.LTE, # 'by' must be [GT, LT, GTE, LTE] than value value=800 ) ) )

Rakambda commented 3 years ago

In the logs search for lines that contains TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'MakePrediction'

hoak2 commented 3 years ago

In the logs search for lines that contains TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'MakePrediction'

No result for "MakePrediction" :/

Rakambda commented 3 years ago

What is the end of that line ? 12/08/21 16:56:13 - INFO - TwitchChannelPointsMiner.classes.Twitch - [make_predictions]: Going to complete bet for EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, streamer=$

If the points are less than 10 then it is normal that the bet isn't placed.

hoak2 commented 3 years ago

What is the end of that line ? 12/08/21 16:56:13 - INFO - TwitchChannelPointsMiner.classes.Twitch - [make_predictions]: Going to complete bet for EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, streamer=$

If the points are less than 10 then it is normal that the bet isn't placed.

$amer(username=oxxx, channel_id=28868xxx, channel_points=31.23k), title=Überlexxxx?)

Rakambda commented 3 years ago

I thought it'd show the points it tries to bet. You can try #251 maybe i'll show a bit better what happens.

hoak2 commented 3 years ago

I'll try that, thanks! Just modified my twitch.py and wait for the next bet event

hoak2 commented 3 years ago

didn't took long

14/08/21 16:53:01 - INFO - [make_predictions]: Going to complete bet for EventPrediction(event_id=326471d5-7a30-4819-8c57-0008a7fa736d, streamer=Streamer(username=worldofwarships, channel_id=182565961, channel_points=2.67k), title=Who will Win on Strait?) 14/08/21 16:53:01 - INFO - [make_predictions]: Bet won't be placed as the amount -1 is less than the minimum required 10

Rakambda commented 3 years ago

Maybe because of the stealth mode? Like if no bets were placed by anyone maybe the lowest bet is interpreted as 0 and so we substract 1~5 from it. Try disabling the stealth mode maybe.

hoak2 commented 3 years ago

image

Rakambda commented 3 years ago

To me the amount can only be negative if stealth is on. Else it'd be 0.

If you add print("AMOUNT BEFORE STEALTH " + str(self.decision["amount"])) at line 277 in Bet.py, i guess it should show 0.

hoak2 commented 3 years ago

In this specific case the highest bet was 36684/30000 and 5% of my points would have been like 133. Seems something is wrong with this function. I'll add this line too and see what happens.

hoak2 commented 3 years ago

14/08/21 19:54:00 - INFO - [on_message]: Place the bet after: 0.78s for: EventPrediction(event_id=05e646ff-c350-420d-8012-da627161ab8f, streamer=Streamer(username=worldofwarships, channel_id=182565961, channel_points=3.63k), title=Who will win on Ring?) AMOUNT BEFORE STEALTH 181 14/08/21 19:54:01 - INFO - [make_predictions]: Going to complete bet for EventPrediction(event_id=05e646ff-c350-420d-8012-da627161ab8f, streamer=Streamer(username=worldofwarships, channel_id=182565961, channel_points=3.63k), title=Who will win on Ring?) 14/08/21 19:54:01 - INFO - [make_predictions]: Bet won't be placed as the amount -1 is less than the minimum required 10

but again, there where enough people betting

Rakambda commented 3 years ago

That issue is quite weird. Especially if the value was 181 almost near the end of the function. Plus it seems like it always try to bet -1, that's weird cause stealth removes between 1 and 5, so I guess it shouldn't be always -1 and vary slightly.

Rakambda commented 3 years ago

If you know a bit python and can use a debugger that'd be your best option to see what's happening. Else can have a print almost everywhere, and try to see where the value gets changed into -1.

Seems like it's in one of these blocks (based on the log you put on L277 and showed value was right there): https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/blob/809c4c9e7e0cba832ac32deea1da87110478b11b/TwitchChannelPointsMiner/classes/entities/Bet.py#L277-L287 https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/blob/809c4c9e7e0cba832ac32deea1da87110478b11b/TwitchChannelPointsMiner/classes/Twitch.py#L408-L419

(The weird part is that only self.outcomes[index][OutcomeKeys.TOP_POINTS] - reduce_amount seems to change the value, maybe self.outcomes[index][OutcomeKeys.TOP_POINTS] is always 0 or something)

Rakambda commented 3 years ago

Well yeah I guess it'd be that self.outcomes[index][OutcomeKeys.TOP_POINTS] has no value as Place the bet after: 0.78s...

You place the bet way too early, there's no top better at this point.

Either put a higher delay so that people have time to place their bets, or don't use the stealth mode.

hoak2 commented 3 years ago

Well yeah I guess it'd be that self.outcomes[index][OutcomeKeys.TOP_POINTS] has no value as Place the bet after: 0.78s...

You place the bet way too early, there's no top better at this point.

Either put a higher delay so that people have time to place their bets, or don't use the stealth mode.

Man you rock, and I feel so stupid wasting your time. I had delay=0.8 with delaymode.from_start instead percentage.