!fight command using eval abc

Asked Jun 11, 2020·2 replies·Last activity 6 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Does someone know how to make this possible? It's not responding, I'm new with the eval abc. Thanks! ❤

a is the picking of the random winner
b is the weapon used
c is the location
q is the query

!addcom !fight $(eval
a=['$(user)', '$(query)']; responses[Math.floor(Math.random() * responses.length)];);
b=$(urlfetch json https://u.nu/x6ewr).split(";"); responses[Math.floor(Math.random() * responses.length)])
c=$(urlfetch json https://u.nu/34fjt).split(";"); responses[Math.floor(Math.random() * responses.length)]); q=decodeURIComponent($(querystring)); $(query)?$(user) fought ${q} ${c}. $(user) used ${b} and ${q} used ${b}. ${a} won!:❌ !fight someone)

heart.png

2 replies

Hey @Nutty Hippo!

This should fix your issue:

!addcom !fight $(eval u=`$(user)`;t=`$(touser)`;r=[u,t];w=$(urlfetch json https://u.nu/x6ewr).split(`|`);l=$(urlfetch json https://u.nu/34fjt).split(`;`);`$(query)`?`${u} fought ${t} ${l[Math.floor(Math.random()*l.length)]}. ${u} used ${w[Math.floor(Math.random()*w.length)]} and ${t} used ${w[Math.floor(Math.random()*w.length)]}. ${r[Math.floor(Math.random()*2)]} won!`:`:x: !fight someone`;)

Your first paste doesn't use ; (semi-colons), but | (vertical bars) so I fixed that.
Then responses[Math.floor(Math.random() * responses.length)]) must be adapted to the name of the array, in my command r is the random winner array, w is the random weapon array, and l is the random location array.

If you want to use the $(eval) you need to know JavaScript.

Thank you so so so much! You don't know how thankful I'am. 😍

heart_eyes.png