Macro Help :D

I’m trying to write a macro that on spell casts has a %chance to say a message or %chance to say 1 of 3 messages, however I don’t want it to say it on every cast. I’m currently using this macro, {/run RandomRoll(1,50) = A; if A=1 SendChatMessage (“Get Em”,“Say”); end} I have also tried {/run local rng = math.random(50); if rng=1 then SendChatMessage(“Get Em’”); if rng=2 then SendChatMessage("**** them up"); if rng=3 then SendChatMessage(“Attack”); end}
Any help would be appreciated.

Just wanna say I love that you’re trying to do that. It sounds really cool and good roleplay. I hope someone smarter than me can help you.

3 Likes

Thank you <3. It worked on Lua coded servers such as Vanilla WoW, but it no longer works on the new clients :frowning:. If I figure it out I’ll let you know :smiley:

1 Like

Bump to keep relevant

So, something you can do is assign a random number to a variable, e.g. /run MyVar = random(0, 9); the random function takes a start and end number and will return a random number within that range.

You can have a list of things you’d like to say, such as, MyList = ["Hello", "Hey", "What's up?", "Yo!"];

Where, if you call the greeting at the index in that list, you will get the greeting you’d expect. For example MyList[0] is “Hello”, MyList[1] is “Hey”, and so on…

However, if you call MyList[100] or any other value that is not an index of the list, then you will get nothing returned.

Using that, you should be able to do what you want to do. Here’s a more complete example to point you in the right direction:

NOTE: I’ve used 0 through 10 for the range, so this should usually not send a message.

/run randNum = random(0, 10); 
/run myList = {"Hello","Hey","What's up?","Yo!"};
/run SendChatMessage(myList[randNum], "SAY");

You could also do that in 1 line, if you prefer. Also I think /script is an alias for /run or vice versa, but they seem to do the same thing:

/script randNum = random(0, 10); myList = {"Hello","Hey","What's up?","Yo!"}; SendChatMessage(myList[randNum], "SAY");
3 Likes

Thank you so much.

1 Like

I understand all of this conversation! :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

1 Like

It’s a macro to help you roleplay on ability casts, it does it without spamming it everytime you use the ability.

I thought I understood macros, but this one went over my head.

2 Likes

It’s super fun though :smiley: you’ll get there.

Oh I know, but I don’t understand any of this stuff. I’d love to set up macros… among many other things most players do. :stuck_out_tongue_winking_eye:

Nice! Thank you, Frosto.
Let’s hear it for Frosto!

1 Like

A good macro for a mage, imo is to eat/drink at the same time.

That’s a lot less of a “programmy” type macro, and more of a “normal” macro.

#showtooltip
/use Conjured Spring Water
/use Conjured Pumpernickel

You can replace Conjured Spring Water and Conjured Pumpernickel with the names of level appropriate food and water.

:slight_smile:

3 Likes

Frosto man you are “The Man” setting that macro up is something I have wanted to do since I started Classic.

2 Likes