WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Volume control (20% -> 80%) (https://www.wowinterface.com/forums/showthread.php?t=40393)

tobindax 06-04-11 03:34 AM

Volume control (20% -> 80%)
 
This sounds simple but bizarrely google doesn't give any easy results.

I need a macro that once hit it gives audio to 80%. (global audio) When hit again it gives 20%.

It can be two macros, it doesn't matter.



Is there such a command at all? :banana:

Haleth 06-04-11 04:13 AM

You could make a macro that checks your current volume level first, but that might be a little too complicated.

I use this:

Code:

SlashCmdList.VOLUME = function(val)
        SetCVar("Sound_MasterVolume", val)
end
SLASH_VOLUME1 = "/vol"

So you can type /vol <number>, or just make a macro with the volume you want.

humfras 06-04-11 05:20 AM

Quote:

Originally Posted by tobindax (Post 238760)
I need a macro that once hit it gives audio to 80%. (global audio) When hit again it gives 20%.

I would use a macro with a global variable eg.
Code:

/run local MV = GetCVar("Sound_MasterVolume") if MV == "0.2" then SetCVar("Sound_MasterVolume", 0.8) elseif MV == "0.8" then SetCVar("Sound_MasterVolume", 0.2) else SetCVar("Sound_MasterVolume", 0.8) end
This will check for the actual MasterVolume variable and will set it to
80% if it is at 20%
20% if it is at 80%
80% if it is at any other value

Ketho 06-04-11 06:16 AM

does this also work? (provided it's already at 0.2 or 0.8)
Code:

/run local a="Sound_MasterVolume"SetCVar(a,1-GetCVar(a))

Seerah 06-04-11 09:44 AM

Quote:

Originally Posted by Ketho (Post 238768)
does this also work? (provided it's already at 0.2 or 0.8)
Code:

/run local a="Sound_MasterVolume"SetCVar(a,1-GetCVar(a))

With a script that short, I'd even forgo creating a new variable each time it's pressed.
Code:

/run SetCVar("Sound_MasterVolume",1-GetCVar("Sound_MasterVolume"))
To make sure your volume is at 0.2 (or 0.8) before running the above macro...
Code:

/run SetCVar("Sound_MasterVolume", 0.2)

/edit: Ketho's script works because .2 + .8 = 1 :) If you want other values (that don't add up to 1), then you'd need a different script.


All times are GMT -6. The time now is 08:37 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI