I’m trying to make a command that would allow people to “fight” someone else and a random winner is selected. Something like !whowins Option1 or Option2 , but I want it so that way if my name is one of them then I automatically win (can’t let people get too good right?) So far these are the two commands I have:
!addcom !whowins -a=!check $(eval words = [“Livekey”, “livekey”, “Livekey127”]; response = " "; for(i = 0; i < words.length; i++){if ($(query).indexOf(words[i]) != -1){response = “p”}} response)
and !addcom !check -ul=moderator $(eval if ($(query) === “p”){“Livekey defeats his opponent as always!”} else {"$(1) and $(3) decide to duke it out! Punches are thrown, mothers are insulted, and hell is raised, but when the dust settles $(eval a=["$(1)", “$(3)”];a[ Math.floor(Math.random() * a.length) ]) emerges as the victor!"})
The issue I’m having is that in the second command $(1) and $(3) are supposed to be the names the person types but I keep getting null and can’t figure out a fix.
For the second command: !addcom !check -ul=moderator $(eval var a=["$(1)", "$(3)"]; if ("$(query)" === "p"){ "Livekey defeats his opponent as always!" }else{ "$(1) and $(3) decide to duke it out! Punches are thrown, mothers are insulted, and hell is raised, but when the dust settles " + a[Math.floor(Math.random() * a.length)] + " emerges as the victor!" })
$(eval
if("$(query)" === "")
{
" "
}
else
{
var a=["$(1)", "$(3)"];
var u=["livekey", "livekey", "livekey127"];
if(u.indexOf("$(1)".toLowerCase()) === -1 && u.indexOf("$(3)".toLowerCase()) === -1)
{
"$(1) and $(3) decide to duke it out! Punches are thrown, mothers are insulted, and hell is raised, but when the dust settles " + a[Math.floor(Math.random() * a.length)] + " emerges as the victor!"
}
else
{
"Livekey defeats his opponent as always!"
}
}
)
With these spaces above it will extend the max limit for a command so use this one: $(eval if("$(query)"===""){" "}else{var a=["$(1)","$(3)"];var u=["livekey","livekey","livekey127"];if(u.indexOf("$(1)".toLowerCase())===-1&&u.indexOf("$(3)".toLowerCase())===-1){"$(1) and $(3) decide to duke it out! Punches are thrown, mothers are insulted, and hell is raised, but when the dust settles "+a[Math.floor(Math.random()*a.length)]+" emerges as the victor!"}else{"Livekey defeats his opponent as always!"}})