clawe

Run ETS2 FreeTrack Xpadder

Aug 13th, 2014
281
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Persistent
  2. #SingleInstance, Force
  3. SetTitleMatchMode, RegEx
  4.  
  5. ets2_path := "D:\Steam\steamapps\common\Euro Truck Simulator 2\bin\win_x86\"
  6. freetrack_path := "C:\Program Files (x86)\FreeTrack\"
  7. xpadder_path := "D:\"
  8.  
  9. xpadder:
  10. IfWinExist, ^Xpadder$
  11. {
  12.     sleep, 2000
  13.     goto facetrack
  14. }
  15. else
  16. {
  17.     Run, Xpadder.exe ETS2, %xpadder_path%
  18.     sleep, 2000
  19.     goto facetrack
  20. }
  21.  
  22. facetrack:
  23. IfWinExist, ^FaceTrackNoIR.*ETS2.ini$
  24. {
  25.     sleep, 2000
  26.     goto ets2
  27. }
  28. else
  29. {
  30.     Run, FaceTrackNoIR.exe, %freetrack_path%
  31.     sleep, 2000
  32.     goto ets2
  33. }
  34.  
  35. ets2:
  36. IfWinExist, ^Euro Truck Simulator 2$
  37. {
  38.     sleep, 10000
  39.     goto looping
  40. }
  41. else
  42. {
  43.     Run, eurotrucks2.exe, %ets2_path%
  44.     sleep, 10000
  45.     goto looping
  46. }
  47.  
  48. looping:
  49. Loop
  50. {
  51.     IfWinNotExist, ^Euro Truck Simulator 2$
  52.     {
  53.         Process,close,FaceTrackNoIR.exe
  54.         Process,close,Xpadder.exe
  55.         goto refreshtray
  56.     }
  57. }
  58. return
  59.  
  60. refreshtray:
  61. CoordMode, Mouse, Screen
  62. SendMode Input
  63. WinGetPos,,Ytaskbar,,,ahk_class Shell_TrayWnd
  64. ControlGetPos,Xsystray,,Width,,ToolbarWindow321,ahk_class Shell_TrayWnd
  65. yp:=Ytaskbar+12
  66. maxX:=Xsystray+Width
  67. xp:=Xsystray+5
  68. BlockInput,MouseMove
  69. Loop
  70. {
  71.     if xp > %maxX% break
  72.     MouseMove, %xp%,%yp%,0
  73.     xp:=xp+18
  74.     sleep,1
  75. }
  76. MouseMove, A_ScreenWidth//2, A_ScreenHeight//2
  77. BlockInput,MouseMoveOff
  78. ExitApp
RAW Paste Data