random

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
frankods
Newbie
Posts: 2
Joined: Mon Mar 22, 2021 1:45 pm

random

Post by frankods » Thu Mar 25, 2021 1:13 am

Code: Select all

Random
 Top  Previous  Next  
 

Random>Range,Result

 

Returns a random number within the specified range where 0 <= Result < Range.

 

The seed is set automatically and is stored in the RND_SEED variable.  It is possible to set the seed programmatically by modifying the value of RND_SEED.

 

Result is a variable in which the result is stored.

 

Abbreviation : RAN

 

Example

 

Random>6,DiceResult

Let>DiceResult=DiceResult+1

Message>You threw a %DiceResult% 


id like to place a random click ranging from 0.10 to 0.22
i found the above information in help.i tried stitching %0.%+%resultdice% infront of random witouth results tried "0."+ %resultdice% also no result.is there anyother way i can get the random function to accept the range 0.10 to 0.22? thanks in advance for your reply

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: random

Post by Dorian (MJT support) » Thu Mar 25, 2021 10:53 am

Random generates whole numbers, so if we generate a number between 10 and 22 then divide it by 100, we get what you're looking for. Then we can use it as a variable. I'm not too sure what you mean by a random click, but am guessing it's a random wait between clicks (because mouse movements need to be whole numbers too). So this will get you the number you need :

Code: Select all

Let>LowerLimit=10
Let>UpperLimit=22
Ran>{%UpperLimit%-%LowerLimit%},rr
Let>rr={(%rr%+%LowerLimit%)/100}

Wait>%rr%
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts