newer Posted November 6, 2014 Posted November 6, 2014 Thanks, it uses Windows Vista Audio Library that was introduced with Vista, so no. It can be converted to work with SoundGet and SoundSet (which is a lot slower), but not on my todo list as I won't ever touch XP again. Hallo and gratulation to this top ap. is there now a chance to work your programm with XP....??
rfancella Posted November 6, 2014 Posted November 6, 2014 You got it! Sent from my Samsung Note 4 via Tapatalk Ok, so this is as far as I got. I created a file called "3rdPartyToolPaths.ini" and put it in the ...\HyperLaunch\Lib folder. There I put my WinIPac and IdleVolumeAdjuster path, along with what I want it to do and a list of the systems. Give three options for IdleVol, No, Yes & Kill. The script will do nothing if set to no. Yes will make it pause and resume. Kill will (eventually) kill the program and restart it when done. There is still much to do in it, but am I on the right path? 3rdPartyToolsPaths.ini: [WinIPAC] # WinIPACPath = Path and exe for your WinIPAC program # WinIPACProfileDir = The directory that has your default and system and/or game based IPac profiles WinIPACPath = H:\WinIPAC\WinIPAC.exe WinIPACProfileDir = H:\HyperLaunch\IPacProfiles [idleVolAdjust] # IdleVolPath = Path and exe for IdleVolumeAdjuster.exe # IdleVolUse = No, Yes or Kill # IdleVolSystems = List of systems to use this script on. Please use the full name of the system seperated by commas IdleVolPath = H:\HyperLaunch\IdleVolumeAdjuster.exe IdleVolUse = Kill IdleVolSystems = PopCap,ScummVM,WoW Action Max User Functions.ahk: ; Use this function to define any code you want to run in every module on start StartGlobalUserFeatures(){ Global systemName, romName, WinIPACPath, WinIPACProfileDir, changedIPacProfile, settingsFile, IdleVolPath, IdleVolUse Log("StartGlobalUserFeatures - Starting") settingsFile := A_ScriptDir . "\Lib\3rdPartyToolsPaths.ini" Log("3rdPartyTools - Ini file location " . settingsFile, 5) Log("WinIPAC - Start IPac System Profile Test") WinIPACPath := IniReadCheck(settingsFile, "WinIPAC", "WinIPACPath",A_ScriptDir . "\WinIPAC\WinIPAC.exe",,1) WinIPACProfileDir := IniReadCheck(settingsFile, "WinIPAC", "WinIPACProfileDir",A_ScriptDir . "\IPACProfiles",,1) If !(FileExist(WinIPACPath)) { Log("WinIPAC - The file WinIPAC.exe does not exist at " . WinIPACPath . ". Please check your paths!",3) } else { If !(FileExist(WinIPACProfileDir . "\" . "default.ipc")){ Log("WinIPAC - IPac required Default Profile not found at " . WinIPACProfileDir . "\" . "default.ipc",5) Return } else { Log("WinIPAC - Default profile found: " . WinIPACProfileDir . "\" . "default.ipc",5) changedIPacProfile := LoadIPacProfile() } } Log("WinIPAC - Stop IPac System Profile Test") Log("IdleVolAdjust - Start IdleVolAdjust Section") IdleVolPath := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolPath",A_ScriptDir . "\IdleVolumeAdjuster.exe",,1) IdleVolUse := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolUse","No",,1) IdleVolSystems := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolSystems","",,1) If !(FileExist(IdleVolPath)) { Log("IdleVolAdjust - Exe NOT located at " . IdleVolPath . ". Please check your paths", 5) IdleVolUse := "No" } else { IfInString, IdleVolSystems, %systemName% { Log("IdleVolAdjust - " . systemName . " System found in IdleVolSystems list", 5) If (IdleVolUse = "Yes") { Log("IdleVolAdjust - Running IdleVolumeAdjuster pause with """ . IdleVolPath . " pause""", 5) Run, % IdleVolPath . " pause",,UseErrorLevel,OutputVarPID } else If (IdleVolUse = "Kill") { Log("IdleVolAdjust - Running IdleVolumeAdjuster Kill with """ . IdleVolPath . " Kill""", 5) Log("IdleVolAdjust - Trying to detect if program is running.",5) Process, Exist, IdleVolumeAdjuster.exe IdleVolPID = %ErrorLevel% Log("IdleVolAdjust - IdleVolPID = " . IdleVolPID,5) If IdleVolPID = 0 { Log("IdleVolAdjust - Process does not exist. Not stopping the process and it will not be restarted.", 5) IdleVolUse := "No" } else { Log("IdleVolAdjust - Attempting to stop Idle Volume Adjuster with a PID of " . IdleVolPID,5) Process, Close, %IdleVolPID% CloseIdleVolPID = %ErrorLevel% Log("IdleVolAdjust - Close process ErrorLevel - " . CloseIdleVolPID,5) If (IdleVolPID = CloseIdleVolPID) { Log("IdleVolAdjust - Process closed OK.",5) } else { Log("IdleVolAdjust - Process not closed. Will not restart.",5) IdleVolUse := "No" } } } } else { Log("IdleVolAdjust - " . systemName . " System Not found in IdleVolSystems list :" . IdleVolSystems, 5) IdleVolUse := "No" } } Log("IdleVolAdjust - Stop IdleVolAdjust Section") Log("StartGlobalUserFeatures - Ending") } LoadIPacProfile(){ Global systemName, romName, WinIPACPath, WinIPACProfileDir IPacPath1 := WinIPACProfileDir . "\" . systemName . "\" . romName . ".ipc" IPacPath2 := WinIPACProfileDir . "\" . systemName . ".ipc" Loop, 2 { if FileExist(IPacPath%a_index%) { Log("WinIPAC - Loading IPAC profile: " . IPacPath%a_index%, 5) Run, % WinIPACPath . " " . IPacPath%a_index%,,UseErrorLevel,OutputVarPID Process, WaitClose, %OutputVarPID%, 5 IPacPID = ErrorLevel Log("WinIPAC - WinIPAC PID: " . OutputVarPID . " Error Level: " . ErrorLevel, 5) ;11:55:54 AM | Title/Class: WinIPAC - Downloading ahk_class ThunderRT6FormDC is now active If (ErrorLevel > 0){ ScriptError("Your IPac failed to program. Make sure the IPac is connected and try again. You may need to reboot your computer and try again.") } else { Log("WinIPAC - IPAC profile was loaded.",5) Return true } } else { Log("WinIPAC - IPac profile " . IPacPath%a_index% . " not found.",5) } } } ; Use this function to define any code you may need to stop or clean up in every module on exit StopGlobalUserFeatures(){ Global WinIPACPath, WinIPACProfileDir, changedIPacProfile, IdleVolPath, IdleVolUse Log("StopGlobalUserFeatures - Starting") Log("WinIPAC - Start IPac Profile Restore") If (changedIPacProfile){ RunWait, % WinIPACPath . " " . WinIPACProfileDir . "\" . "default.ipc",,UseErrorLevel,OutputVarPID If (ErrorLevel > 0){ ScriptError("Your IPac failed to restore. Your default IPac profile was not programmed.") } else { Log("WinIPAC - Default IPac profile has been restored.",5) Return } } else { Log("WinIPAC - Alternative IPac profile not used. No need to restore.") } Log("WinIPAC - Stop IPac Profile Restore") Log("IdleVolAdjust - Start IdleVolAdjust resume section") If (IdleVolUse = "Yes") { Log("IdleVolAdjust - Running IdleVolumeAdjuster resume with """ . IdleVolPath . " resume""", 5) Run, % IdleVolPath . " resume",,UseErrorLevel,OutputVarPID } else If (IdleVolUse = "Kill") { Log("IdleVolAdjust - Running IdleVolumeAdjuster restart from Kill with """ . IdleVolPath . """", 5) Run, % IdleVolPath,,UseErrorLevel,OutputVarPID } else { Log("IdleVolAdjust - Not adjusting volume. IdleVolUse set to: " . IdleVolUse, 5) } Log("IdleVolAdjust - Stop IdleVolAdjust resume section") Log("StopGlobalUserFeatures - Ending") } Your thoughts? And, how do I detect and attempt to close the program? I tried: IfWinExist, Idle Volume Adjuster v1.4 (by djvj) { Log("IdleVolAdjust - Attempting to close Idle Volume Adjuster", 5) WinClose, Idle Volume Adjuster v1.4 (by djvj) } But that didn't work. I edited this post with a working script. The Volume Idle Adjuster part of the script works great! The WinIPac part is still a WIP. It works, but does no proper error detection. And it's on another thread. Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
rfancella Posted November 25, 2014 Posted November 25, 2014 You got it! Sent from my Samsung Note 4 via Tapatalk Djvj, How can I, in ahk, detect and close Idle Volume Adjuster? I almost have the above script done, but cannot detect and kill the process. Thanks, Ron EDIT: Got it! Used Process, Exist, IdleVolumeAdjuster.exe Got the ErrorLevel as a PID and then: Process, Close, PID Sweet! Now to post the completed script when I finish all the logging and error checks. Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
rfancella Posted November 26, 2014 Posted November 26, 2014 Ok, for those out there interested. The script in post #52 works fine now. There is lots of error checking, probably too much... Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
ninja2bceen Posted November 27, 2014 Posted November 27, 2014 great job, works perfect! whats a winipac program? The goal for me is to have the volume editor do its thing EXCEPT for when I'm watching a movie via xbmc. I added the system name like you told us and its great note that the user function ahk has the code copied twice. It wouldn't run any game for me until I deleted the other half. I think it restarted on line 126. I kept getting a pop up stating that it was a duplicate. Since the edit, this is pretty much amazing and worked out of the box err a download Advance the cause to 100%. http://hyperbase.hyperspin-fe.com/ Planet Geekdom, Subscribe for Tutorials! https://www.youtube.com/channel/UCdcby-s2GwriaOHGmVC2vGA?sub_confirmation=1&app=desktop
rfancella Posted November 27, 2014 Posted November 27, 2014 great job, works perfect! whats a winipac program? The goal for me is to have the volume editor do its thing EXCEPT for when I'm watching a movie via xbmc. I added the system name like you told us and its great note that the user function ahk has the code copied twice. It wouldn't run any game for me until I deleted the other half. I think it restarted on line 126. I kept getting a pop up stating that it was a duplicate. Since the edit, this is pretty much amazing and worked out of the box err a download Thank you. Yes, there was a duplicate section in there. I edited the post and fixed it. I plan on making one additional change. I detect if the program is running only in one section. I am going to move it up, so if the program is not running, it will do nothing. WinIPac is the program to program your IPac. It's a keyboard encoder made by Ultimarc: http://www.ultimarc.com/ipac1.html Look for the last change next week. Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
ninja2bceen Posted December 13, 2014 Posted December 13, 2014 What changes need to be made here? Advance the cause to 100%. http://hyperbase.hyperspin-fe.com/ Planet Geekdom, Subscribe for Tutorials! https://www.youtube.com/channel/UCdcby-s2GwriaOHGmVC2vGA?sub_confirmation=1&app=desktop
Turranius Posted December 13, 2014 Posted December 13, 2014 This app doesn't work for me when using a mouse. The voulume goes down even when playing. So this workaround would be great for me. Same here. Mouse movement still kicks in the idle and does not resume the volume afterwards. Standard USB mouse really. This is an autoit script, correct? I created a "disable screensaver" script a while back that checks the mouse cursor position. If it does not move for 9 minutes, move it 1 pixel up and down again, to prevent screensaver to kick in. Perhaps it could be useful for you? Or perhaps you just need the idea =) Check cursor position as curpos. Sleep the desired amount of time. Check cursor position. Match it with curpos. If its the same, you're idle. If not the same position, save location as curpos repeat Edit: Ah. AHK. Should be the same procedure though I guess. Mame related stuff: FTP: grandis.nu, port 21, user:misc, pass:misc http://grandis.nu/software Tur-Matcher - Match your roms/media/XML files. Another Idle Volume Adjuster - Automatically control the volume. How to: Use MAME Extras as material for HyperPause How to: Use eXoDOS 2.0 as material for HyperPause
Dime333 Posted December 13, 2014 Posted December 13, 2014 Same here. Mouse movement still kicks in the idle and does not resume the volume afterwards. This is an autoit script, correct? I created a "disable screensaver" script a while back that checks the mouse cursor position. If it does not move for 9 minutes, move it 1 pixel up and down again, to prevent screensaver to kick in. Perhaps it could be useful for you? Or perhaps you just need the idea =) Check cursor position as curpos. Sleep the desired amount of time. Check cursor position. Match it with curpos. If its the same, you're idle. If not the same position, save location as curpos repeat I didn't understand much of that, put I could try your script out and see if it fixes my poblem.
Turranius Posted December 13, 2014 Posted December 13, 2014 That was ment for djvj, but I guess, since I just saw who created this, the point is moot since djvj knows what hes doing =) Mame related stuff: FTP: grandis.nu, port 21, user:misc, pass:misc http://grandis.nu/software Tur-Matcher - Match your roms/media/XML files. Another Idle Volume Adjuster - Automatically control the volume. How to: Use MAME Extras as material for HyperPause How to: Use eXoDOS 2.0 as material for HyperPause
Dime333 Posted December 13, 2014 Posted December 13, 2014 That was ment for djvj, but I guess, since I just saw who created this, the point is moot since djvj knows what hes doing =) OK.
Turranius Posted December 13, 2014 Posted December 13, 2014 Dime333: I made two test scripts in autoit you may test for me. Currently they only mute and unmute (no fading, I can add that later with config etc if it works for you). ftp://misc:[email protected]/Hyperspin/Testing/ The traydebug version should mute after 30 seconds and show in the traybar what its doing all the time. The other one should mute after 60 seconds. No texts or otherwise. Let me know if this works better and worth working on. Rough source #include <Timers.au3> Global $iLimit = 60 ; idle limit in seconds Global $Mute = "OFF" ;HotKeySet("{ESC}", "_Quit") ; Make sure mute is off send("{VOLUME_DOWN}") send("{VOLUME_UP}") While 1 Sleep(1000) If $Mute = "OFF" Then _CheckIdleTimeMute() Else _CheckIdleTimeUnMute() EndIf WEnd Func _CheckIdleTimeMute() ;TrayTip("MuteFunction (Mute at: " & $iLimit * 1000 & " ms)", "Current idle time: " & _Timer_GetIdleTime() & " ms", 1) If _Timer_GetIdleTime() > $iLimit * 1000 Then send("{VOLUME_MUTE}") $Mute = "ON" EndIf EndFunc ;==>_CheckIdleTime Func _CheckIdleTimeUnMute() ;TrayTip("MuteFunction", "Unmute on action. Current idle time: " & _Timer_GetIdleTime() & " ms", 1) If _Timer_GetIdleTime() < 1000 Then send("{VOLUME_DOWN}") send("{VOLUME_UP}") $Mute = "OFF" EndIf EndFunc ;==>_CheckIdleTime Func _Quit() Exit EndFunc ;==>_Quit Mame related stuff: FTP: grandis.nu, port 21, user:misc, pass:misc http://grandis.nu/software Tur-Matcher - Match your roms/media/XML files. Another Idle Volume Adjuster - Automatically control the volume. How to: Use MAME Extras as material for HyperPause How to: Use eXoDOS 2.0 as material for HyperPause
Dime333 Posted December 13, 2014 Posted December 13, 2014 I tested both scripts and they are working great. If you could make it possible to set the time for it be activated, set the volume that it goes down to and add fade, I'd defenately want to add it to my setup.
rfancella Posted December 13, 2014 Posted December 13, 2014 I tested both scripts and they are working great. If you could make it possible to set the time for it be activated, set the volume that it goes down to and add fade, I'd defenately want to add it to my setup. The initial volume and reduced volume as well as rate, i believe are all adjustamle in the program and not the script. My script is just to either pause the exe or kill it and restart it mased on the system launched. That way you can disable the limiter for mouse systems only. Sounds like what you want can be accomplished within the exe. Or maybe I dont understand? Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
Dime333 Posted December 13, 2014 Posted December 13, 2014 Sorry, Ron. My comment was for Turranius. Post #62.
Turranius Posted December 13, 2014 Posted December 13, 2014 We should make our own thread, but I'll write one last thing here =) I have a problem. There is no way to detect the current volume so lowering the volume to, say, 25%, is very hard when I have no idea what it is set for to begin with. We have three options. Volume goes from 0 (silent) to 100 (highest) in Windows. Option1: At start, set the volume to maximum by sending "Volume UP" 100 times. If you then say that you want it at 25% during idle, I just lower the volume 75 times. Option2: In the config, you decide what you want the start volume to be (0-100). I then lower it 100 times to make sure its 0, then up it until it reaches the value you defined. Option3: We dont touch current volume. Then, you can not specify 25% as idle volume, but set "how many points to lower it during idle" instead. If your volume at start is 60% in windows and you've defined that you want it lowered 30 points during idle, it will go to 30. If the volume at startup is 100 in Windows, it will go to 70. Not sure which is best... Perhaps all of them, optional. In any case, I'll do my best in the next two days to bring something together and start my own thread instead of hijacking this one =) Mame related stuff: FTP: grandis.nu, port 21, user:misc, pass:misc http://grandis.nu/software Tur-Matcher - Match your roms/media/XML files. Another Idle Volume Adjuster - Automatically control the volume. How to: Use MAME Extras as material for HyperPause How to: Use eXoDOS 2.0 as material for HyperPause
Dime333 Posted December 13, 2014 Posted December 13, 2014 We should make our own thread, but I'll write one last thing here =)I have a problem. There is no way to detect the current volume so lowering the volume to, say, 25%, is very hard when I have no idea what it is set for to begin with. We have three options. Volume goes from 0 (silent) to 100 (highest) in Windows. Option1: At start, set the volume to maximum by sending "Volume UP" 100 times. If you then say that you want it at 25% during idle, I just lower the volume 75 times. Option2: In the config, you decide what you want the start volume to be (0-100). I then lower it 100 times to make sure its 0, then up it until it reaches the value you defined. Option3: We dont touch current volume. Then, you can not specify 25% as idle volume, but set "how many points to lower it during idle" instead. If your volume at start is 60% in windows and you've defined that you want it lowered 30 points during idle, it will go to 30. If the volume at startup is 100 in Windows, it will go to 70. Not sure which is best... Perhaps all of them, optional. In any case, I'll do my best in the next two days to bring something together and start my own thread instead of hijacking this one =) OK. Good luck with this.
rfancella Posted December 14, 2014 Posted December 14, 2014 Sorry, Ron. My comment was for Turranius. Post #62. Ok, cool. My bad. Hard to tell because many people dont use the quote option. :eek: Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
ninja2bceen Posted December 14, 2014 Posted December 14, 2014 Rfan, u mentioned any update coming? What is coming? I think it's working perfectly right? Advance the cause to 100%. http://hyperbase.hyperspin-fe.com/ Planet Geekdom, Subscribe for Tutorials! https://www.youtube.com/channel/UCdcby-s2GwriaOHGmVC2vGA?sub_confirmation=1&app=desktop
rfancella Posted December 14, 2014 Posted December 14, 2014 Rfan, u mentioned any update coming? What is coming? I think it's working perfectly right? I think I had updated it when I finished. But I just updated the post to be sure. http://www.hyperspin-fe.com/forum/showthread.php?19692-Idle-Volume-Adjuster&p=349486&viewfull=1#post349486 Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
ninja2bceen Posted December 14, 2014 Posted December 14, 2014 Were there any major changes from the prior working one? If so what should I look for? Thanks again. These tweaks really make things nice Advance the cause to 100%. http://hyperbase.hyperspin-fe.com/ Planet Geekdom, Subscribe for Tutorials! https://www.youtube.com/channel/UCdcby-s2GwriaOHGmVC2vGA?sub_confirmation=1&app=desktop
rfancella Posted December 15, 2014 Posted December 15, 2014 Were there any major changes from the prior working one? If so what should I look for? Thanks again. These tweaks really make things nice I think the only changes were in logging and error checking. Thanks, Ron Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
iNTiGOD Posted September 18, 2015 Posted September 18, 2015 Ok, so this is as far as I got. I created a file called "3rdPartyToolPaths.ini" and put it in the ...\HyperLaunch\Lib folder. There I put my WinIPac and IdleVolumeAdjuster path, along with what I want it to do and a list of the systems. Give three options for IdleVol, No, Yes & Kill. The script will do nothing if set to no. Yes will make it pause and resume. Kill will (eventually) kill the program and restart it when done. There is still much to do in it, but am I on the right path? 3rdPartyToolsPaths.ini: [WinIPAC]# WinIPACPath = Path and exe for your WinIPAC program# WinIPACProfileDir = The directory that has your default and system and/or game based IPac profilesWinIPACPath = H:\WinIPAC\WinIPAC.exeWinIPACProfileDir = H:\HyperLaunch\IPacProfiles[IdleVolAdjust]# IdleVolPath = Path and exe for IdleVolumeAdjuster.exe# IdleVolUse = No, Yes or Kill# IdleVolSystems = List of systems to use this script on. Please use the full name of the system seperated by commasIdleVolPath = H:\HyperLaunch\IdleVolumeAdjuster.exeIdleVolUse = KillIdleVolSystems = PopCap,ScummVM,WoW Action MaxUser Functions.ahk: ; Use this function to define any code you want to run in every module on startStartGlobalUserFeatures(){ Global systemName, romName, WinIPACPath, WinIPACProfileDir, changedIPacProfile, settingsFile, IdleVolPath, IdleVolUse Log("StartGlobalUserFeatures - Starting") settingsFile := A_ScriptDir . "\Lib\3rdPartyToolsPaths.ini" Log("3rdPartyTools - Ini file location " . settingsFile, 5) Log("WinIPAC - Start IPac System Profile Test") WinIPACPath := IniReadCheck(settingsFile, "WinIPAC", "WinIPACPath",A_ScriptDir . "\WinIPAC\WinIPAC.exe",,1) WinIPACProfileDir := IniReadCheck(settingsFile, "WinIPAC", "WinIPACProfileDir",A_ScriptDir . "\IPACProfiles",,1) If !(FileExist(WinIPACPath)) { Log("WinIPAC - The file WinIPAC.exe does not exist at " . WinIPACPath . ". Please check your paths!",3) } else { If !(FileExist(WinIPACProfileDir . "\" . "default.ipc")){ Log("WinIPAC - IPac required Default Profile not found at " . WinIPACProfileDir . "\" . "default.ipc",5) Return } else { Log("WinIPAC - Default profile found: " . WinIPACProfileDir . "\" . "default.ipc",5) changedIPacProfile := LoadIPacProfile() } } Log("WinIPAC - Stop IPac System Profile Test") Log("IdleVolAdjust - Start IdleVolAdjust Section") IdleVolPath := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolPath",A_ScriptDir . "\IdleVolumeAdjuster.exe",,1) IdleVolUse := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolUse","No",,1) IdleVolSystems := IniReadCheck(settingsFile, "IdleVolAdjust", "IdleVolSystems","",,1) If !(FileExist(IdleVolPath)) { Log("IdleVolAdjust - Exe NOT located at " . IdleVolPath . ". Please check your paths", 5) IdleVolUse := "No" } else { IfInString, IdleVolSystems, %systemName% { Log("IdleVolAdjust - " . systemName . " System found in IdleVolSystems list", 5) If (IdleVolUse = "Yes") { Log("IdleVolAdjust - Running IdleVolumeAdjuster pause with """ . IdleVolPath . " pause""", 5) Run, % IdleVolPath . " pause",,UseErrorLevel,OutputVarPID } else If (IdleVolUse = "Kill") { Log("IdleVolAdjust - Running IdleVolumeAdjuster Kill with """ . IdleVolPath . " Kill""", 5) Log("IdleVolAdjust - Trying to detect if program is running.",5) Process, Exist, IdleVolumeAdjuster.exe IdleVolPID = %ErrorLevel% Log("IdleVolAdjust - IdleVolPID = " . IdleVolPID,5) If IdleVolPID = 0 { Log("IdleVolAdjust - Process does not exist. Not stopping the process and it will not be restarted.", 5) IdleVolUse := "No" } else { Log("IdleVolAdjust - Attempting to stop Idle Volume Adjuster with a PID of " . IdleVolPID,5) Process, Close, %IdleVolPID% CloseIdleVolPID = %ErrorLevel% Log("IdleVolAdjust - Close process ErrorLevel - " . CloseIdleVolPID,5) If (IdleVolPID = CloseIdleVolPID) { Log("IdleVolAdjust - Process closed OK.",5) } else { Log("IdleVolAdjust - Process not closed. Will not restart.",5) IdleVolUse := "No" } } } } else { Log("IdleVolAdjust - " . systemName . " System Not found in IdleVolSystems list :" . IdleVolSystems, 5) IdleVolUse := "No" } } Log("IdleVolAdjust - Stop IdleVolAdjust Section") Log("StartGlobalUserFeatures - Ending")}LoadIPacProfile(){ Global systemName, romName, WinIPACPath, WinIPACProfileDir IPacPath1 := WinIPACProfileDir . "\" . systemName . "\" . romName . ".ipc" IPacPath2 := WinIPACProfileDir . "\" . systemName . ".ipc" Loop, 2 { if FileExist(IPacPath%a_index%) { Log("WinIPAC - Loading IPAC profile: " . IPacPath%a_index%, 5) Run, % WinIPACPath . " " . IPacPath%a_index%,,UseErrorLevel,OutputVarPID Process, WaitClose, %OutputVarPID%, 5 IPacPID = ErrorLevel Log("WinIPAC - WinIPAC PID: " . OutputVarPID . " Error Level: " . ErrorLevel, 5) ;11:55:54 AM | Title/Class: WinIPAC - Downloading ahk_class ThunderRT6FormDC is now active If (ErrorLevel > 0){ ScriptError("Your IPac failed to program. Make sure the IPac is connected and try again. You may need to reboot your computer and try again.") } else { Log("WinIPAC - IPAC profile was loaded.",5) Return true } } else { Log("WinIPAC - IPac profile " . IPacPath%a_index% . " not found.",5) } }}; Use this function to define any code you may need to stop or clean up in every module on exitStopGlobalUserFeatures(){ Global WinIPACPath, WinIPACProfileDir, changedIPacProfile, IdleVolPath, IdleVolUse Log("StopGlobalUserFeatures - Starting") Log("WinIPAC - Start IPac Profile Restore") If (changedIPacProfile){ RunWait, % WinIPACPath . " " . WinIPACProfileDir . "\" . "default.ipc",,UseErrorLevel,OutputVarPID If (ErrorLevel > 0){ ScriptError("Your IPac failed to restore. Your default IPac profile was not programmed.") } else { Log("WinIPAC - Default IPac profile has been restored.",5) Return } } else { Log("WinIPAC - Alternative IPac profile not used. No need to restore.") } Log("WinIPAC - Stop IPac Profile Restore") Log("IdleVolAdjust - Start IdleVolAdjust resume section") If (IdleVolUse = "Yes") { Log("IdleVolAdjust - Running IdleVolumeAdjuster resume with """ . IdleVolPath . " resume""", 5) Run, % IdleVolPath . " resume",,UseErrorLevel,OutputVarPID } else If (IdleVolUse = "Kill") { Log("IdleVolAdjust - Running IdleVolumeAdjuster restart from Kill with """ . IdleVolPath . """", 5) Run, % IdleVolPath,,UseErrorLevel,OutputVarPID } else { Log("IdleVolAdjust - Not adjusting volume. IdleVolUse set to: " . IdleVolUse, 5) } Log("IdleVolAdjust - Stop IdleVolAdjust resume section") Log("StopGlobalUserFeatures - Ending")} Your thoughts? And, how do I detect and attempt to close the program?I tried: IfWinExist, Idle Volume Adjuster v1.4 (by djvj) {Log("IdleVolAdjust - Attempting to close Idle Volume Adjuster", 5) WinClose, Idle Volume Adjuster v1.4 (by djvj) } But that didn't work. I edited this post with a working script. The Volume Idle Adjuster part of the script works great! The WinIPac part is still a WIP. It works, but does no proper error detection. And it's on another thread. Thanks, Ron Hi Ron, Currently pulling my hair out because MESS isn't playing nicely with my ipac (just player two right direction). I was hoping to use your script for switch ipac profiles for Mess\colecovision. Can you please give me a few more pointers? I'm not sure where the User Functions.ahk: file needs to go in rocketlauncher? Also I have two ipac profiles 1) default.ipc (for most of my systems) 2) colecovision.ipc (for coleco). Where do I go from here? Thank you George /scrap that. I seemed to have figured it out. Thanks again Ron it's a wonderful script that's saved me plenty of headache!! MAME High Score Tutorial For HyperSpin
rfancella Posted October 5, 2015 Posted October 5, 2015 Hey George, Sorry for the late reply. I have been so far behind here. But this was on my last page of unread posts. Did you get it sorted? Thanks, Ron Hi Ron,Currently pulling my hair out because MESS isn't playing nicely with my ipac (just player two right direction). I was hoping to use your script for switch ipac profiles for Mess\colecovision. Can you please give me a few more pointers? I'm not sure where the User Functions.ahk: file needs to go in rocketlauncher? Also I have two ipac profiles1) default.ipc (for most of my systems)2) colecovision.ipc (for coleco).Where do I go from here?Thank youGeorge/scrap that. I seemed to have figured it out. Thanks again Ron it's a wonderful script that's saved me plenty of headache!! Code Monkey and all around Command Line geek!If you like what someone has said or done for you, be sure and 'Thank' them. And if they changed your life, send them a Beer!
iNTiGOD Posted October 5, 2015 Posted October 5, 2015 Hey George, Sorry for the late reply. I have been so far behind here. But this was on my last page of unread posts. Did you get it sorted? Thanks, Ron Hey Ron!Yes all sorted. I've used your script as a last resort for a couple systems that I can't remap with rlaunchers inbuilt mapping feature. It's saved my sanity! Thanks again and cheers for bundling with the idle volume adjuster MAME High Score Tutorial For HyperSpin
Recommended Posts
Archived
This topic is now archived and is closed to further replies.