I’m trying to make a trade chat macro that has a clickable link of the item I’m crafting and it’s rank. I’m only able to copy/paste the item’s name itself, not clickable.
/run local link = select(2, C_Item.GetItemInfo(114821)) SendChatMessage("I't a bag! " .. link, "SAY")
Pick your channel
I have no experience with programming at all and don’t know what to do with that. I copy the whole thing, but where do I replace what you sent with the item I want to link? Does it matter that it’s an item I’m linking from my craft window, and not an item in my bag?
Replace 114821 with the item id you want to link.
/say /run local link = select(2, C_Item.GetItemInfo(Binding of Binding)) SendChatMessage("I’t a bag! " … link, “/say”)
That’s what I put in my macro and it doesn’t link the item, it just repeats that line of code. When I tried it without the /say in the front, nothing happens.
Well, don’t /say.
It’s hard to tell what’s happening in the macro, because what you show doesn’t match what Fizzlemizz suggested, but that may not be your fault. (The forum mangles things in ways that work for normal text but are bad for code.) So it’s hard to know what you entered into the game.
The safest thing is to copy the entire code snippet directly from Fozzlemizz’s forum post (there appears to be a button for that) and then paste it directly into the chat window. Trying to eyeball it and type probably doesn’t work; unless you know the syntax of the script language, you will almost certainly change something critical without realizing it.
I will note that you changed something that probably broke it. The end of the example given was
SendChatMessage("I't a bag! " .. link, "SAY")
But you changed it to
SendChatMessage("I't a bag! " .. link, "/say")
Which is wrong and probably explains why it didn’t work.
Don’t retype. Copy and paste.
/run local link = select(2, C_Item.GetItemInfo(215133)) SendChatMessage("I't a bag! " .. link, "SAY")
You need the itemID you can look it up on wowhead or get an addon that puts it in the tooltip. Make sure you use 2 dots between your text line and the word link.
You should be able to
/run local link = select(2, C_Item.GetItemInfo("Binding of Binding")) if link then SendChatMessage("I't a bag! " .. link, "CHANNEL", nil, 2) else print ("No link for that item!") end
To break it down…
Get the link:
local link = select(2, C_Item.GetItemInfo("Binding of Binding"))
You can use the item name ("Binding of Binding")
if the item is in your inventory and already cached.
SendChatMessage("I't a bag! " .. link, "CHANNEL", nil, 2)
"I't a bag! "
Just some text for the message
..
combine to pieces of text together
link
append the link to the text.
"CHANNEL"
You want to send the text to a chat channel (trade)
2
The channel you want to send the text to, 2 (trade)
The rest is just a message if you try to link an item that doesn’t exist (or is not cached yet).
Ok, so I got it to link the item in my macro, but is there a way to shorten it, or increase the maximum number of characters allowed in a macro? When I try to link my trade skills, even without a message, I can’t because it exceeds the 255 count. I want my macro to say “Enchanting Jewelcrafting LFW! Crafting all crests and (Binding of binding)”
What’s the full macro you have now?
/run local link = select(2, C_Item.GetItemInfo(“215133”)) if link then SendChatMessage(“[Jewelcrafting] LFW Crafting” … link, “CHANNEL”, nil, 2) else print (“No link for that item!”) end
That’s 241 of 255 characters. I tried remove the “LFW Crafting” part but it will still only let me link one profession.
Well you definitely don’t need the else.
/run local link = select(2, C_Item.GetItemInfo("215133")) if link then SendChatMessage("[Jewelcrafting] LFW Crafting" … link, "CHANNEL", nil, 2) end
but ya, profession links contain a lot of hidden characters.
I found an addon called “M6” which seems to let me make a macro longer than 255 characters. If it works, what would a macro look like adding the itemID of the binding of binding ring, my enchanting skill, and my jewelcrafting skill?
As of 11.0 no macros can be over 255 chars whether they’re done in the default macro system or via an addon.
It may not be enough but you can shorten your variable name to a single letter and there is some whitespace you can eliminate.
/run local link = select(2, C_Item.GetItemInfo("215133")) if link then SendChatMessage("[Jewelcrafting] LFW Crafting" … link, "CHANNEL", nil, 2) end
Could be shortened to
/run local l=select(2,C_Item.GetItemInfo("215133")) if l then SendChatMessage("[Jewelcrafting] LFW Crafting"..l,"CHANNEL",nil,2)end
I think that saved 17 characters and I didn’t test it but you may be able to remove the space before the ‘if’
You don’t want the quotes if you’re using an item ID. for C_Item.GetItemInfo()
Link 2 items
/run local c,s,a,b=C_Item.GetItemInfo,select a=s(2,c(215133))b=s(2,c(114821))if a then SendChatMessage(format("[Jewelcrafting] LFW Crafting %s, %s",a,b),"CHANNEL",nil,2)end