joe
Full Member
Posts: 46
|
Post by joe on Sept 30, 2022 3:56:11 GMT
I created ten macros, lets call them A, B, C, D, E, F, G, H, I, and J. Can I create a macro that will pick one of those ten macros above at random, and then play it? I think I need to use integer variables and random numbers conditions but I didn't really understand how. Can someone please help?
|
|
|
Post by Steve on Oct 1, 2022 21:37:21 GMT
Hi joeThis can be done a few way in MMM. For this example I have declared %RANDOM% variable (RAND) to hold a number between 1 and 5. The macro then has some logic to determine that number and load a macro. More on working with random numbers here www.turnssoft.com/conditions.html#random_integer_variable. 1 | RUN ACTION | DEFINE INTEGER VARIABLE | %RAND%::%RANDOM_0-5% 2 | RUN ACTION | MESSAGE PROMPT | RAND = %RAND%::Random::1::OK 3 | IF | INTEGER VARIABLE | %RAND% | = | 1 | LOAD MACRO | D:\Dropbox\Macro\A.mmmacro 4 | IF | INTEGER VARIABLE | %RAND% | = | 2 | LOAD MACRO | D:\Dropbox\Macro\B.mmmacro 5 | IF | INTEGER VARIABLE | %RAND% | = | 3 | LOAD MACRO | D:\Dropbox\Macro\C.mmmacro 6 | IF | INTEGER VARIABLE | %RAND% | = | 4 | LOAD MACRO | D:\Dropbox\Macro\D.mmmacro 7 | IF | INTEGER VARIABLE | %RAND% | = | 5 | LOAD MACRO | D:\Dropbox\Macro\E.mmmacro
|
|
joe
Full Member
Posts: 46
|
Post by joe on Oct 2, 2022 4:59:34 GMT
Thanks for replying Steve! I will look into this over the next day or two.
|
|
joe
Full Member
Posts: 46
|
Post by joe on Oct 2, 2022 5:57:34 GMT
Thanks again, Steve!
I got it to work and it was a lot easier than I though it would be.
|
|