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.2k stars 640 forks source link

Fix DelayMode.PERCENTAGE behaviour #671

Closed NaJager closed 1 year ago

NaJager commented 1 year ago

When DelayMode.PERCENTAGE is used, the expectation is that when n% of the points submission time for a prediction has elapsed, the bot will make its prediction. The current behaviour however, is that the total duration of a prediction is multiplied by the delay to calculate this. This way, the term 'Percentage' doesn't really make sense, as it acts as a multiplier and not a percentage (see "- PERCENTAGE: Will place the bet when delay percent of the set timer is elapsed" in the docs).

example of current behaviour:

example of behaviour after this fix:

[x] Breaking change (fix or feature that would cause existing functionality not to work as expected) Existing users would need to edit their configuration if they manually devided their percentage by 100 in their run.py. For those that did not manually adjust the percentage the bot would start working as intended.

Simple test is to run a couple of predictions with different submission lengths and seeing what delay the bot outputs to the terminal, and to check if the outputted delay corresponds with delay% of that submission length.

rdavydov commented 1 year ago

I doubt that this can be called a fix. It is not fixing anything.

Basically you just want to replace the representation of 20% in the form of 0.2 with the form of 20. 😉

return prediction_window_seconds * 0.2

=

return prediction_window_seconds * 20 / 100
rdavydov commented 1 year ago

@NaJager BTW it is cool that you are making PRs and contributing to the project, I didn't mean to be arrogant. I just don't think this particular PR is necessary, especially with the breaking changes.

If you are interested in Predictions, now we have a limited support for more than 2 outcomes and the SMART betting strategy needs to be adapted for multiple outcomes. More info here.