!fight command using eval abc

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

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)

Hey @With_Vince!

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.

1 Like

Thank you so so so much! You don’t know how thankful I’am. :heart_eyes:

1 Like

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