Looking to randomize within a macro

Since the patch removed the function GetRandomArgument for some reason, does anyone know of a way to randomize sayings?
For example

/script SendChatMessage(GetRandomArgument("Hello Trade","Howdy Trade","Hola Trade"),"channel",nil,2)

used to work just fine, and now it’s broken. (Not the literal macro I was using, just one I wrote up for this thread.)

A macro that can randomize between macros, or randomize the arguments, or if I can put it into an addon to add that function back to the UI?

Someone @Fizzlemizz for me. <3

/run local t = {"Hello Trade", "Howdy Trade", "Hola Trade"} SendChatMessage(t[random(#t)], "CHANNEL", nil, 2)
2 Likes

The literal translation from pre 9 would be
/script SendChatMessage(select(random(select("#", "Hello", "Howdy", "Hola")), "Hello", "Howdy", "Hola").." Trade","channel",nil,2)

but Ketho’s way also works with less typing :slight_smile:

2 Likes

Aaactually nevermind I figured it out, I needed to run the club = section on the same line as the t = section, THANK YOU BOTH!

1 Like