These general macros are designed for WoW WotLK 3.3.5a. They cover trainers, quests, mail, vendors, mounts, equipment swaps, inventory cleanup, tracking, auction-house actions and a few useful combat shortcuts. A macro can combine commands and reduce key presses, but it cannot make combat decisions or bypass the client/server rules.
Open the in-game macro window, create a macro, paste the code exactly and put it on your action bar. Use #showtooltip when you want the button to display the ability or item icon. Names of spells, items, mounts and NPCs must match your game client's language. Replace every placeholder before using a macro that deletes items, spends currency or confirms a purchase.
Macro basics
Useful command and target modifiers
/run and /script execute a Lua snippet. /cast and /use activate abilities or items. Common target modifiers include @mouseover, @focus, @target and @player. Conditions such as help, harm, exists, nodead, flyable and nomod decide when a command is used.
#showtooltip
/cast [nomod,@mouseover,help,nodead][nomod,@target] Repentance
This template casts the ability on a friendly mouseover target when one is available, otherwise on the current target. Replace Repentance with the ability you need. Add [] at the end when you want a normal-target fallback.
Trainers, quests and mail
Automatic trainer learning
With the trainer window open, repeatedly clicks the learn button. This is a client-side automation trick and may depend on the 3.3.5a client or server UI. Stop using it if the trainer behaves unexpectedly.
/run LoadAddOn("Blizzard_TrainerUI") f=ClassTrainerTrainButton f.e=0 if f:GetScript("OnUpdate") then f:SetScript("OnUpdate",nil) else f:SetScript("OnUpdate",function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end) end
Abandon the selected quest
With the quest log open, abandons the selected quest. On some clients, 1 corresponds to the first visible quest; test it before using it on a valuable quest.
/run AbandonQuest(1)
Clear combat-log entries
Clears the combat log when a UI or addon becomes stuck. It does not remove combat or reset a character's actual combat state.
/script CombatLogClearEntries()
Collect and delete the first mail item
Clicks the first mail item, the delete button and the confirmation button. Use it only when the mailbox contents and popup order are exactly as expected.
/run MailItem1Button:Click()
/run OpenMailDeleteButton:Click()
/run StaticPopup1Button2:Click()
Vendors and currency
Buy a vendor item in bulk
Buys a specified quantity from the open merchant window. Replace the item name and quantity. In an English client, common WotLK names include Emblem of Conquest, Emblem of Valor, Emblem of Heroism and Symbol of Kings.
/script local function buy(n,q) for i=1,100 do if n==GetMerchantItemInfo(i) then BuyMerchantItem(i,q) end end end buy("Emblem of Conquest",5)
Exchange several badge types
Buys several vendor items in one click. The merchant must be open, and each name must match the item name shown by your client.
/script local function buy(n,q) for i=1,100 do if n==GetMerchantItemInfo(i) then BuyMerchantItem(i,q) end end end buy("Emblem of Conquest",10); buy("Emblem of Valor",10); buy("Emblem of Heroism",10)
Mounts and equipment
Two mounts on one button
Uses the flying mount while flying is possible and the ground mount otherwise. Replace both names with mounts in your collection.
#showtooltip
/use [flyable] Flying Mount Name
/use [noflyable] Ground Mount Name
Swap to a one-hand weapon and shield
Equips a one-hand weapon in slot 16 and a shield in slot 17. Replace the names with the exact items in your bags or equipment sets.
/equipslot 16 One-Hand Weapon Name
/equipslot 17 Shield Name
Set the maximum camera distance
Sets the camera distance CVar to 120. If your server/client limits the value, the game will use its own maximum.
/script SetCVar("cameraDistanceMax",120)
Inventory cleanup
Delete all grey items
Deletes every poor-quality (grey) item from bags 0–4. This is destructive: check your bags first and keep valuable grey quest or transmog items elsewhere.
/script ClearCursor() local g,i,j,s,a,b=gsub; for i=0,4 do for j=1,GetContainerNumSlots(i) do s=GetContainerItemLink(i,j) if s then a,b,s=GetItemInfo(g(g(s),"|H",""),"|h.","") if s==0 then PickupContainerItem(i,j) DeleteCursorItem() end end end end
Delete all green items
Deletes every green-quality item in bags 0–4 by checking the item link color. Do not use it if you keep green quest, profession or cosmetic items.
/run for bag=0,4,1 do for slot=1,32,1 do local link=GetContainerItemLink(bag,slot); if link and string.find(link,"cff1eff00") then PickupContainerItem(bag,slot); DeleteCursorItem(); end end end
Delete a named item from your bags
Deletes every bag item whose link contains the text in Item Name. Replace the placeholder carefully; use a distinctive part of the item name.
/run for bag=0,4,1 do for slot=1,32,1 do local link=GetContainerItemLink(bag,slot); if link and string.find(link,"Item Name") then PickupContainerItem(bag,slot); DeleteCursorItem(); end end end
Gathering and farming
Toggle ore and herb tracking
Creates a small timer that alternates tracking types every three seconds, then toggles the timer on or off. The tracking IDs may differ on custom servers; if the two types are reversed, swap 1 and 2.
/run if not THO then local f,t,c=CreateFrame("Frame","THO"),1,0 f:SetScript("OnUpdate",function(_,e) c=c+e if c>3 then c=0 SetTracking(t) if t==1 then t=2 else t=1 end end end) THO:Hide() end
/run if THO:IsVisible() then THO:Hide() else THO:Show() end
Solo mining vehicle farm
Switches to vehicle seat 2, targets the named object and uses the vehicle ability, then returns to seat 1. Replace the target and spell names with the names used by your server.
#showtooltip
/run UnitSwitchToVehicleSeat("player",2)
/target Liquid Sulfuron
/cast Hook the Crate
/run UnitSwitchToVehicleSeat("player",1)
Loot, DKP and auction house
Master-loot all items to a named player
Gives every item in the open loot window to the first raid member matching the player name. Replace PlayerName. The character must be the master looter and the loot window must be open.
/run for ci=1,GetNumRaidMembers() do if GetMasterLootCandidate(ci)==UnitName("PlayerName") then for li=1,GetNumLootItems() do GiveMasterLoot(li,ci) end end end
Spend DKP on the target
Sends a guild-addon command for a 1000-point deduction and the reason “AFK”. This requires the same DKP addon and permissions on your server; change the amount and reason before use.
/script local Name="/qdkp do "..UnitName("target").." spend 1000 for afk"; DEFAULT_CHAT_FRAME.editBox:SetText(Name); ChatEdit_SendText(DEFAULT_CHAT_FRAME.editBox,0)
Place an auction bid
Clicks the currently focused auction row, the bid button and the confirmation button. Confirm that the correct auction is selected before pressing it.
/run local f=GetMouseFocus(); if f then f:Click() end
/run BrowseBidButton:Click()
/run StaticPopup1Button1:Click()
Buy out an auction
Clicks the currently focused auction row, the buyout button and the confirmation button. This can spend a large amount of gold immediately.
/run local f=GetMouseFocus(); if f then f:Click() end
/run BrowseBuyoutButton:Click()
/run StaticPopup1Button1:Click()
Sound and target utility
Restart the game sound system
Restarts the sound system when audio stops working without logging out.
/run Sound_GameSystem_RestartSoundSystem()
Use an ability on mouseover or target
Uses the ability on a living friendly mouseover unit first, then on the current target. Replace Repentance with the desired ability. Add [] as a final fallback if your setup needs to cast on yourself.
#showtooltip
/cast [nomod,@mouseover,help,nodead][nomod,@target] Repentance
Important limitations
Many /run examples depend on the 3.3.5a client UI, a custom server, a DKP addon or a specific popup/button layout. Blizzard's protected-action rules also prevent a macro from fully automating combat or making arbitrary decisions. Test each macro on a dummy or with cheap items first, and reload the UI if a macro leaves a stale frame or timer.
For a deeper explanation of macro creation, combat commands, target modifiers, conditions and key modifiers, see the World of Warcraft macro guide. The original community macro collection is also useful as a reference, but always adapt spell and item names to your client.



