Skip to content

Instantly share code, notes, and snippets.

@mooreatv
mooreatv / LibDSA.lua
Created June 1, 2019 20:00 — forked from jaredallard/LibDSA.lua
DSA for Lua 5.1
--------------------------------------------------------------------------------------------
-- LUA Big Number Library
-- Made for Lua 5.1 by Jared Allard <jaredallard@outlook.com>
-- Heavly optimised for the LUA implementation in World of Warcraft, minimizing
-- table creation/seeks and the use of external variables.
-- Numbers are stored as tables containing words of [radix length] decimal digits.
-- [0] being the most significant, [n-1] being the least: 1234567890 = {[0]=123,4567890}.
-- ["n"] stores the length of the number, words in indexes >= n may contain zeros, all
-- words are stored as primitive type number.
-- ["neg"] indicates if the value is negative, true for negative false for positive, this
@mooreatv
mooreatv / gist:888bf2bdfbaa8bf009fd7f3bcf058212
Created June 6, 2019 19:06
luac5.1.exe -l -p format.lua
main <format.lua:0,0> (3 instructions, 12 bytes at 00000000007C6300)
0+ params, 2 slots, 0 upvalues, 0 locals, 1 constant, 1 function
1 [17] CLOSURE 0 0 ; 00000000007C8700
2 [4] SETGLOBAL 0 -1 ; fmt
3 [17] RETURN 0 1
function <format.lua:4,17> (42 instructions, 168 bytes at 00000000007C8700)
2+ params, 12 slots, 0 upvalues, 6 locals, 12 constants, 0 functions
1 [5] GETGLOBAL 3 -1 ; string
2 [5] GETTABLE 3 3 -2 ; "find"
"mainHand": {
"id": 2901,
"name": "Mining Pick",
"icon": "inv_pick_02",
"quality": 1,
"itemLevel": 4,
"tooltipParams": {
"timewalkerLevel": 15,
"azeritePower0": 0,
"azeritePower1": 0,
"mainHand": {
"id": 85663,
"name": "Herbalist's Spade",
"icon": "inv_misc_shovel_01",
"quality": 1,
"itemLevel": 4,
"tooltipParams": {
"timewalkerLevel": 15,
"azeritePower0": 0,
"azeritePower1": 0,
------------------------------------------------------------------------------
-- DevToolsFrameStack.lua
--
-- Frame stacking monitor
--
-- Globals: DevTools, SLASH_DEVTOOLS_FRAMESTACK1
-- Globals: BINDING_HEADER_DEVTOOLS
-- Globals: BINDING_NAME_DEVTOOLS_FRAMESTACK_*
---------------------------------------------------------------------------
@mooreatv
mooreatv / animation.lua
Created July 12, 2019 23:37
Sample animation... showing SetFromAlpha and SetToAlpha apparently backward
if TST then
TST:Hide()
end
TST = CreateFrame("Frame")
local f = TST
f:SetSize(1,1)
f:SetScale(2) -- show pixels / zoom
local tg = f:CreateTexture()
@mooreatv
mooreatv / animation.lua
Created July 13, 2019 00:54
Sample glowing animation
if TST then
TST:Hide()
end
TST = CreateFrame("Frame")
local f = TST
f:SetSize(1,1)
f:SetScale(0.5) -- show pixels / zoom
local tg = f:CreateTexture()
@mooreatv
mooreatv / bindings.csv
Last active July 30, 2019 06:18
Dynamic Boxer Keybinds export example
Binding First key Second key
--- Movement Keys ---
MOVEANDSTEER BUTTON3
MOVEFORWARD W UP
MOVEBACKWARD S DOWN
TURNLEFT A LEFT
TURNRIGHT D RIGHT
STRAFELEFT Q
STRAFERIGHT E
JUMP SPACE NUMPAD0
@mooreatv
mooreatv / minimal_scroll.lua
Created August 6, 2019 22:11
Minimal Scrolling Editbox (wow addon / lua)
local s = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate") -- or your actual parent instead
s:SetSize(300,200)
s:SetPoint("CENTER")
local e = CreateFrame("EditBox", nil, s)
e:SetMultiLine(true)
e:SetFontObject(ChatFontNormal)
e:SetWidth(300)
s:SetScrollChild(e)
local text = ""
for i=1,100 do
@mooreatv
mooreatv / ahdump.lua
Created August 12, 2019 08:15
Wow classic stress test dump of AH
AHSaved = {
["ah"] = {
{
["char"] = "Mooreatv",
["ts"] = 1565597097,
["data"] = {
{
["info"] = {
"Short Bastard Sword of the Eagle", -- [1]