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

Randomly open application

Windows
3
5
242
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.
  • A
    AwayShift
    last edited by Apr 4, 2021, 2:02 PM

    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.

    R 1 Reply Last reply Apr 4, 2021, 9:10 PM Reply Quote 0
    • R
      Russ @AwayShift
      last edited by Apr 4, 2021, 9:10 PM

      @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
      • A
        AwayShift
        last edited by Apr 4, 2021, 11:46 PM

        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!

        R 1 Reply Last reply Apr 5, 2021, 12:06 AM Reply Quote 0
        • R
          Russ @AwayShift
          last edited by Russ Apr 5, 2021, 12:08 AM Apr 5, 2021, 12:06 AM

          @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

          A 1 Reply Last reply Apr 5, 2021, 11:48 PM Reply Quote 1
          • A
            AwayShift @Russ
            last edited by Apr 5, 2021, 11:48 PM

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

            1 Reply Last reply Reply Quote 1
            5 out of 5
            • First post
              5/5
              Last post