Skip to content

Instantly share code, notes, and snippets.

@Meorawr
Meorawr / savedvars.py
Last active January 13, 2020 02:40
TRP3 Saved Variables Parser
#!/usr/bin/python3
'''
Limited reimplementation of the Lua 5.1 lexer and parser providing utilities
for serialization and deserialization of World of Warcraft saved variables
files.
The grammar supported by the parser is a subset of the Lua 5.1 grammar,
any unimplemented features will raise errors if encountered in a source file.
'''
@Meorawr
Meorawr / UnitSearcher.lua
Created January 20, 2020 17:37
Unit Searcher
-- Mapping of all root unit tokens in the game.
local UNIT_TOKENS = {
["player"] = true,
["target"] = true,
["mouseover"] = true,
["focus"] = true,
["pet"] = true,
["npc"] = true,
["vehicle"] = true,
};
@Meorawr
Meorawr / CraftingSpells.tsv
Last active May 8, 2020 11:30
Classic 1.13.2 Tradeskill/Crafting Spell ID Dump
Effect SpellID
53 2832
53 2833
53 3974
53 2831
53 2605
53 3231
53 3975
53 3976
53 6476
@Meorawr
Meorawr / ButtonGroupMixin.lua
Created June 28, 2020 11:12
ButtonGroupMixin
local ButtonGroupMixin = CreateFromMixins(CallbackRegistryBaseMixin);
function ButtonGroupMixin:Init()
CallbackRegistryBaseMixin.OnLoad(self);
self.buttons = {};
self.selectedButton = nil;
end
function ButtonGroupMixin:AddButton(button)
@Meorawr
Meorawr / ParentlessFrameBug.xml
Last active July 17, 2020 22:50
Parentless Frame Bug (9.x)
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<!--
Bug #1:
Instantiating a frame ("TestFrame") that has no parent attribute
specified and is hidden upon creation seems to cause some issues
with the visiblity of child frames.
This is quite odd to explain, but running `TestFrame:Show()` ingame
causes only the "MagicTexture" Texture element to appear until the
frame itself is relocated or resized (click to drag), at which point
@Meorawr
Meorawr / UserWaypointSkeleton.lua
Created July 22, 2020 19:01
User Waypoint Position Skeleton
local distances = {}; -- Array of 4 distances to TL, TR, BR, BL.
local function GetPointToQuery(index)
local mapID = C_Map.GetBestMapForUnit("player");
local x, y;
if index == 1 then
x, y = 0, 0;
elseif index == 2 then
x, y = 1, 0;
@Meorawr
Meorawr / ForbiddenChatBubbles.md
Created August 12, 2020 20:12
9.0 Forbidden Chat Bubbles

On Beta clients, chat bubbles seem to have a child frame which is forbidden even outside of instances - while the chat bubble frame itself isn't:

/say s
/run C_Timer.After(1.5, function() for _, b in ipairs(C_ChatBubbles.GetAllChatBubbles()) do print(b:IsForbidden(), b:GetNumChildren(), b:GetChildren():IsForbidden()); end; end)

The above if placed in a macro and executed outside of an instance will print "false 1 true" to the chat frame, indicating that the chat bubble wasn't forbidden, had 1 child, and the child was forbidden.

On Live clients, chat bubbles don't have a child frame but themselves aren't forbidden outside of instances:

/say s

@Meorawr
Meorawr / BackdropMixinTaintTest.xml
Last active August 14, 2020 17:24
BackdropMixin Taint
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<!--
Upon login, run the following in the chat frame - if taint has
occurred both of the following variables will report as being insecure:
/dump issecurevariable(PTR_IssueReporter.Data, "CurrentMapID")
/dump issecurevariable(PTRIssueReporterAlertFrame, "FrameComponents")
It's possible for the first one to spuriously return "true" - there
might be an element of luck to it, but the "FrameComponents" key on
@Meorawr
Meorawr / MinimalUI.lua
Last active August 31, 2020 11:42
"Can you recommend me a minimal UI?"
-- Set a user waypoint and begin tracking it, then run the below script and
-- enter any portal that will trigger a loading screen transition.
--
-- Enjoy your new super-minimalistic user interface.
local ScriptHandlers = {
"OnLoad",
"OnAttributeChanged",
"OnSizeChanged",
"OnEvent",
@Meorawr
Meorawr / AddOn_SelectionPopoutDemo.lua
Last active August 31, 2020 12:27
SelectionPopoutButtonTemplate Demo
local function CreateSelectionModel(entries)
local selections = {};
for i = 1, entries do
selections[i] = {
-- `name` is the only required key. There is color swatch support too, but that's
-- probably not needed.
name = "Item " .. i,
-- Other keys can be created as needed and made available to OnEntryClick.