hartmut Posted April 25, 2014 Posted April 25, 2014 Hi I would like to find out if there is a way to run a script from a list by random means In other words if I have the following scripts: script 1 script 2 script 3 script 4 script 5 script 6 script 7 I would like to have a mains script called "Random script" and it would run a random script from the list. So when I activate the script it plays Script 6 but the next time by random from this list of scripts it plays script 4 Can this be done and how Thanks
jbante Posted April 25, 2014 Posted April 25, 2014 Yes, this can be done: Set Variable [$scriptCount; Value:7] Set Variable [$scriptToRun; Value:Ceiling ( ( 1 - Random ) * $scriptCount )] If [$scriptToRun = 1] Perform Script ["Script 1"] Else If [$scriptToRun = 2] Perform Script ["Script 2"] Else If [$scriptToRun = 3 ... End If
hartmut Posted April 25, 2014 Author Posted April 25, 2014 Thanks for that. It is so good to know people know things and help here. Really good stuff Grateful
Recommended Posts
This topic is 4032 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now