Sign in to follow this  
Followers 0
Shides

Random move

11 posts in this topic

Hi which string it allows a random movement of some images?

Thank's

Excuse me for english but i'm italian :">


I'm a Italian a AutoIterMy scriptTxTediTor -->TxTediTor is a simple program similar notepad[center]Please vote me with five star ;)Antonio Caragliano for Nokia Nseries[/center]

Share this post


Link to post
Share on other sites



Hi which string it allows a random movement of some images?

Thank's

Excuse me for english but i'm italian :">

Random() ... That's as much as I understood your question.

The rest will have to be written by you yourself... if the images are in a GUI you may look at ControlMove() if they are in files, you may look at FileMove(), if this has no relevance, then post some code that demonstrates what you are trying to do so we might have an idea :whistle: .


[center]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.[/center]

Share this post


Link to post
Share on other sites

I must begin with the script but I would want to create a game


I'm a Italian a AutoIterMy scriptTxTediTor -->TxTediTor is a simple program similar notepad[center]Please vote me with five star ;)Antonio Caragliano for Nokia Nseries[/center]

Share this post


Link to post
Share on other sites

I must begin with the script but I would want to create a game

You may also want to look at GUICtrlSetPos()

[center]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.[/center]

Share this post


Link to post
Share on other sites

Its a UDF for moving sprites (with collision detection) and also image manipulation, have a look at the examples its really good! :whistle:


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Hello, what's the string it allows a random image open?

Edited by Shides

I'm a Italian a AutoIterMy scriptTxTediTor -->TxTediTor is a simple program similar notepad[center]Please vote me with five star ;)Antonio Caragliano for Nokia Nseries[/center]

Share this post


Link to post
Share on other sites

Here is how you could do it:

#include <array.au3>
Dim $aPictureFilenames[3] = [@ScriptDir & "\pic1.jpg",@ScriptDir & "\pic2.jpg",@ScriptDir & "\pic3.jpg"]

_ArrayDisplay($aPictureFilenames,"")

Random(0,2,1);will either choose 0 or 1 or 2.  The flag is set to 1 so it doesn't return decimal numbers, only integers


;here is the first way you could do it
MsgBox(0,"The image randomly chosen is:",$aPictureFilenames[Random(0,2,1)]);Now that i have shown you the command, you would use it like this

;you could also do it this way
Dim $iRandomInt = Random(0,2,1)
MsgBox(0,"The image randomly chosen is:",$aPictureFilenames[$iRandomInt]);this does the same thing as above

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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
Sign in to follow this  
Followers 0