Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
10 changes: 6 additions & 4 deletions DutyManager/package-lock.json → AuraSpy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions DutyManager/package.json → AuraSpy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DutyManager",
"version": "1.0.0",
"name": "AuraSpy",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"archiver": "^3.1.1",
Expand Down
10 changes: 6 additions & 4 deletions DutyManager/scripts/build.js → AuraSpy/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ const archiver = require('archiver');

const versionTag = "## Version:";

const ADDON_NAME = 'AuraSpy';

const srcDir = path.join(__dirname, '../src');
const libDir = path.join(__dirname, '../Libs');
const targetDir = path.join(__dirname, '../target');
const WoW_dir = 'D:\\Games\\BattleNet\\World of Warcraft\\_classic_';
const AddonDir = `${WoW_dir}\\Interface\\Addons\\DutyManager`;
const AddonDir = `${WoW_dir}\\Interface\\Addons\\${ADDON_NAME}`;

const copySources = (dest) => {
copydir.sync(srcDir, dest);
copydir.sync(libDir, `${dest}\\Libs`);
};

const getVersion = () => {
const contents = fs.readFileSync(path.join(srcDir, 'DutyManager.toc'), 'utf8');
const contents = fs.readFileSync(path.join(srcDir, `${ADDON_NAME}.toc`), 'utf8');
const lines = contents.split(/(?:\r\n|\r|\n)/g);

for (let i = 0; i < lines.length; i++) {
Expand Down Expand Up @@ -56,7 +58,7 @@ const createZip = (dir, target) => {
});

archive.pipe(output);
archive.directory(dir, 'DutyManager');
archive.directory(dir, ADDON_NAME);
archive.finalize();
};

Expand All @@ -67,7 +69,7 @@ if (!fs.existsSync(targetDir)){
}
copySources(path.join(targetDir, 'sources'));

createZip(path.join(targetDir, 'sources'), path.join(targetDir, `DutyManager-v${getVersion()}.zip`));
createZip(path.join(targetDir, 'sources'), path.join(targetDir, `${ADDON_NAME}-v${getVersion()}.zip`));

rimraf.sync(AddonDir);
copySources(AddonDir);
Expand Down
103 changes: 103 additions & 0 deletions AuraSpy/src/AuraSpy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
AuraSpy = LibStub("AceAddon-3.0"):NewAddon("AuraSpy", "AceEvent-3.0", "AceHook-3.0", "AceConsole-3.0")
AceGUI = LibStub("AceGUI-3.0")

function AuraSpy:OnInitialize()
if not AuraReports then AuraReports = {} end;
if not AuraSpy.var then AuraSpy.var = {} end;

print("AuraSpy initialized")
end

function AuraSpy:OnEnable()
AuraSpy:RegisterChatCommand("kgb", "OnCommand")

AuraSpy:CreateCopyFrame()
--AuraSpy:RegisterEvent("GROUP_ROSTER_UPDATE", "onRosterUpdate")
end

function AuraSpy:OnDisable()
AuraSpy:UnregisterChatCommand("kgb")
--AuraSpy:UnregisterEvent("GROUP_ROSTER_UPDATE")
end

