I have programmed a button to act as cool down indicator. When the hotkey is pressed it displays a button showing the letter C indicating cool down, after waiting out the required time, it changes to display B to indicate the skill is ready again.
In addition, I would like to play a sound when it reaches the end of the cool down.
I found some old posts here about using the old outdated windows media player to play sounds via HotKey, but I tried that and there were several problems with it that I could not see how to fix.
I found a small alternative command line sound file player that plays mp3 or wav files named cmdmp3win here:
cmdmp3win
I put the cmdmp3win.exe and a sound file chimes.wav in the same directory and if I type the following at the command line prompt, cmdmp3win chimes.wav - the sound plays fine and there is no gui to try and hide.
I have not been able to get it to work using a HotKey script. It includes several variations to show I tried them. I also tried START, and OPEN instead of RUN.
Is there a way to make this work or an alternative method to play a wav file via a HotKey script?
Thanks,
Script:
- Code: Select all
// Test for BURST WITH cool down indicator
// The button works but sound does not
// CREATE BUTTON AND CHANGE WHEN COOLDOWN IS DONE
// THIS WORKS
<Command AutoExec>
<CreatePanel P1 800 500 65 90>
<CreateButton alpha 800 500 25 25 ON>
<SetButtonstyle alpha colored>
<SetButtonColors alpha 0x7A0707 0xffffff>
<AddButtonToPanel alpha P1>
<TargetWin P1>
<AlwaysOnTop on>
<wait 1100>
<HIDEWIN>
// KEY TO TOGGLE BUTTON ON / OFF
<HOTKEY J>
// <TOGGLE>
<TargetWin P1>
<SetPanelStyle P1 transparent>
<AlwaysOnTop on>
<SHOWWIN>
<sendpc local>
<SetbuttonText alpha C>
<WAIT 3000>
// 3000 IS FOR FAST TESTING, IN GAME IT WOULD BE 15 SECONDS OR SO
<SetbuttonText alpha B>
<RUN cmdmp3win chimes.wav>
<wait 1000>
<RUN E:\PROGRAMS\HotKey\cmdmp3win chimes.wav>
<wait 1000>
<RUN E:\PROGRAMS\HotKey\cmdmp3win E:\PROGRAMS\HotKey\chimes.wav>
// <TOGGLE>
// <TargetWin P1>
// <AlwaysOnTop on>
// <HIDEWIN>
// <CANCEL>
Result:
- Code: Select all
<TargetWin P1> completed: Window found. Target set to 0x310494 "P1"
<SetPanelStyle P1 transparent> completed
<AlwaysOnTop on> completed
<SHOWWIN> completed
<SetbuttonText alpha C> completed
<WAIT 3000> completed: 3000 milliseconds
<SetbuttonText alpha B> completed
<RUN cmdmp3win chimes.wav> failed: Operating system CreateProcess function failed; Windows reports system error 2, "The system cannot find the file specified."
<wait 1000> completed: 1000 milliseconds
<RUN E:\PROGRAMS\HotKey\cmdmp3win chimes.wav> failed: Operating system CreateProcess function failed; Windows reports system error 3, "The system cannot find the path specified."
<wait 1000> completed: 1000 milliseconds
<RUN E:\PROGRAMS\HotKey\cmdmp3win E:\PROGRAMS\HotKey\chimes.wav> failed: Operating system CreateProcess function failed; Windows reports system error 3, "The system cannot find the path specified."