-
Notifications
You must be signed in to change notification settings - Fork 3
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
Subscriber wait time multiplier and !weightednext #39
Subscriber wait time multiplier and !weightednext #39
Conversation
Add test for testing save file update from 2.0 to 2.1
I would like to get some feedback about the message that is displayed when a |
I think it would be a good idea to add the subscriber multiplier to the end of the response of the |
Improve tests Change waiting in entries to a weight function only
This PR adds:
!weightednext
command/order option. This will pick the use with the highest wait time.!list
will now list levels by weighted chance. (only ifweightednext
is present in the levels order)!position
will now show your weighted position. (only ifweightednext
is present in the levels order)!odds
will now show your weight multiplier. (only if it is bigger than 1.0)!odds
and!list
will show<0.1%
if someones chance is more than 0% but would have been rounded to0.0%
and will show>99.9%
if someones chance is less than 100% but would have been rounded to100.0%
.!weightedsubnext
and!weightedsubrandom
variants of!weightednext
and!weightedrandom
respectively, but only picks subscribers.This PR also merges #27, #31, and #35 and fixes #6, and fixes #9.
Configuration:
subscriberWeightMultiplier
to the configuration which can be set to a floating point number bigger than or equal to1.0
. This will multiply the weight for the weighted random chance for subscribers.Bug fixes:
!weightedrandom
the removal of their wait time / weighted random chance was not persisted and only saved to the./data/queue.json
file on the next save.Implementation details:
waitTime
will still be the time users waited in minutes. This value is not influenced by the subscriber multiplierweightMin
which stores the weight of the weighted random chance in minutes. This value will be initialized with thewaitTime
but is influenced by the subscriber multiplier.weightMsec
which stores the weight of the weighted random chance in milliseconds. This is needed because e.g. if the subscriber multiplier is 1.2 then this would add 1 minute and 12000 milliseconds. This value will always be between 0 (inclusive) and 59999 (inclusive).weightMin
+weightMsec
rounded to the nearest minute. E.g. 1 minute and 12000 milliseconds will give a weight of 1, and 9 minutes and 36000 milliseconds will give a weight of 10.!weightednext
will pick the user who is nearer to the top of the queue.devDependencies
have been upgraded to newer versions. Runnpm install
before runningnpm test
, but there is no need to usenpm install
for running the queue itself if it was upgraded from a previous version.