View Single Post
03-24-22, 03:40 AM   #10
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Fizzlemizz View Post
Lua Code:
  1. if oldstanding and oldstanding<newstanding then
TrackedFactions starts as an empty table so oldstanding will always be nil until a new faction entry is added.
Lua Code:
  1. if not oldstanding or oldstanding<newstanding then
That only controls the sound playing, not the recording. The idea is for PLAYER_LOGIN to start the initial scan, populating TrackedFactions. Further updates compare previous values added and act accordingly. If a new faction was added mid-session, it's designed to not play the sound and still record the initial value.



Looks like the issue was with the hasrep flag. I assumed it was for all factions that show a reputation bar, but it only applies to headers. This adjusts accordingly.

Replace this
Code:
local _,_,newstanding,_,_,_,_,_,_,_,hasrep,_,_,faction=GetFactionInfo(i);
if hasrep and faction and (newstanding or 0)>0 then
with this
Code:
local _,_,newstanding,_,_,_,_,_,isheader,_,hasrep,_,_,faction=GetFactionInfo(i);
if faction and (not isheader or hasrep) and (newstanding or 0)>0 then


Also be sure to change PlaySoundFile("Interface\\AddOns\\YourAddOn\\YourSoundFile.ogg") to the path to the sound file you wish to play. This is relative to the client's install directory. Note YourAddOn and YourSoundFile.ogg are the parts to change accordingly.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 03-24-22 at 04:12 AM.
  Reply With Quote