Thread Tools Display Modes
01-23-13, 09:36 AM   #1
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Question Sound_EnableSFX 0 & 1 in ONE addon / macro?

I've got an engineer in the Shrine of Seven Stars.

There are a lot of sounds in that area that I would like to mute (doodads, loops and such). There seem to be too many for me to figure out what they all are, so I thought I would go another way.

/console Sound_EnableSFX 0 - that turns sound effects off
/console Sound_EnableSFX 1 - that turns sound effects on

Is there any way to get these into a macro or simple addon, so I could just hit one button?
Hit it once and the effects are off. Hit it again and they're back on. Is that possible?

Thanks!
  Reply With Quote
01-23-13, 09:57 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Code:
/run local c,r="Sound_EnableSFX";r=SetCVar(c,GetCVarBool(c) and "0" or "1")
This should work (drycoded)

Oh erm... there should also be a default keybind for turning sound effects off/on in game options.
  Reply With Quote
01-23-13, 11:09 AM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Alternative:

Code:
/script SetCVar("Sound_EnableSFX", 1 - GetCVar("Sound_EnableSFX"))
But yes, I think the default is ctrl-S.
  Reply With Quote
01-23-13, 11:30 AM   #4
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Much appreciated, both.

The other thing I was wondering:

Certain addons seem to be able to realise where a player is and perform an action / actions. Would it be possible to do something like:
Start
If [location]
then Sound_EnableSFX 0
Else if [another location]
then Sound_EnableSFX 0
Else
then Sound_EnableSFX 1
End
Obviously that's not even correct programming as it stands, but I use that as basic logic for this question.

Can a WoW addon do such a thing (detect where it is, turn the sound off in a designated area and keep it on elsewhere)?

I'll try out the earlier suggestions.
Thanks.

  Reply With Quote
01-23-13, 01:13 PM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Yes that's quite possible but it would be better served by a small addon rather than a macro.

It would need to register some zone / subzone change events and respond by checking against a list of mapids to appropriately set the sound cvar.

Without having looked at the code I expect something like Diplomancer (or one of the addons that switch outfits based on location) would provide you with examples of zone-based actions for studying.

Last edited by Dridzt : 01-23-13 at 01:17 PM.
  Reply With Quote
01-23-13, 01:35 PM   #6
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Originally Posted by Dridzt View Post
Without having looked at the code I expect something like Diplomancer (or one of the addons that switch outfits based on location) would provide you with examples of zone-based actions for studying.
Yes, that's the sort of addon I was thinking of.
I'm really not a coder, so hope I can figure it out.
If anyone can, before me, please feel free to post any simple solutions you may come up with.
In the meantime, I'll certainly check out that addon.

Thanks.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Sound_EnableSFX 0 & 1 in ONE addon / macro?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off