Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. ;---- ---- Winamp Script ---- ----
  2. ;FEATURES: (Default Hotkeys)
  3. ;- Open/Play/Pause (Control+O)
  4. ;- Stop ()
  5. ;- Previous Song (Control+L)
  6. ;- Next Song (Control+P)
  7. ;- Volume Up ()
  8. ;- Volume Down ()
  9. ;- Rewind ()
  10. ;- Fast-Forward ()
  11. ;- Jump To File ()
  12. ;- Now playing: Title Song on LOL chat (Ctrl+shift+c)
  13. #IfWinActive, League of Legends (TM) Client ;The Hotkeys only work if League Of Legends windows is ACTIVE(LOAD SCREEN OR ALREADY PLAYING). IF U WANT THEM TO WORK ALL THE TIME (WHILE AUTOHOTKEY IS OPEN AND RUNNING) JUST DELETE THIS LINE. I JUST ADDED THIS LINE TO PREVENT CONFLICTS WITH OTHER HOTKEYS SOMEONE MAY USE. I STRONGLY SUGGEST THAT THIS LINE SHOULDN'T BE TOUCHED, BECAUSE IT IS ESSENTIAL TO THE PROPER WORK OF THE CURRENT SONG FEATURE
  14.  
  15. {
  16. ; ---- ---- Winamp: Open/Play/Pause ---- ---- (Control+O)
  17. ^O::
  18. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  19.  
  20. Target := "ahk_class Winamp v1.x"
  21.  
  22. IfWinNotExist %Target%
  23. { ; Try to open Winamp if it's not open
  24. Run "D:\Program Files (x86)\Winamp\winamp.exe" ;If u are running LOL and u press the default hotkeys (Ctrl+Numpad5) and winamp is not open it will open winamp and start playing music. This may alt-tab your lol client.
  25. ; WinWait ahk_parent ; This caused problems??
  26. ;Return
  27. WinWait, %Target%
  28. }
  29.  
  30. IfWinNotExist %Target%
  31. { ; Check to make sure we were able to open Winamp
  32. MsgBox Unable to open Winamp
  33. Return
  34. }
  35. ; Winamp is now the last found window - funtions can now implicitly refer to it
  36.  
  37. ; Gets current play status (0=Stopped, 1=Playing, 3=Paused)
  38. SendMessage, 1024, 0, 104 ; IsWinampPlaying?
  39. WinampPlayStatus := ErrorLevel
  40.  
  41. If( WinampPlayStatus == 0 )
  42. { ; Winamp playback in in a 'Stopped' state
  43. ControlSend, ahk_parent, x ; Play
  44. }
  45. else
  46. {
  47. ControlSend, ahk_parent, c ; Pause/Unpause
  48. }
  49. return
  50.  
  51.  
  52. ; ---- ---- Winamp: Previous ---- ---- (Control+L)
  53. ^L::
  54. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  55.  
  56. Target := "ahk_class Winamp v1.x"
  57. IfWinNotExist %Target%
  58. {
  59. Return
  60. }
  61. ControlSend, ahk_parent, z
  62. return
  63.  
  64.  
  65. ; ---- ---- Winamp: Next Song ---- ---- (Control+P)
  66. ^P::
  67. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  68.  
  69. Target := "ahk_class Winamp v1.x"
  70. IfWinNotExist %Target%
  71. {
  72. Return
  73. }
  74. ControlSend, ahk_parent, b
  75. return
  76.  
  77. ; ---- ---- Winamp: Volume Up ---- ---- (Ctrl+Up Arrow Key)
  78. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  79.  
  80. Target := "ahk_class Winamp v1.x"
  81. IfWinNotExist %Target%
  82. {
  83. Return
  84. }
  85. ControlSend, ahk_parent, {up}
  86. return
  87.  
  88.  
  89. ; ---- ---- Winamp: Volume Down ---- ---- (Ctrl+Up Arrow Key)
  90. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  91.  
  92. Target := "ahk_class Winamp v1.x"
  93. IfWinNotExist %Target%
  94. {
  95. Return
  96. }
  97. ControlSend, ahk_parent, {down}
  98. return
  99.  
  100.  
  101. ; ---- ---- Winamp: Rewind ---- ---- (Ctrl+Left Arrow Key)
  102. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  103.  
  104. Target := "ahk_class Winamp v1.x"
  105. IfWinNotExist %Target%
  106. {
  107. Return
  108. }
  109. ControlSend, ahk_parent, {left}
  110. return
  111.  
  112.  
  113. ; ---- ---- Winamp: Fast-Forward ---- ---- (Ctrl+Right Arrow Key)
  114. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  115. Target := "ahk_class Winamp v1.x"
  116. IfWinNotExist %Target%
  117. {
  118. Return
  119. }
  120. ControlSend, ahk_parent, {right}
  121. return
  122.  
  123.  
  124. ; ---- ---- Winamp: Jump To File ---- ---- (Ctrl+Alt+j) (This will ALT+TAB ur LOL Client)
  125. DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
  126.  
  127. Target := "ahk_class Winamp v1.x"
  128. IfWinNotExist %Target%
  129. {
  130. Return
  131. }
  132. ControlSend, ahk_parent, j
  133. return
  134.  
  135.  
  136. ;---------Winamp Get Title To Clipboard And Write it on LOL Chat------------ ()
  137. ; this code requires winamp option "Scrolling Title Text" to be disabled
  138. DetectHiddenWindows, On ; in case minimized to systray
  139. WinGetTitle, CurrentTrack, ahk_class Winamp v1.x
  140. DetectHiddenWindows, Off
  141. If CurrentTrack
  142. {
  143. ; remove the playlist position ('1234. ')
  144. Loop
  145. {
  146. StringMid, ModTrack, CurrentTrack, 1, 1
  147. If ModTrack in 1,2,3,4,5,6,7,8,9,0, ,.
  148. StringTrimLeft, CurrentTrack, CurrentTrack, 1
  149. Else
  150. break
  151. }
  152. ; remove ending ' - Winamp [Stopped]' text etc
  153. StringGetPos, WinampStatus, CurrentTrack, - Winamp
  154. StringMid, WinampStatus, CurrentTrack, %WinampStatus%, StrLen(CurrentTrack)
  155. StringReplace, CurrentTrack, CurrentTrack, %WinampStatus%
  156. }
  157. Else
  158. CurrentTrack := "Winamp is currently not running."
  159.  
  160. aux:="Now playing: "CurrentTrack
  161.  
  162. #InstallKeybdHook
  163. SendMode Event
  164. #UseHook
  165. Send +{Enter}
  166. Sleep 25
  167. Send %aux%
  168. Sleep 25
  169. Send {Enter}
  170. return
  171. }
  172. ;-------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement