Advertisement
jdm001

Updated HS and RL Wait App

Feb 16th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. #NoEnv
  2. SendMode Input
  3. SetWorkingDir %A_ScriptDir%
  4.  
  5. if not A_IsAdmin
  6. {
  7. Run *RunAs "%A_ScriptFullPath%"
  8. ExitApp
  9. }
  10.  
  11. #SingleInstance, Force
  12. SetBatchLines, -1
  13. DetectHiddenWindows, On
  14. SetTitleMatchMode, 2
  15.  
  16. GroupAdd HOOKHS, ahk_class ThunderRT6FormDC
  17. GroupAdd HOOKHS, HyperSpin ; any application with 'HyperSpin' in the title
  18. GroupAdd HOOKHS, HyperSpin.exe
  19.  
  20. GroupAdd HOOKRL, ahk_class CoverFE
  21. GroupAdd HOOKRL, RocketLauncher ; any application with 'RocketLauncher' in the title
  22. GroupAdd HOOKRL, RocketLauncher.exe
  23.  
  24.  
  25. ifWinExist, VLC media player
  26. {
  27. Process, Close, vlc.exe ; prevent double-run of VLC causing conflicts
  28. }
  29.  
  30.  
  31. ; This is the main item we are running, only runs if no other instance
  32. ; and also waits until HyperSpin (ThunderRT6FormDC) is running already
  33. IfWinExist, ahk_class ThunderRT6FormDC
  34. {
  35. run, "VLCPortable.exe" --qt-start-minimized --loop ANArcade81.mp3
  36. }
  37.  
  38.  
  39. ; Now we look for RocketLauncher group, when that is active, we Want
  40. ; everything to shut down automatically.
  41. IfWinExist, ahk_group HOOKRL
  42. {
  43. SplashTextOn, 250, 75, Utility Wheel, Now unloaded!
  44. TrayTip, Utility Wheel Exiting, Closing Ambient Noise for Game Start, 1, 33
  45. Sleep 2000
  46. Process, Close, VLC.exe
  47. Process, Close, VLCPortable.exe
  48. SplashTextOff
  49. ExitApp
  50. }
  51.  
  52. ; Alternatively, we look for HyperSpin group to be minimized/Hidden
  53. ; and then also shut down everything automatically
  54. IfWinNotActive, ahk_group HOOKHS
  55. {
  56. SplashTextOn, 250, 75, Utility Wheel, Now unloaded!
  57. TrayTip, Utility Wheel Exiting, Closing Ambient Noise for Game Start, 1, 33
  58. Sleep 2000
  59. Process, Close, VLC.exe
  60. Process, Close, VLCPortable.exe
  61. SplashTextOff
  62. ExitApp
  63. }
  64.  
  65.  
  66.  
  67. ; But also, at any time, end user can shut down whole process with Tab Key
  68. ; or they can escape the whole program with Escape key too
  69.  
  70. Tab::
  71. DetectHiddenWindows, On
  72. SplashTextOn, 250, 75, Utility Wheel, Ambient Noise Shutting Down.`nOne Moment...
  73. Sleep 1000
  74. Process, Close, VLC.exe
  75. Process, Close, VLCPortable.exe
  76. SplashTextOff
  77. ExitApp
  78. Return
  79.  
  80.  
  81. ; Always have a kill switch
  82. Escape::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement