Custom Command not working?

I keep getting an invalid variable message when I use my command to set my wins.
So this is what i did,

!commands add !wins Solo’s ( 0 ) - Duo’s ( 0 ) - Squads ( 0 ) - Total Wins ( 0 )
!commands add !setwins -ul=moderator -a=!commands edit !wins Solo’s ( $(0) ) - Duo’s ( $(0) ) - Squads ( $(0) ) - Total Wins ( $(0) )

So what I want !setwins to be able to do is, when I type !setwins 1 1 1 3, It’ll change the solo duo squad and total win counter. So the message that should appear is
Solo’s ( 1 ) - Duo’s ( 1 ) - Squads ( 1 ) - Total Wins ( 3 )

But this is the message I get back when I try to use the !wins command after setting the wins…
Solo’s ( [invalid variable] ) - Duo’s ( [invalid variable] ) - Squads ( [invalid variable] ) - Total Wins ( [invalid variable] )

I don’t understand what I’m doing wrong. Any assistance is greatly appreciated ! :slight_smile:

$(0) is not a valid variable. The arguments variables go from $(1) to $(9). Also, you used $(0) 4 times. The argument variable number should be increased by 1 for each separate argument. You should use $(1), $(2), $(3), and $(4).

So your commands should look like this:

!commands add !wins Solo’s ( 0 ) - Duo’s ( 0 ) - Squads ( 0 ) - Total Wins ( 0 )
!commands add !setwins -ul=moderator -a=!commands edit !wins Solo’s ( $(1) ) - Duo’s ( $(2) ) - Squads ( $(3) ) - Total Wins ( $(4) )

Alternatively, for !setwins, you can use this command, so you don’t have to manually specify the total wins:

!commands add !setwins -ul=moderator -a=!commands edit !wins Solo’s ( $(1) ) - Duo’s ( $(2) ) - Squads ( $(3) ) - Total Wins ( $(eval $(1) + $(2) + $(3)) )

You would just do !setwins 1 1 1.

You are a god amongst men. I appreciate it so much !!

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