Jump to content
Macro Express Forums

Launching Random Macros in ME pro


Recommended Posts

ok, so I have been working on something the last few days, I have made several Macros that "call" different functions for an extensive macro I am working on.

so far I have 8 macros that call each other after the currant macro comes to an end. for example, Macro 1 (hotkey Ctrl+numpad 1) runs, at the end of the macro it calls the next macro by the hotkey (Ctrl+numpad 2), that macro runs and then calls the next macro. each macro has an "END" command after calling the next macro to make sure each macro closes when done and doesn't stay running in the background. what I want to do is have some way to randomize the macro that is called. for example, macro 1 finishes, calls a random macro ranging from (hotkey Ctrl+1 to Ctrl+6). I would prefer they be called using the hotkeys since thats how I have them setup, but any way to randomize the macro calling would be helpful for this
Thanks!

Link to comment
Share on other sites

Something like this might work:

Variable Set Integer %MacroNumber% to a random value between 1 and 8
Switch( %MacroNumber% )
Case: 1
  Macro Run: Macro 1
End Case
Case: 2
  Macro Run: Macro 2
End Case
Case: 3
  Macro Run: Macro 3
End Case
Case: 4
  Macro Run: Macro 4
End Case
Case: 5
  Macro Run: Macro 5
End Case
Case: 6
  Macro Run: Macro 6
End Case
Case: 7
  Macro Run: Macro 7
End Case
Case: 8
  Macro Run: Macro 8
End Case
End Switch

 

Link to comment
Share on other sites

2 hours ago, Samrae said:

Something like this might work:


Variable Set Integer %MacroNumber% to a random value between 1 and 8
Switch( %MacroNumber% )
Case: 1
  Macro Run: Macro 1
End Case
Case: 2
  Macro Run: Macro 2
End Case
Case: 3
  Macro Run: Macro 3
End Case
Case: 4
  Macro Run: Macro 4
End Case
Case: 5
  Macro Run: Macro 5
End Case
Case: 6
  Macro Run: Macro 6
End Case
Case: 7
  Macro Run: Macro 7
End Case
Case: 8
  Macro Run: Macro 8
End Case
End Switch

 

so, going by this, I am assuming the %macronumber% refers to the macro index number in the macro list?

macro list.bmp

Link to comment
Share on other sites

I got it, thanks Samrae! I had a little brain fart when I looked at your code, then when I actually started to set it up, I noticed you were talking about the macro "nickname" not the index number LOL! so far seems to be working great, Thanks again!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...