Jump to content

No Decimals in Random

Recommended Posts

I need a solid number, and when ever i use a random, it some up with like 9 digits after the decimal, how do i stop this, can i put some flag on it???

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post

Share on other sites

and also, how can you clear an already written registry?...

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post

Share on other sites

I need a solid number, and when ever i use a random, it some up with like 9 digits after the decimal, how do i stop this, can i put some flag on it???

Hmmm... "some kind of flag on it"

Random(1, 10, iFlag) ?

Random(1, 10, 1)?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post

Share on other sites

There are 2 ways to do the random number:

```\$nRand = Random(0, 10, 1) ;picks a number 0 - 10
\$nRandom = Random(0, 10) ;picks a number 0.0 - 10.0```

for the registry:

look in the help file under:

RegRead()

RegDelete()

RegWrite()

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

• Recently Browsing   0 members

No registered users viewing this page.

×
×
• Create New...