Announcement

Collapse
No announcement yet.

Connect to SkyTrak and launch TGC with keyboard shortcuts?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connect to SkyTrak and launch TGC with keyboard shortcuts?

    Is there a way to invoke a keyboard command to connect the ST to the TGC interface and use another keyboard command to launch TGC?

    Rather than using a mouse and keyboard, it would be nice to be able to use voice attack to connect the ST to the TGC interface and have it issue keyboard commands. Then I would be able to launch the game using my voice rather than sitting at the computer and manually clicking it.

    Nice to have but not really necessary =D

  • #2
    In case anyone was wondering....I figured out how to achieve this using AutoHotKeys
    I can launch TGC with a voice command using Voice attack and AutoHotKeys now.

    Comment


    • Diceberg
      Diceberg commented
      Editing a comment
      What were the hotkeys you ended up setting?

    • arwin
      arwin commented
      Editing a comment
      See post below

    • arwin
      arwin commented
      Editing a comment
      See post below

  • #3
    Funny. I used to be a champ at scripting for autohotkeys 10+ years ago. I dusted off my old skills, and tried to create single exe launch, discovery and connection of TGC2019, but could not figure it out. I tried to click the mouse at some xy location, and it wouldn't read so I gave up ... for now.

    Comment


    • #4
      This was the script that I used for AutoHotKeys

      Save this script as LaunchSimulator.ahk

      ^!l::
      TGCTitle = SkyTrak TGC 1.45
      run "C:\Users\AppData\Local\Skytrak Interface\SkytrakTGC.exe", , max
      ; Wait 5 seconds for TGC Interface to load
      WinWait, %TGCTitle%, , 5
      if ErrorLevel
      {
      MsgBox, TGC Loading Timed Out
      return
      }
      WinActivate, %TGCTitle%
      ; Move Mouse to Connect to Box location
      MouseMove, 650, 150
      ; Click Connect to Box
      MouseClick
      ; Wait for ST to connect - 10 seconds
      Sleep 10000
      ; Move Mouse to Play Game loction
      MouseMove, 750, 510
      ; Click on Play Game
      MouseClick
      return

      A couple of notes:
      1. Download and install the AutoHotKeys program
      2. Change the location of the run command to where you have the ST TGC exe
      3. Copy the script and save it as a .ahk file but make sure the text editor that you use does not append a .txt or extension on it. I used the EditPlus text editor
      4. Place the AutoHotKey script in the same folder as where your ST TGC exe exists, when I had the scripts in another location, it would connect the box but the "Play Game" would never activate. There are some supporting files in that folder that enable the Play Game button, but when the script runs in another folder, it can't find those supporting files
      5. Run the scripts before attempting the Hot Keys. You will see a green H in the bottom right system tray if it's running.
      6. You can create a batch file and place it in the windows start folder so that you can have the script running when the computer starts up (The path to that folder would be: D|C]:\Profiles\{User}\‌​AppData\Roaming\Micro‌​soft\Wi ndows\Start Menu\Programs\Startu‌​p)
      7. The AutoHotKey command that I used was CTRL+ALT+L, as indicated by ^!l:: in the script.
      8. You can combine this with VoiceAttack to simulate you pressing CTRL+ALT+L....I have mine set to "Launch Simulator" and VoiceAttack would send the CTRL+ALT+L command and it would automatically connect and launch TGC
      9. The script assumes that it only takes 10 seconds to connect to the ST. If it doesn't connect in time, it will try to click on the Play Game button which isn't enabled yet....which will do nothing. I have my ST connected by USB so it doesn't take that long. I could probably reduce the wait time to about 5 or 6 seconds.
      10. In the event that it takes longer than expected to connect to the ST and something didn't work, I created 2 more AutoHotKey scripts to go through the process again. I used CTRL+ALT+S for connect to ST and CTRL+ALT+T for Run TGC. Supporting scripts below

      Save this script as ConnectST.ahk - Executes with CTRL+ALT+S

      ^!s::
      TGCTitle = SkyTrak TGC 1.45
      WinActivate, %TGCTitle%
      MouseMove, 650, 150
      MouseClick
      return

      Save this script as RunTGC.ahk - Executes with CTRL+ALT+T
      ^!t::
      TGCTitle = SkyTrak TGC 1.45
      WinActivate, %TGCTitle%
      MouseMove, 750, 510
      MouseClick
      return

      Batch file to auto load the scripts on startup - Place in this folder: [D|C]:\Profiles\{UserName}\‌​AppData\Roaming\Micro‌​sof t\Windows\Start Menu\Programs\Startu‌​p
      - Replace file path to proper file path according to your computer

      cd C:\Users\{UserName}\AppData\Local\Skytrak Interface
      start ConnectST.ahk
      start RunTGC.ahk
      start LaunchSimulator.ahk

      Comment


      • GungHoGolf
        GungHoGolf commented
        Editing a comment
        Quality post here, thank you!

      • Morini
        Morini commented
        Editing a comment
        Thank you. Don't know where I went wrong. Gave it two hours, which is more than I would have saved in two years of daily play, lol.

    • #5
      Good post. We use AHK at the office when installing software unattended. It can be a little challenging at times depending on how the software you're trying to control is written (Windows controls, names, etc)

      Comment


      • arwin
        arwin commented
        Editing a comment
        Yeah. The hardest part was to find the proper title of the window to activate it. lol

      • Morini
        Morini commented
        Editing a comment
        Yes, I used it frequently in the past. I made a script once at my old job that saved me about 5 minutes per day. I shared it with a colleague who shared it with others until over 100 people saved 5 minutes per day. It was appreciated. Then as often happens, some minor update broke the script, and people treated me like tech support and came to complain endlessly. I updated the script of course ... but never shared it again.

      • Cruisin1966
        Cruisin1966 commented
        Editing a comment
        Ha ha, no good deed goes unpunished. I know this all too well at my job.

    • #6
      Sorry to bring up this old thread. I am going to use autohotkey to do some cool things, and will share when done. However, as I mentioned above, I couldn't get it to work myself in the past, and arwin's script doesn't work either. My mouse simply can't be moved with AHK. Arwin, any ideas?

      Comment


      • #7
        Are your scripts running?
        You should see the green H in your system tray if it is.

        I'd also recommend doing something really simple to ensure that the hot key is working and something is being executed when you type the hot keys first.

        Comment


        • #8
          Yes, script runs, H is there. The interface opens and then it sits there until "TGC Loading Timed Out" message comes up. When I tried making my own the script a few months ago, I could not get the mouse to move. I am wondering what causes AHK to be unable to control the mouse on my particular computer.

          Comment


          • #9
            Hmm...I'm not really sure.
            The run command opens the ST interface but the mouse won't move at all?
            Does it activate the ST interface window? (as in, is it the window that is in focus?)

            Comment

            Working...
            X