function mysplit (inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end

function AuraSpy:OnCommand(params)
local p = mysplit(params, " ")

if (p[1] == "spy") then
local players = AuraSpyUtils:spy()
if (players ~= nil) then
players.name = p[2]
AuraReports[#AuraReports + 1] = players
print("Spied " .. #players .. " commrades")
end
elseif (p[1] == "clear") then
AuraReports = {}
print("cleared")
elseif (p[1] == "export") then
local json = AuraSpyJson.stringify(AuraReports[1], false)
AuraSpy:OpenEditor(json)
else
local consumables, enchants = AuraSpyUtils:spyPlayer(p[1], UnitClass(p[1]))
print(AuraSpyUtils:dump(consumables));
print(AuraSpyUtils:dump(enchants));
end
end

function AuraSpy:OpenEditor(text)
print("opening")
if (AuraSpy.var and AuraSpy.var.editBox) then
print("ok")
AuraSpy.var.editBox:Insert(text)
AuraSpy.var.editFrame:Show()
AuraSpy.var.editBox:HighlightText()
AuraSpy.var.editBox:SetFocus()
print("done")
end
end

function AuraSpy:CloseEditor()
if (AuraSpy.var and AuraSpy.var.editBox) then
AuraSpy.var.editBox:SetText("")
AuraSpy.var.editBox:ClearFocus()
AuraSpy.var.editFrame:Hide()
end
end

function AuraSpy:CreateCopyFrame()
AuraSpy.var.editFrame = CreateFrame("ScrollFrame", "CopyContent", UIParent, "InputScrollFrameTemplate")
AuraSpy.var.editBox = AuraSpy.var.editFrame.EditBox
AuraSpy.var.btnClose = CreateFrame("Button", "ChatCopy", AuraSpy.var.editFrame, "UIPanelButtonTemplate")

-- setup edit box
AuraSpy.var.editFrame:SetPoint("CENTER")
AuraSpy.var.editFrame:SetSize(500, 300)
AuraSpy.var.editFrame.CharCount:Hide()
--editBox:SetFontObject("ChatFontNormal")
AuraSpy.var.editBox:SetFont("Fonts\\ARIALN.ttf", 13)
AuraSpy.var.editBox:SetWidth(AuraSpy.var.editFrame:GetWidth()) -- multiline editboxes need a width declared!!
AuraSpy.var.editBox:SetScript("OnEscapePressed", function(self)
AuraSpy:CloseEditor()
end)
AuraSpy.var.editBox:SetAllPoints()
AuraSpy.var.editFrame:Hide()

-- setup edit box closing button
AuraSpy.var.btnClose:SetPoint("TOPRIGHT")
AuraSpy.var.btnClose:SetSize(15, 15)
AuraSpy.var.btnClose:SetText("x")
AuraSpy.var.btnClose:SetFrameStrata("FULLSCREEN")
AuraSpy.var.btnClose:SetScript("OnClick", function(self)
AuraSpy:CloseEditor()
end)
end
16 changes: 16 additions & 0 deletions AuraSpy/src/AuraSpy.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Interface: 11304
## Title: AuraSpy
## Notes: Spy auras
## Version: 0.0.1

## SavedVariables: AuraReports
## SavedVariablesPerCharacter:

## Author: Tomas Chalupnik (tchalupnik.cz)

embeds.xml

Json.lua
Config.lua
Utils.lua
AuraSpy.lua
63 changes: 63 additions & 0 deletions AuraSpy/src/Config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
AuraSpyConfig = LibStub("AceAddon-3.0"):NewAddon("AuraSpyConfig")

AuraSpyConfig = {
watched = {
consumables = {
17539, -- Greater Arcane Elixir
11474, -- Elixir of Shadow Power
22730, -- Runn Tum Tuber Surprise
21920, -- Elixir of Frost Power
26276, -- Elixir of Greater Firepower
18194, -- Nightfin Soup
16327, -- Juju Guile
17628, -- Flask of Supreme Power
11390, -- Arcane Elixir
10692, -- Cerebral Cortex Compound
17627, -- Flask of Distilled Wisdom
25691, -- Sagefish Delight
17538, -- Elixir of the Mongoose
17038, -- Winterfall Firewater
18230, -- Grilled Squid
16323, -- Juju Power
10669, -- Ground Scorpok Assay
16329, -- Juju Might
22789, -- Gordok Green Grog
17626, -- Flask of the Titans
3593, -- Elixir of Fortitude
11405, -- Elixir of Giants
11334, -- Elixir of Greater Agility
7844, -- Elixir of Firepower
10256, -- Monster Omelet
18124, -- Blessed Sunfruit
10667, -- R.O.I.D.S.
11328, -- Elixir of Agility
22790, -- Kreeg\'s Stout Beatdown
10693, -- Gizzard Gum
18140, -- Blessed Sunfruit Juice
24382, -- Spirit of Zanza
24363, -- Mageblood Potion
24361, -- Major Troll\'s Blood Potion
11348, -- Elixir of Superior Defense
17537, -- Elixir of Brute Force
25804, -- Rumsey Rum Black Label
10668, -- Lung Juice Cocktail
},
enchants = {
"Minor Mana Oil",
"Brilliant Mana Oil",
"Brilliant Wizard Oil",
"Lesser Mana Oil",
"Wizard Oil",
"Lesser Wizard Oil",
"Blessed Wizard Oil",

"Elemental Sharpening Stone",
"Consecrated Sharpening Stone",
"Dense Sharpening Stone",
"Coarse Sharpening Stone",
"Rough Sharpening Stone",
"Heavy Sharpening Stone",
"Solid Sharpening Stone",
},
}
}
Loading