Conflicting criteria of minimum balls to resume catch limiter
I am on dev branch.
Something like this happens.
er).
[2017-07-28 17:11:08] Resume time hasn't passed yet, but balls on hand (126) exceeds threshold 100. Re-enabling catch tasks.
[2017-07-28 17:11:08] Balls on hand (126) has reached threshold 150. Disabling catch tasks until 17:21:08 or balls on hand > threshold (whichever is later).
[2017-07-28 17:11:10] Resume time hasn't passed yet, but balls on hand (126) exceeds threshold 100. Re-enabling catch tasks.
[2017-07-28 17:11:10] Balls on hand (126) has reached threshold 150. Disabling catch tasks until 17:21:10 or balls on hand > threshold (whichever is later).
[2017-07-28 17:11:11] Resume time hasn't passed yet, but balls on hand (126) exceeds threshold 100. Re-enabling catch tasks.
[2017-07-28 17:11:11] Balls on hand (126) has reached threshold 150. Disabling catch tasks until 17:21:11 or balls on hand > threshold (whichever is later).
[2017-07-28 17:11:12] Resume time hasn't passed yet, but balls on hand (126) exceeds threshold 100. Re-enabling catch tasks.
[2017-07-28 17:11:12] Balls on hand (126) has reached threshold 150. Disabling catch tasks until 17:21:12 or balls on hand > threshold (whichever is later).
[2017-07-28 17:11:13] Resume time hasn't passed yet, but balls on hand (126) exceeds threshold 100. Re-enabling catch tasks.
[2017-07-28 17:11:13] Balls on hand (126) has reached threshold 150. Disabling catch tasks until 17:21:13 or balls on hand > threshold (whichever is later).
This happens because in catch_limiter.py the criteria to start or stop limit catch is mixed up with resume_at_balls and min_balls.
So in my case when I tried min_balls = 150 and resume_at_balls = 100(default value) catch limit would be initiated because the bot has less than 150 balls, and then the catch limit would be canceled because the bot has more than 100 balls.
This code should use a consistent criteria.
Sanity checks like this are needed in more places I agree. We'll see who comes around to this first. In the mean time, please set your config to something more reasonable :wink:
This is easy to solve... in config, add "resume_at_balls": and a value bigger than 150, say 200.
But seriously.... you don't need to hold so many balls on hand...
He could be saving up some balls for irl play
@davidakachaos I see, documentation has no mention of resume_at_balls, and config example doesn't have it too.
Should add it in.
I think we should use one of the parameters unless there is some special meaning for both values. And i am saving up some balls for my 4YO ;)
@ChiefM3 resume_at_balls is already coded to get from config. Just add it into CatchLimiter task.
I will do a PR to add it into documentation and as well as config example. Thank you.
Okay, I've done some code review of catch_limiter.py.
Currently there are 2 types of logic that activate/deactivate the catch_limiter.
- compare
balls_on_handvsresume_at_ballsOR if time has passed - compare
balls_on_handvsmin_ballsAND if time has passed
The variables resume_at_balls and min_balls are not used in any other parts of the bot, and there seems to be no distinct use between the two values.
So I suggest we combine the logic and parameter into a single one.
Suggestions?
Resume_at is optional, min_balls isn't
@davidakachaos Can I ask why we need two distinct criteria?
min_balls is the setting to disable catching:
Balls on hand (23) has reached threshold 25. Disabling catch tasks until 12:14:33
And the resume_at is for re-enabling the catches when that number is reached prior to the resume time:
All catch tasks disabled until 12:14:33 or balls on hand (30) >= 100
So when the balls on hand reach 100 (in this example) the limiter will resume catching. But you may configure the bot not to use the resume_at limit