Macro to send Messages on Modifiers to multiple channels

Hi

was trying to make a macro that can send Messages on Modifiers to multiple channels

Macro

/run SendChatMessage(SecureCmdOptionParse("[mod:shift]{rt1} Test2 {rt1};[mod:ctrl]{rt7} Test3 {rt7};[mod:alt]{rt4}{rt4} test4 {rt4}{rt4};{rt2} Test {rt2} Clear Chat"), “CHANNEL”, nil, GetChannelName(4,5))

but it will only send it to channle 4. what I need to do so it can send it to channels 4 and 5 or more

Grab https://www.curseforge.com/wow/addons/macro-talk use the /opt command.

anyone know what is missing in this macro? to make it send messages in multiple channels?

You can’t send a single message to multiple channels at the same time. You’ll need to use a loop or some other method to send it to each channel.

You can use IsShiftKeyDown() and similar fucntions to check for modifier and for loop to iterate though channels, something like:

/run for i=5,6 do if IsShiftKeyDown() then SendChatMessage("{rt1} Test2 {rt1}","CHANNEL",_,i) elseif IsAltKeyDown() then SendChatMessage("{rt7} Test3 {rt7}","CHANNEL",_,i)end end
1 Like

yes u can

/run local msg="{rt2} test {rt2}";local channels = {4,5,6,7};for k,v in pairs(channels) do SendChatMessage(msg, “CHANNEL”, GetDefaultLanguage(unit), v) end

but don’t know how to use modifiers with this one

That’s using a loop…

/run for i=5,6 do if IsShiftKeyDown() then SendChatMessage("{rt1} Test2 {rt1}",“CHANNEL”,,i) elseif IsCtrlKeyDown() then SendChatMessage("{rt7} Test3 {rt7}",“CHANNEL”,,i)
elseif IsAltKeyDown() then SendChatMessage("{rt7} Test4 {rt7}",“CHANNEL”,_,i)end end end

Yours work fine but Tried this but it didnt work and no idea how to add the non modifier. not a coder I just cheat.

Untested.

/run local c = {4,5} for k,v in pairs(c) do SendChatMessage(SecureCmdOptionParse("[mod:shift]{rt1} Test2 {rt1};[mod:ctrl]{rt7} Test3 {rt7};[mod:alt]{rt4}{rt4} test4 {rt4}{rt4};{rt2} Test {rt2} Clear Chat"), "CHANNEL", nil, v)end
1 Like

works fine thanks

one last thing and it will be perfect if possible. to also send a message to Party/Raid channel same time

local c = {4,5,"PARTY","RAID"}

your the best thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.