Lua Code:
local f = CreateFrame("Frame") --create a frame to listen for the event
f:RegisterEvent("CHAT_MSG_SYSTEM") --register for the event you want to listen for
f:SetScript("OnEvent", function(self, event, msg) --tell WoW what to do when the event fires
if strfind(msg, "sold") then --we only registered for one event, so we don't even have to check to see which one it was
PlaySound(5274)
elseif strfind(msg, "expired") then
PlaySound(5275)
end
end)