From 959bdf96e6941a5924c551c6689e7b3673e4658a Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 5 Nov 2024 21:25:10 +0100 Subject: [PATCH] Add spysatellite weakaura --- FreshShit/SpySatellite/event.lua | 4 ++ FreshShit/SpySatellite/event2.lua | 0 FreshShit/SpySatellite/event3.lua | 7 +++ FreshShit/SpySatellite/init.lua | 74 +++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 FreshShit/SpySatellite/event.lua create mode 100644 FreshShit/SpySatellite/event2.lua create mode 100644 FreshShit/SpySatellite/event3.lua create mode 100644 FreshShit/SpySatellite/init.lua diff --git a/FreshShit/SpySatellite/event.lua b/FreshShit/SpySatellite/event.lua new file mode 100644 index 0000000..43415f3 --- /dev/null +++ b/FreshShit/SpySatellite/event.lua @@ -0,0 +1,4 @@ +-- COMBAT_LOG_EVENT_UNFILTERED +function(e, ...) + +end \ No newline at end of file diff --git a/FreshShit/SpySatellite/event2.lua b/FreshShit/SpySatellite/event2.lua new file mode 100644 index 0000000..e69de29 diff --git a/FreshShit/SpySatellite/event3.lua b/FreshShit/SpySatellite/event3.lua new file mode 100644 index 0000000..8fb1c1b --- /dev/null +++ b/FreshShit/SpySatellite/event3.lua @@ -0,0 +1,7 @@ +-- WHO_LIST_UPDATE +function() + for i = 1, GetNumWhoResults() do + local name, guild, level, race, class, zone = GetWhoInfo(i) + WeakAurasSaved.Cyka.RaceCache[name] = race + end +end \ No newline at end of file diff --git a/FreshShit/SpySatellite/init.lua b/FreshShit/SpySatellite/init.lua new file mode 100644 index 0000000..5000667 --- /dev/null +++ b/FreshShit/SpySatellite/init.lua @@ -0,0 +1,74 @@ +local channelname = aura_env.config.channelname or "lAKDJjZfNgobMblAangc" + +if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end +if not WeakAurasSaved.Cyka.RaceCache then WeakAurasSaved.Cyka.RaceCache = {} end + +---@class Player +---@field name string +---@field guild string|nil +---@field race string|nil +---@field health number +---@field whoQueued boolean +Player = { + ---@param name string + ---@return Player + new = function(name) + local self = setmetatable({}, { + __index = Player + }) + self.name = name + self.whoQueued = false + self.health = 0 + return self + end, + QueryWho = function(self) + local query = string.format("n-\"%s\"", self.name) + self.whoQueued = true + SendWho(query) + end +} + +--[09:01 PM] Dump: value=GetChannelList() +--[09:01 PM] [1]=1, +--[09:01 PM] [2]="world_en", +--[09:01 PM] [3]=2, +--[09:01 PM] [4]="world_ru", +--[09:01 PM] [5]=3, +--[09:01 PM] [6]="world_hc", +--[09:01 PM] [7]=6, +--[09:01 PM] [8]="lAKDJjZfNgobMblAangc" +-- +-- zoneChannel, channelName = JoinPermanentChannel("name" [, "password" [, chatFrameIndex [, enableVoice]]]) +-- +--[09:03 PM] Dump: value=GetChannelDisplayInfo(6) +--[09:03 PM] [1]="world_hc", +--[09:03 PM] [2]=false, +--[09:03 PM] [4]=3, +--[09:03 PM] [5]=1258, +--[09:03 PM] [6]=true, +--[09:03 PM] [7]="CHANNEL_CATEGORY_CUSTOM", +--[09:03 PM] [8]=false +-- +-- channelCount = GetNumDisplayChannels() +-- +-- +-- SendChatMessage("text" [, "chatType" [, languageIndex [, "channel"]]]) +--Arguments: +-- text - Message to be sent (up to 255 characters) (string) +-- chatType - Channel on which to send the message (defaults to SAY if omitted) (string) +-- CHANNEL - Message to a server or custom chat channel (sent with /1, /2, etc in the default UI); requires channel number for channel argument +-- DND - Enables Away-From-Keyboard status for the player, with text as the custom message seen by others attempting to whisper the player +-- EMOTE - Custom text emotes visible to nearby players (sent with /e in the default UI) +-- GUILD - Messages to guild members (sent with /g in the default UI) +-- INSTANCE_CHAT - Messages to a LFG/LFR instance group (sent with /i in the default UI) +-- OFFICER - Messages to guild officers (sent with /o in the default UI) +-- PARTY - Messages to party members (sent with /p in the default UI) +-- RAID - Messages to raid members (sent with /ra in the default UI) +-- RAID_WARNING - Warning to raid members (sent with /rw in the default UI) +-- SAY - Speech to nearby players (sent with /s in the default UI) +-- WHISPER - Message to a specific character (sent with /w in the default UI); requires name of the character for channel argument +-- YELL - Yell to not-so-nearby players (sent with /y in the default UI) +-- languageIndex - Language in which to send the message; defaults to Common (for Alliance players) or Orcish (for Horde players) if omitted. Language indices can be retrieved from GetLanguageByIndex(). (number) +-- channel - If chatType is WHISPER, name of the target character; if chatType is CHANNEL, number identifying the target channel; ignored otherwise (string) +-- +-- language = GetDefaultLanguage()