Anyone else having trouble saving a random number in a variable?

This is my command and I don’t know why but it doesn’t return a random number, for the tests I did it always returns the same number.

$(user) lanza el dado de 20 y… $(eval n = Math.floor(Math.random() *20+1);
DN=$(urlfetch json URL);
DP=$(urlfetch json URL);
DC=$(urlfetch json URL);
n <= 2 ? (n + " " + DP[Math.floor(Math.random()*DP.length)]): n >= 19 ? (n + " " + DC[Math.floor(Math.random()*DC.length)]):(n + " " + DN[Math.floor(Math.random()*DN.length)])) $(touser)

Can you provide the outputs of the urlfetch?

Yes the url are like this https pastebin . com/raw/2kwR9V5k from the 3 var

your pastebin is not valid json, so that would be why. use something like https://jsonlint.com/ to test your json is valid.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.