Command getting information from another command

Iโ€™m working on an easy to use command for a death counter. I just canโ€™t wrap my head around it and Iโ€™m a bit stuck.

What I want to happen is !setdeaths to count the amount of deaths, and !deaths to print that amount with some fancy text. I donโ€™t know if this is somehow possible.

!addcom !setdeaths $(count)
!addcom !deaths ๐Ÿ’€ [...] Deaths so far ๐Ÿ’€

I want to prevent that moderators need to change the count manually with a command like this:

!editcom !deaths ๐Ÿ’€ 10 Deaths so far ๐Ÿ’€

You have your !deaths command:

!commands add !deaths ๐Ÿ’€ 0 Deaths so far ๐Ÿ’€

Then you create a command that will edit the deaths command with a count variable:

!commands add !setdeaths -ul=mod -a=!commands edit !deaths ๐Ÿ’€ $(count) Deaths so far ๐Ÿ’€

Feel free to change the names or do any modifications that you want. If you want people to be able to input a number instead of using a counter then replace $(count) with $(1) in !setdeaths

I thought about that but wouldnโ€™t that change the !deaths command to count when it is used, and basically do the next:

!deaths
:skull: 10 Deaths so far :skull:
!deaths
:skull: 11 Deaths so far :skull:

Like I said in the first post I made: I want to prevent that moderators need to manual enter the number the streamer died. So using $(1) is not an option for that.

No, it wonโ€™t do that because the $(count) is not tied to !deaths its tied to !setdeaths. When !setdeaths is ran the $(count) is replaced with the numerical value for the count, editing !deaths with the value. Allowing !deaths to be ran any number of times without the number changing.

Here is a screenshot of adding and testing it: https://i.imgur.com/EIaHKcr.png

Nice, thank you very much for your help Rick. I appreciate it a lot.

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