Limit Current Volume

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Xenon
Posts: 2
Joined: 15 Aug 2018, 07:52
Contact:

Limit Current Volume

15 Aug 2018, 08:05

I wanted to make a script that limit the master volume by getting the current volume.The script that I wanted to make is
when the script get executed it will use the current volume and lock the volume so that it can't increase but can only decrease.
This is what I got now but the MaxVol can't be change.
Thank You For All The Helps :D

Code: Select all

#Persistent
MaxVol = 45
Loop {

	SoundGet, vol
	If(vol>MaxVol)
SoundSet, MaxVol
}
Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Limit Current Volume

15 Aug 2018, 09:24

Hallo,
try:

Code: Select all

#Persistent
SoundGet, MaxVol
Loop {
Sleep, 100 ;10 times per second
SoundGet, vol
If(vol>MaxVol)
	SoundSet, MaxVol
}
Edit: # was missing
Last edited by Rohwedder on 16 Aug 2018, 02:11, edited 1 time in total.
Xenon
Posts: 2
Joined: 15 Aug 2018, 07:52
Contact:

Re: Limit Current Volume

15 Aug 2018, 19:11

Exactly what i wanted thank you so much !! :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Exies, hiahkforum, scriptor2016 and 119 guests