HalloweenBob Posted October 25, 2016 Report Share Posted October 25, 2016 I have created a series of 41 short macros which are all nearly identical. They all do the same functions but pull up different files to work with. For anyone interested in what kind of files these are, they are routines created in software designed to control animatronic robots for a Halloween display. each routine is a different length and has different content. I made the individual macros that first calculate how long the routine runs, then opens the software and starts it while counting down a timer, then 10 seconds after the timer runs out (Which was set to the length of the routine) it would unload the routine and shut down the software. I wrote a second simple routine that basically just plays each of the smaller routines in a row, waiting for each routine to complete before starting the next one, so that I could leave the display running unattended for long periods of time. What I want to do, is to treat the small macros like a playlist as though it were a music program. It would load up all 41 macros, and execute them in a random order until they were all played and then repeat. It would repeat forever until I shut it down. The rules would be that: 1. It would only play each macro once within a rotation before reloading them all to start again. 2. The order would be random, without the possibility of repeating a macro within that rotation. 3. When repeating the rotation, it would again be random and not repeat the same pattern as before, and 4. It would never play the same file for a second time, if that file had been played within the last 10 files. (For example, if the first rotation played all the files, and ended with file 41, the next rotation could not play file 41 again until 10 other files had been played first. If the random pattern chose macro 41, and it had been less that 10 macros since it was played previously, it would recalculate and choose the next random number instead, assuming that it, too had not been played in the last 10 plays. basically it would have to keep track continuously of the last 10 files played in an array that would add a file every play and drop one off the end on every play always holding the last 10 and would prohibit playing any file if it was still on the list, and instead choose another file randomly. Because this is random, it is theoretically possible that could continuously keep choosing files that are on the list, so I suppose that after the list is created, it should only consider files that are not on the list before assigning a random number and making a choice, making anything in the array unavailable until it drops off. I have not found any way to even select macros to run within a macro in a random manner, even without the rules. can anyone help me create this? Thank you, Bob Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.