User:Choonster

Item Link
/run SendChatMessage(" First half of message "..select(2,GetItemInfo( ItemID )).." Second half of message ","CHANNEL",nil,GetChannelName("Trade - City")) This will output the following to Trade: First half of message [ItemLink] Second half of message Change  ItemID  to the ID of the item you want to link. ItemIDs can be found on the end of the Armory or Wowhead URL of that item's page. us.battle.net/wow/en/item/ 40703 

www.wowhead.com/item= 62232 

Random Phrases
/cast Spell /run local t=( "Phrase1","Phrase 2","Phrase 3",etc. ) SendChatMessage(t[random(#t)], "ChatTypeId","Language","Channel" )

Replace the bold/underlined fields with the appropriate values.  "PhraseX"  = "Eat hot lava, creep!", etc. Put as many phrases as you want in here, each contained in quotation marks and separated by commas.  "ChatTypeId"  = Type of Chat  "Language"  = "GOBLIN" to send the message in the Goblin language, "ORCISH" ("COMMON" for Alliance) or nil for Orcish (Common for Alliance)  "Channel"  = Numeric value of a chat channel for ChatTypeId="CHANNEL" or player name for ChatTypeId="WHISPER"

The last three fields can be omitted if you just want the phrases in /s in Orcish.

Emotes or chat channels:
/equipset [spec:1] sub; throw /run local e=" EMOTE " if GetActiveTalentGroup==1 then SendChatMessage(" Replace this with the message to send while in your primary spec ([spec:1]) ",e,nil,nil) else SendChatMessage(" Replace this with the message to send while in your secondary spec ([spec:2]) ",e,nil,nil) end

Replace EMOTE with any other Chat Type ID if you don't want /e messages. If using a chat channel or whisper, replace the second nil in each SendChatMessage with the channel number or name to whisper (name has to be in quotation marks). Replace the bolded/underlined phrases with the appropriate messages.

Chat Frame Message (only visible to you):
/equipset [spec:1] sub; throw /run local D=DEFAULT_CHAT_FRAME if GetActiveTalentGroup==1 then D:AddMessage(" Replace this with the message to send while in your primary spec ([spec:1]) ") else D:AddMessage(" Replace this with the message to send while in your secondary spec ([spec:2]) ") end

Replace the bolded/underlined phrases with the appropriate messages.

In both macros you can replace GetActiveTalentGoup==1 with a different function for a different conditional.

Cooldown Chat Message
/run local S=" Spell Name " B,D,_=GetSpellCooldown(S) SendChatMessage(S.." has "..(B+D-GetTime).." seconds left on its cooldown."," ChatTypeId ",nil,"  Channel ")

Duration Chat Message
/run local S=" Spell Name " B,D,_=GetSpellCooldown(S) (B+D-GetTime)=C SendChatMessage(C< X  and S.." has "..( X -C).." seconds remaining."..or C.." is inactive."," ChatTypeId ",nil,"  Channel ")

Cooldown Chat Frame Message (only visible to you)
/run local S=" Spell Name " B,D,_=GetSpellCooldown(S) print(S.." has "..(B+D-GetTime).." seconds left on its cooldown.")

Duration Chat Frame Message (only visible to you)
/run local S=" Spell Name " B,D,_=GetSpellCooldown(S) (B+D-GetTime)=C print(C< X  and S.." has "..( X -C).." seconds remaining."..or C.." is inactive.")

Replace the bold/underlined fields with the appropriate values: Spell Name = Name of spell to base message on ChatTypeid = ChatTypeId Channel = Numeric value of chat channel or name of person to whisper (name must be in quotation marks) X = Spell cooldown - Spell duration (in seconds)

Mount/Companion Macros
Indices are explained here.

Completely random companions
/run SummonRandomCritter

Random companion from a specified pool
/run local c={''' c1,c2,c3,etc. '''} CallCompanion("CRITTER",c[random(#c)]) Replace ''' c1,c2,c3,etc. ''' with the indices of your companions.

Random companion with exceptions
/run local r,c,t=random,"CRITTER"t={r( X-1 ),r( X+1 , Y-1 ),r( Y+1 , Z-1 ),r( Z+1 ,GetNumCompanions(c))}CallCompanion(c,t[r(#t)]) Where  X,Y,Z  are indices of companions you don't want the macro to summon. This pattern can be repeated as many times as needed to exlude any number of companions (at a certain point it becomes more efficient to specify which companions you do want to summon rather than which ones you don't).  X,Y,Z  must be in ascending order from left to right. i.e. X < Y < Z

Correct Usage
X=10, Y=20, Z=25

t={r( 9 ),r( 11 , 19 ),r( 21 , 24 ),r( 26 ,GetNumCompanions(c))}

Incorrect Usage
X=20, Y=10, Z=25

t={r( 19 ),r( 21 , 9 ),r( 11 , 24 ),r( 26 ,GetNumCompanions(c))}

Completely random mounts
/run if not IsMountedand IsOutdoorsthen CallCompanion("MOUNT",random(GetNumCompanions("MOUNT)))end

Random mounts from a specified pool
/run if not IsMountedand IsOutdoorsthen local i={''' i1,i2,i3,i4,etc. '''} CallCompanion("MOUNT",i[random(#i)])end Replace ''' i1,i2,i3,i4,etc. ''' with the indices of your mounts.

Smart random flyer/ground mount
/run if not IsMountedand IsOutdoorsthen local f,g={''' f1,f2,f3,f4,etc. },{ g1,g2,g3,g4,etc. '''} local t=IsFlyableAreaand f or g CallCompanion("MOUNT",t[random(#t)])end Replace ''' f1,f2,f3,f4,etc.  with the indices of your flying mounts and  g1,g2,g3,g4,etc. ''' with the indices of your ground mounts.

Smart random aquatic/flyer/ground mount
/run if IsOutdoors and not IsMountedthen local g,f,s,z={''' f1,f2,f3,f4,etc. },{ g1,g2,g3,g4,etc. }, s ''',GetRealZoneTextlocal t=(z=="Kelp'thar Forest"or z=="Shimmering Expanse"or z=="Abyssal Depths"or z=="Vashj'ir")and IsSwimmingand not IsModifierKeyDownand s or IsFlyableAreaand f or g CallCompanion("MOUNT",t[random(#t)])end Replace ''' f1,f2,f3,f4,etc.  with the indices of your flying mounts,  g1,g2,g3,g4,etc.  with the indices of your ground mounts and  s ''' with the index of your Seahorse (usually 1). This is only useful when you get the Seahorse from Vashj'ir at 80 or above. It also won't fit in a regular macro and as such requires an addon such as BindPad that allows for longer macros.

Random companion and smart random flyer/ground mount
/run SummonRandomCritterif not IsMountedand IsOutdoorsthen local f,g={''' f1,f2,f3,f4,etc. },{ g1,g2,g3,g4,etc. '''} local t=IsFlyableAreaand f or g CallCompanion("MOUNT",t[random(#t)])end Replace ''' f1,f2,f3,f4,etc.  with the indices of your flying mounts and  g1,g2,g3,g4,etc. ''' with the indices of your ground mounts.

Random companion from a specified pool and smart random flyer/ground mount
/run local c={''' c1,c2,c3,etc. } CallCompanion("CRITTER",random(#c))if not IsMountedand IsOutdoorsthen local f,g={ f1,f2,f3,f4,etc. },{ g1,g2,g3,g4,etc. '''} local t=IsFlyableAreaand f or g CallCompanion("MOUNT",t[random(#t)])end Replace ''' c1,c2,c3,etc.  with the indices of your companions,  f1,f2,f3,f4,etc.  with the indices of your flying mounts and  g1,g2,g3,g4,etc. ''' with the indices of your ground mounts.

Main/Off Hand Weapon Swap Macro
Make an equipment set called  WeaponAMain  with  WeaponA  in your main hand,  WeaponB  in your off hand and all other slots ignored. Make another set called  WeaponBMain  with  WeaponB  in your main hand,  WeaponA  in your off hand and all other slots ignored.

/run UseEquipmentSet((select(1,GetItemInfo(GetInventoryItemID("player",16)))==" WeaponA ")and" WeaponBMain "or" WeaponAMain ") Replace the bold/underlined parts with the appropriate names.

Shaman Weapon Imbue Macro
/use [@none]Imbue Name /use 17 /click StaticPopUp1Button1
 * 1) showtooltip

This will enchant your off hand weapon, replace 17 with 16 for the main hand. @none is the key to this macro, it tells a spell to cast at "no target", bringing up a blue-outline hand cursor that you can then click on something with to cast the spell at it. /use 17 then acts as if you clicked on your off hand weapon, telling the macro to cast the imbue on it. /click StaticPopUp1Button1 then clicks the OK button on the confirmation popup. You can use modifiers or mouse buttons if you want to have multiple imbues in the same macro.