Jump to content

This topic is 4032 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

 

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.