User:Kaydeethree/Macros
Some useful macros to get information from the game. Remember that all of these macros are one line long!
Readd /run
/dump (function() RunScript=function(arg) loadstring(arg)(); end; end)()
Item info
This macro will dump the name of the item on the cursor, its ID, and the path to its texture to the chatframe. To use this macro, bind it to a key, pick up an item so the cursor turns blue, then hit the key bound to this macro. Note that this macro only works for items in your inventory/bags.
/run local i,j,k=GetCursorInfo()if i=="item" then ChatFrame1:AddMessage(k..j..GetItemIcon(j)) end
Example output:
- [Tigole's Trashbringer]32824Interface\Icons\INV_Sword_48
Vendor info
This macro will dump the name/texture of every item getting sold by the current vendor window, as well as the cost (in copper) and the quantity/itemLink of any loot tokens required.
/run local s,a,b,n,t,p,x='' for i=1,GetMerchantNumItems()do n,t,p,_,_,_,x=GetMerchantItemInfo(i)if x then s='' _,_,x=GetMerchantItemCostInfo(i)for j=1,x do _,a,b=GetMerchantItemCostItem(i,j)s=s..a..b..' 'end end ChatFrame1:AddMessage(n..p..t..' '..s)end
Example output:
- Khadgar's Hood of Triumph0Interface\Icons\inv_helmet_146 75[Emblem of Triumph] 1[Trophy of the Crusade]
- Khadgar's Gauntlets of Triumph0Interface\Icons\inv_gauntlets_79 45[Emblem of Triumph] 1[Trophy of the Crusade]
- Khadgar's Robe of Triumph0Interface\Icons\inv_chest_cloth_75 75[Emblem of Triumph] 1[Trophy of the Crusade]
- Khadgar's Leggings of Triumph0Interface\Icons\inv_pants_cloth_33 75[Emblem of Triumph] 1[Trophy of the Crusade]
- Khadgar's Shoulderpads of Triumph0Interface\Icons\inv_shoulder_110 45[Emblem of Triumph] 1[Trophy of the Crusade]
Example output with items that cost gold: (24 and 6 40, respectively)
- Blackflight Arrow2400Interface\Icons\INV_Misc_Ammo_Arrow_01
- Terrorshaft Arrow2400Interface\Icons\INV_Misc_Ammo_Arrow_01
- Ironbite Shell2400Interface\Icons\INV_Misc_Ammo_Bullet_06
- Frostbite Bullets2400Interface\Icons\INV_Misc_Ammo_Bullet_06
- Blacksteel Throwing Dagger640Interface\Icons\INV_Weapon_ShortBlade_24
- Jagged Throwing Axe640Interface\Icons\INV_ThrowingAxe_01
Questlog info
This macro will run through your entire quest log and dump as much information as it can get to the frame.
/run local s,l,t,g,h,d for i=1,GetNumQuestLogEntries()do s,l,t,g,h,_,_,d=GetQuestLogTitle(i)if not h then t=t or'' g=g or'' if g==0 then g='' end d=d or'' s=strsub(GetQuestLink(i),19)..t..g..d end ChatFrame1:AddMessage(s)end
Example output:
- Borean Tundra
- 11897:71[Plug the Sinkholes]
- Dragonblight
- 12462:73[Breaking Off A Piece]
- 12464:73[My Old Enemy]Group3
6.0 version:
/run local g,h,i,s for i=1,GetNumQuestLogEntries()do s,_,g,h = GetQuestLogTitle(i) if g==0 then g='' end if not h then s=GetQuestLink(i):sub(19) end ChatFrame1:AddMessage(s..g)end
Quest rewards
This macro will print out roughly the same info as the item macro above, but only when you're about to choose a quest reward from the NPC.
/run local l,c='',ChatFrame1;c:AddMessage(GetTitleText())for i=1,GetNumQuestChoices()do local n,t=GetQuestLogChoiceInfo(i);t=t or '';l=GetQuestItemLink("choice",i)c:AddMessage(l..' '..tonumber(l:match("item:(%d+)"))..t)end
Example output:
- [10-30] Rescuing the Rescuers
- [Earthspike]35809Interface\Icons\INV_Weapon_ShortBlade_05
- [Elekk-Horn Crossbow]35811Interface\Icons\INV_Weapon_Crossbow_21
- [Pacifying Pummeler]35810Interface\Icons\INV_Mace_67
- [Bramblethorn Greatstaff]35807Interface\Icons\INV_Staff_50
- [Coldstone Cutlass]35808Interface\Icons\INV_Sword_110
- [Cragthumper]35812Interface\Icons\INV_Mace_65
NPC info
The 6.0 version will also pull coords from the minimap if those macros were called before this one is. Make sure that colorblind mode is on (Esc->Interface->Help) to get the reaction text.
/run local s,t='','target'for i=1,GameTooltip:NumLines()do local m=_G["GameTooltipTextLeft"..i]s=s..' '..m:GetText()end ChatFrame1:AddMessage(s..' '..UnitSex(t)..UnitCreatureType(t)..UnitGUID(t):sub(-16,-11)..MinimapZoneText:GetText()..UnitHealthMax(t))
Example output
- Linsa Neutral Tabard Vendor Level 60 The Sha'tar PvP 3Humanoid52278:59.0,46.6Terrace of Light12345
Explanation
- <Name> <Reaction> <Title> Level <##> <Rare/Elite/Boss> <Faction affiliation> <PvP tag><1=Neuter,2=Male,3=Female><Creature type><NPCID>:<Coords><Subzone><Max health>
Auto-vend grays
Straight-forward gray item one-click vend macro. Thank you Cogwheel.
/run local l; for b=0,4 do for s=0,GetContainerNumSlots(b) do l = GetContainerItemLink(b, s) if l and select(3, GetItemInfo(l)) == 0 then ChatFrame1:AddMessage("Auto-selling " .. l);ShowMerchantSellCursor(1)UseContainerItem(b, s) end end end
Minimap coords
Coordinates on the minimap title bar! This is a too big to fit into one macro--you'll need two. Run the first, then the second:
Emergency 8.0 version
/run local p="player";if not TTF then TTF=CreateFrame("Frame")end;TTF:SetScript("OnUpdate",function(s) local x,y=C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit(p),p):GetXY()MinimapZoneText:SetFormattedText("%2.1f,%2.1f",x*100,y*100)end)
Pre-8.0
/run local f=MinimapZoneText;if not TTF then TTF=CreateFrame("Frame")end;TTF:SetScript("OnUpdate",function(s) local x,y=GetPlayerMapPosition("player")f:SetFormattedText("%2.1f,%2.1f%s",x*100,y*100,GetMinimapZoneText())end)
and
/run MinimapZoneText:SetFontObject(GameTooltipTextSmall)