Improve stinky detector to add stinkies to friends list
This commit is contained in:
		@@ -1,9 +1,17 @@
 | 
				
			|||||||
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
 | 
					if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
 | 
				
			||||||
if not WeakAurasSaved.Cyka.Stinkies then WeakAurasSaved.Cyka.Stinkies = {
 | 
					if not WeakAurasSaved.Cyka.Stinkies then
 | 
				
			||||||
	["Курлык"] = true,
 | 
						WeakAurasSaved.Cyka.Stinkies = {
 | 
				
			||||||
		["Redbulka"] = true,
 | 
							["Redbulka"] = true,
 | 
				
			||||||
 | 
							["Курлык"] = true,
 | 
				
			||||||
 | 
							["Riener"] = true,
 | 
				
			||||||
 | 
							["Unwashed"] = true,
 | 
				
			||||||
		["Ловилуну"] = true,
 | 
							["Ловилуну"] = true,
 | 
				
			||||||
} end
 | 
							["Korovadura"] = true,
 | 
				
			||||||
 | 
							["Pizdosorkam"] = true,
 | 
				
			||||||
 | 
							["Joule"] = true,
 | 
				
			||||||
 | 
							["Rattenfenger"] = true
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
aura_env.stinkies = WeakAurasSaved.Cyka.Stinkies
 | 
					aura_env.stinkies = WeakAurasSaved.Cyka.Stinkies
 | 
				
			||||||
-- aura_env.stinkies[UnitName("player")] = true
 | 
					-- aura_env.stinkies[UnitName("player")] = true
 | 
				
			||||||
@@ -11,13 +19,27 @@ aura_env.localStinkies = {}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
---@param name string
 | 
					---@param name string
 | 
				
			||||||
aura_env.StinkyDetected = function(name)
 | 
					aura_env.StinkyDetected = function(name)
 | 
				
			||||||
	if not aura_env.localStinkies[name] then
 | 
						if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
 | 
				
			||||||
 | 
							GetTime() - 60 then
 | 
				
			||||||
		PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
 | 
							PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	aura_env.localStinkies[name] = GetTime()
 | 
						aura_env.localStinkies[name] = GetTime()
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--/run WeakAurasSaved.Cyka.Stinkies["Redbulka"] = true
 | 
					local friends = {}
 | 
				
			||||||
--/run WeakAurasSaved.Cyka.Stinkies["Курлык"] = true
 | 
					local numfriends = GetNumFriends()
 | 
				
			||||||
--/run WeakAurasSaved.Cyka.Stinkies["Ловилуну"] = true
 | 
					for i = 1, numfriends do
 | 
				
			||||||
 | 
						local name = GetFriendInfo(i)
 | 
				
			||||||
 | 
						friends[name] = true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do
 | 
				
			||||||
 | 
						if not friends[k] then
 | 
				
			||||||
 | 
							AddFriend(k)
 | 
				
			||||||
 | 
							C_Timer.After(1, function()
 | 
				
			||||||
 | 
								SetFriendNotes(k, "STINKY")
 | 
				
			||||||
 | 
								print("AAAAAAAAAAA")
 | 
				
			||||||
 | 
							end)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- /dump WeakAurasSaved.Cyka.Stinkies
 | 
					-- /dump WeakAurasSaved.Cyka.Stinkies
 | 
				
			||||||
		Reference in New Issue
	
	Block a user