WoW Lua Snippets

Check quest completion

/script print(IsQuestFlaggedCompleted(1952))
/run SendChatMessage(format("WTS %s (226) 725k ",select(2,GetItemInfo("item:183010:0:0:0:0:0:0:0:0:0:0:0:4:7187:6652:1498:6646"))),CHANNEL,nil,GetChannelName("Trade - City"))

Gamma toggle

Toggles gamma setting between 1.0 and 0.8.

/run local g="gamma";local m=GetCVar(g); if tonumber(m)==1 then m=.8 else m=1 end; SetCVar(g,m); print("Gamma:",m)

Nameplate stacking toggle

Toggles nameplate setting between overlapping and stacking

/run local m="nameplateMotion";local n=GetCVar(m); if tonumber(n)==1 then n=0 else n=1 end; SetCVar(m,n); print("nameplate stacking:",n)
view raw _general.md hosted with ❤ by GitHub

Quick dismiss pet

/use [nopet] Call Pet
/cast [pet]Steam Tonk Controller
/cancelaura Steam tonk Controller
/use [nopet] Call Pet

Pet attack totems

/petattack Grounding Totem
/petattack Windfury Totem
/petattack Poison Cleansing Totem
/petattack Tremor Totem
/petattack Mana Tide Totem

Craft single recipe

/run C_TradeSkillUI.CraftRecipe(139176) 

Enchant equipped item

/script TradeSkillFrame.DetailsFrame:Create();
/use 6
/click StaticPopup1Button1
view raw crafting.md hosted with ❤ by GitHub
local commands = {
        "ACTIONBUTTON",
        "MULTIACTIONBAR1BUTTON",
        "MULTIACTIONBAR2BUTTON",
        "MULTIACTIONBAR3BUTTON",
        "MULTIACTIONBAR4BUTTON"
    }
    for _,comma in pairs(commands) do
        for i = 1,12 do
            local fcommand = comma .. i
            print("|cffffff00"..fcommand,"|cffffffff"..(GetBindingKey(fcommand) or ""))
            if GetBindingKey(fcommand) then
            -- clear binding
                SetBinding(GetBindingKey(fcommand))
            -- tinsert binding
            end
        end
    end
    local elvui_commands = {
        "ELVUIBAR6BUTTON",
        'EXTRABAR7BUTTON',
        'EXTRABAR8BUTTON',
        'EXTRABAR9BUTTON',
        'EXTRABAR10BUTTON',
    }
    for _,comma in pairs(elvui_commands) do
        for i = 1,12 do
            local fcommand = comma .. i
            print("|cffffff00"..fcommand,"|cffffffff"..(GetBindingKey(fcommand) or ""))
            if GetBindingKey(fcommand) then
            -- clear binding
                SetBinding(GetBindingKey(fcommand))
            -- tinsert binding
            end
        end
    end
    local elvui_bars = {
        'ElvUI_Bar6Button',
        'ElvUI_Bar7Button',
        'ElvUI_Bar8Button',
        'ElvUI_Bar9Button',
        'ElvUI_Bar10Button',
    }

    -- non elvui
    for _,comma in pairs(commands) do
        for i = 1,12 do
            local fcommand = comma .. i
            if bind_key_from_table then
                SetBinding(key,fcommand)
            end
        end
    end

    -- elvui
    for j=1,#elvui_commands do -- 1 to 5
        for i = 1,12 do
            local button = elvui_bars .. i
            local command = elvui_commands .. i

            local keybind = get_binding_from_table(class,spec,command)
            SetBindingClick(keybind,button)
        end
    end

Spectral Sight, Consume Magic for

/cancelaura Spectral Sight
/cast [mod:alt] Spectral Sight; [@mouseover,harm,nodead] [] Consume Magic

Taunt Arena Pets

#showtooltip
/cast [@arenapet1] Torment
/cast [@arenapet2] Torment
/cast [@arenapet3] Torment

Open great vault frame

/run LoadAddOn("Blizzard_WeeklyRewards"); WeeklyRewardsFrame:Show()

Open soulbind viewer frame (??)

/run LoadAddOn("Blizzard_Soulbinds"); SoulbindViewer:Show()

Play sound on bottled anima cast

/run if not fqqf then fqqf=CreateFrame("Frame") end;fqqf:SetScript("OnUpdate",function()local spell = UnitCastingInfo("focus")if (spell == "Bottled Anima") then PlaySoundFile(1410435)end end)
view raw shadowlands.md hosted with ❤ by GitHub