JugglesIt

How to perform action randomly

3 posts in this topic

Hey guys, I'm pretty fluent in java, but I am trying to make an automated program using auto it. 

I was wondering if there was a function similar to Math.Random(); in this.

Something that will generate an odd randomly and if the odd is selected, it will perform the action.

For example, in java you would do

x = Math.Random();

if (x<0.05) Then 

//do action

EndIf

 

So if the number is <0.05 out of 1, it will perform the action.


Thanks for the help

Share this post


Link to post
Share on other sites

Have you looked at Random function?

Share this post


Link to post
Share on other sites

Something like that ?

$x = Random(-1,2)

if $x < 0.5 Then
MsgBox(0,"","The random number equals ->"&$x&" and do action is enabled")
EndIf

 

Share this post


Link to post
Share on other sites

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