Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a390c64
Showing
13 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Compiled Lua sources | ||
luac.out | ||
/WhereGuildmates | ||
|
||
# luarocks build files | ||
*.src.rock | ||
*.zip | ||
*.tar.gz | ||
|
||
# Object files | ||
*.o | ||
*.os | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
*.def | ||
*.exp | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Images | ||
*.bmp | ||
*.gif | ||
*.png | ||
*.svg | ||
*.webm | ||
*.webp | ||
|
||
# Sounds | ||
*.aac | ||
*.flac | ||
*.m4a | ||
*.mp3 | ||
*.wav | ||
*.wma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# where-guildmates-wow | ||
|
||
This addon plays a fun sound when a guildmate login or logout | ||
|
||
- It was a fun idea from a guildmate so I did it (we have custom sounds for our characters hehe) | ||
- Created for World of Warcraft Retail 10.0.2 on Nov 18 (2022) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
addonName = "WhereGuildmates"; | ||
|
||
local frame = CreateFrame("Frame"); | ||
frame:RegisterEvent("CHAT_MSG_SYSTEM"); | ||
|
||
local online_msg = ERR_FRIEND_ONLINE_SS:gsub("%%s", "(.-)"):gsub("[%[%]]", "%%%1"); | ||
local offline_msg = ERR_FRIEND_OFFLINE_S:gsub("%%s", "(.-)"); | ||
|
||
local function GetPlayerNameFromMsg(msg) | ||
local name = nil; | ||
|
||
if(msg:find(online_msg)) then | ||
_, name = strmatch(msg, online_msg); | ||
elseif(msg:find(offline_msg)) then | ||
name = strmatch(msg, offline_msg); | ||
end | ||
|
||
return name; | ||
end | ||
|
||
local function GetPlayerNameFromGuild(index) | ||
local name = GetGuildRosterInfo(index):match("(.*-)"):gsub('-', ''); | ||
return name; | ||
end | ||
|
||
local function LoginCustomRule(playerName) | ||
local sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\login.ogg"; | ||
|
||
if(playerName == "Gorkah") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\login_gorkah.ogg"; | ||
elseif(playerName == "Krÿg") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\login_kryg.ogg"; | ||
elseif(playerName == "Borsâ") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\login_borsa.ogg"; | ||
elseif(playerName == "Ewïlan") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\login_ewilan.ogg"; | ||
elseif(playerName == "Klamidiaa") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\login_klam.ogg"; | ||
else | ||
num = math.random() and math.random() and math.random() and math.random(0, 20) | ||
if(num == 10) then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\wololo.ogg"; | ||
end | ||
end | ||
|
||
return sound; | ||
end | ||
|
||
local function LogoutCustomRule(playerName) | ||
local sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\logout.ogg"; | ||
|
||
if(playerName == "Gorkah") then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\logout.ogg"; | ||
else | ||
num = math.random() and math.random() and math.random() and math.random(0, 20) | ||
if(num == 10) then | ||
sound = "Interface\\AddOns\\WhereGuildmates\\sounds\\ee\\wololo.ogg"; | ||
end | ||
end | ||
|
||
return sound; | ||
end | ||
|
||
local function EventHandler(self, event, msg) | ||
local msgPlayerName = GetPlayerNameFromMsg(msg); | ||
|
||
if(msgPlayerName == nil or msgPlayerName == '') then | ||
-- do nothing | ||
else | ||
for i=1,GetNumGuildMembers(true) do | ||
local guildPlayerName = GetPlayerNameFromGuild(i); | ||
if((guildPlayerName == msgPlayerName)) then | ||
if(msg:find(online_msg)) then | ||
PlaySoundFile(LoginCustomRule(msgPlayerName), "Master"); | ||
elseif(msg:find(offline_msg)) then | ||
PlaySoundFile(LogoutCustomRule(msgPlayerName), "Master"); | ||
end | ||
break | ||
end | ||
end | ||
end | ||
end | ||
|
||
frame:SetScript("OnEvent", EventHandler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Interface: 100002 | ||
## Interface-Classic: 11403 | ||
## Interface-BCC: 20504 | ||
## Interface-Wrath: 30400 | ||
## X-Min-Interface: 100002 | ||
## X-Min-Interface-Classic: 11403 | ||
## X-Min-Interface-BCC: 20504 | ||
## X-Min-Interface-Wrath: 30400 | ||
## Title: WhereGuildmates | ||
## Version: 1.1.5 | ||
## DefaultState: Enabled | ||
## LoadOnDemand: 0 | ||
## Notes: Play a fun sound when a guildmate login or logout. | ||
## Description: Play a fun sound when a guildmate login or logout. | ||
|
||
WhereGuildmates.lua |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.