New to Nightbot... Looking to make commands and super new...
1. How do I pick from a list of options like 1 2 3 outcome 2. How can I make one of the options a random number generator ? 3. Can I make one of the options say the user who requested ?
I tried to use the list of variables but I don't see a clear list and how to use them :( Thank you!
3 replies
Quirky Fox
Yes that’s all possible just tell me what you want all the responses to be and how high you want the random numbers to go to.
Jolly Narwhal
Thank you for your help!
I am looking to make 1 - 10 answers possible and still working on the responses. Would it be possible to show me how to write out a command that has 10 possible outcomes that are text and one of the outcomes being: Grug throw (random number 1-10) rocks at Users name.
Is there a better cheat sheet for this type of writing or just ask each time I want to write a command? Thank you!
Quirky Fox
What you want is pretty simple I’ll show you the general format.
$(eval
Random=Math.floor(Math.random()*10+1);
//This is the random number every time you use the command it will make a new number 1-10
//Also after you set something equal to something else put a semicolon at the end of it so it knows where it ends.
Response=[`Response1`,
//Since there’s more responses after this one you put a comma after the backticks.
`Response2`,
`...`,
//Just do this for as many responses you want two back ticks and a comma.
`Response10 ${Random}`];
//This inserts the random number into the response also it has an ending bracket since it’s the last one