I want to be able to have nightbot give a random response out of 5 options, with each option having a specifc chance to appear when they use a specific command. I want five responses, starting with one response at 45% chance, next being 25%, then 15% then 10% then 5%. I hope this makes sense.
How can i have each response have a chance of appearing in a single command?
4 replies
that sounds fun... can be done like this...
js$(eval x=Math.floor(Math.random()*100);x<55?(x<30?(x<15?(x<5?`RESPONSE_FIVE`:`RESPONSE_FOUR`):`RESPONSE_THREE`):`RESPONSE_TWO`):`RESPONSE_ONE`)
follows the same pattern u said...
RESPONSE_ONE = 45% chance
RESPONSE_TWO = 25% chance
RESPONSE_THREE = 15% chance
RESPONSE_FOUR = 10% chance
RESPONSE_FIVE = 5% chance