Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;---- ---- Winamp Script ---- ----
- ;FEATURES: (Default Hotkeys)
- ;- Open/Play/Pause (Control+O)
- ;- Stop ()
- ;- Previous Song (Control+L)
- ;- Next Song (Control+P)
- ;- Volume Up ()
- ;- Volume Down ()
- ;- Rewind ()
- ;- Fast-Forward ()
- ;- Jump To File ()
- ;- Now playing: Title Song on LOL chat (Ctrl+shift+c)
- #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
- {
- ; ---- ---- Winamp: Open/Play/Pause ---- ---- (Control+O)
- ^O::
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- { ; Try to open Winamp if it's not open
- 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.
- ; WinWait ahk_parent ; This caused problems??
- ;Return
- WinWait, %Target%
- }
- IfWinNotExist %Target%
- { ; Check to make sure we were able to open Winamp
- MsgBox Unable to open Winamp
- Return
- }
- ; Winamp is now the last found window - funtions can now implicitly refer to it
- ; Gets current play status (0=Stopped, 1=Playing, 3=Paused)
- SendMessage, 1024, 0, 104 ; IsWinampPlaying?
- WinampPlayStatus := ErrorLevel
- If( WinampPlayStatus == 0 )
- { ; Winamp playback in in a 'Stopped' state
- ControlSend, ahk_parent, x ; Play
- }
- else
- {
- ControlSend, ahk_parent, c ; Pause/Unpause
- }
- return
- ; ---- ---- Winamp: Previous ---- ---- (Control+L)
- ^L::
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, z
- return
- ; ---- ---- Winamp: Next Song ---- ---- (Control+P)
- ^P::
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, b
- return
- ; ---- ---- Winamp: Volume Up ---- ---- (Ctrl+Up Arrow Key)
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, {up}
- return
- ; ---- ---- Winamp: Volume Down ---- ---- (Ctrl+Up Arrow Key)
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, {down}
- return
- ; ---- ---- Winamp: Rewind ---- ---- (Ctrl+Left Arrow Key)
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, {left}
- return
- ; ---- ---- Winamp: Fast-Forward ---- ---- (Ctrl+Right Arrow Key)
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, {right}
- return
- ; ---- ---- Winamp: Jump To File ---- ---- (Ctrl+Alt+j) (This will ALT+TAB ur LOL Client)
- DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
- Target := "ahk_class Winamp v1.x"
- IfWinNotExist %Target%
- {
- Return
- }
- ControlSend, ahk_parent, j
- return
- ;---------Winamp Get Title To Clipboard And Write it on LOL Chat------------ ()
- ; this code requires winamp option "Scrolling Title Text" to be disabled
- DetectHiddenWindows, On ; in case minimized to systray
- WinGetTitle, CurrentTrack, ahk_class Winamp v1.x
- DetectHiddenWindows, Off
- If CurrentTrack
- {
- ; remove the playlist position ('1234. ')
- Loop
- {
- StringMid, ModTrack, CurrentTrack, 1, 1
- If ModTrack in 1,2,3,4,5,6,7,8,9,0, ,.
- StringTrimLeft, CurrentTrack, CurrentTrack, 1
- Else
- break
- }
- ; remove ending ' - Winamp [Stopped]' text etc
- StringGetPos, WinampStatus, CurrentTrack, - Winamp
- StringMid, WinampStatus, CurrentTrack, %WinampStatus%, StrLen(CurrentTrack)
- StringReplace, CurrentTrack, CurrentTrack, %WinampStatus%
- }
- Else
- CurrentTrack := "Winamp is currently not running."
- aux:="Now playing: "CurrentTrack
- #InstallKeybdHook
- SendMode Event
- #UseHook
- Send +{Enter}
- Sleep 25
- Send %aux%
- Sleep 25
- Send {Enter}
- return
- }
- ;-------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement