TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Randomly open application

    Windows
    3
    5
    223
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AwayShiftA
      AwayShift
      last edited by

      I would like to know how to create a command to randomize and open selected applications, example: I have a command to open some steam games, but individually, I wanted to give a command, the games that I selected one of them would be opened at random.

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @AwayShift
        last edited by

        @AwayShift, you can use a .bat file like this to randomly run one of 5 games.

        set /a num=%random% %%5 +1
        goto %num%
        
        :1
        echo Running game 1
        goto end
        
        :2
        echo Running game 2
        goto end
        
        :3
        echo Running game 3
        goto end
        
        :4
        echo Running game 4
        goto end
        
        :5
        echo Running game 5
        goto end
        
        :end
        
        

        Russell VanderMey

        1 Reply Last reply Reply Quote 1
        • AwayShiftA
          AwayShift
          last edited by

          It worked as I expected, thank you very much. Another question would it be possible for alexa to speak the game she is opening? if there is no way, no problem, it helped me a lot!

          RussR 1 Reply Last reply Reply Quote 0
          • RussR
            Russ @AwayShift
            last edited by Russ

            @AwayShift, yes, you can have Alexa (or Google Assistant) say the name of the game if you use one of the original skills - the ones called TRIGGERcmd or TRIGGER command. In general I like the TRIGGERcmd Smart Home skill better, but it cannot speak the "result" of a command.

            Make each game's section in the .bat file like this:

            :1
            echo Running Call of Duty
            %USERPROFILE%\.TRIGGERcmdData\sendresult.bat "Call of Duty"
            goto end
            

            Set your command's "Voice Reply" field to something like this: Running {{result}}

            Trigger the command via the TRIGGERcmd or TRIGGER command skill like this: "Alexa, ask TRIGGERcmd to run game."

            The skill will reply with, "Running Call of Duty".

            97985985-ea00-44cd-be71-6f0b48fdbeb8-image.png

            Russell VanderMey

            AwayShiftA 1 Reply Last reply Reply Quote 1
            • AwayShiftA
              AwayShift @Russ
              last edited by

              @Russ Perfect, it worked just fine, thank you very much for your help!

              1 Reply Last reply Reply Quote 1
              • First post
                Last post