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

No bets placed anymore #250

Closed
hoak2 opened this issue Aug 14, 2021 · 16 comments
Closed

No bets placed anymore #250

hoak2 opened this issue Aug 14, 2021 · 16 comments
Labels
bug Something isn't working

Comments

@hoak2
Copy link

hoak2 commented Aug 14, 2021

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
)
)
)

@hoak2 hoak2 added the bug Something isn't working label Aug 14, 2021
@Rakambda
Copy link
Contributor

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

@hoak2
Copy link
Author

hoak2 commented Aug 14, 2021

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

No result for "MakePrediction" :/

@Rakambda
Copy link
Contributor

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
Copy link
Author

hoak2 commented Aug 14, 2021

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
Copy link
Contributor

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
Copy link
Author

hoak2 commented Aug 14, 2021

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

@hoak2
Copy link
Author

hoak2 commented Aug 14, 2021

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
Copy link
Contributor

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
Copy link
Author

hoak2 commented Aug 14, 2021

image

@Rakambda
Copy link
Contributor

Rakambda commented Aug 14, 2021

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
Copy link
Author

hoak2 commented Aug 14, 2021

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
Copy link
Author

hoak2 commented Aug 14, 2021

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
Copy link
Contributor

Rakambda commented Aug 14, 2021

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
Copy link
Contributor

Rakambda commented Aug 14, 2021

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):

if (
self.settings.stealth_mode is True
and self.decision["amount"]
>= self.outcomes[index][OutcomeKeys.TOP_POINTS]
):
reduce_amount = uniform(1, 5)
self.decision["amount"] = (
self.outcomes[index][OutcomeKeys.TOP_POINTS] - reduce_amount
)
self.decision["amount"] = int(self.decision["amount"])
return self.decision

decision = event.bet.calculate(event.streamer.channel_points)
selector_index = 0 if decision["choice"] == "A" else 1
logger.info(
f"Going to complete bet for {event}",
extra={
"emoji": ":four_leaf_clover:",
"color": Settings.logger.color_palette.BET_GENERAL,
},
)
if event.status == "ACTIVE":
skip, compared_value = event.bet.skip()

(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
Copy link
Contributor

Rakambda commented Aug 14, 2021

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
Copy link
Author

hoak2 commented Aug 14, 2021

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.

@hoak2 hoak2 closed this as completed Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants