Jump to content

Random + Notepad thing...


Recommended Posts

An array is just a way to hold more information in an array.

dim $yourarray[10];10 is the number of "variabels" we want in our array , starting from zero
$yourarray[0]="one";you can now access this text by using $yourarray[0]
$yourarray[1]="two"
$yourarray[2]="three"
;So to get some random text:
msgbox(0,"",$yourarray[random(0,3)]);if random returns 0 the msgbox will say one, if 1 then it will say two if 2 it will say three
Edited by rambo3889
My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youÂ’re the best in town Fight!
Link to comment
Share on other sites

Hmm...im quite new to AutoIt, so I dunno what you are talking about :), can you give me a example?

You did read the Help file example for Random() and Dim where it also talks about arrays? Help file example code for Random()

;Random letter
If Random() < 0.5 Then
    ;Capitals
    $Letter = Chr(Random(Asc("A"), Asc("Z"), 1))
Else
    ;Lower case
    $Letter = Chr(Random(Asc("a"), Asc("z"), 1))
Endif
Link to comment
Share on other sites

An array is just a way to hold more information in an array.

dim $yourarray[10];10 is the number of "variabels" we want in our array , starting from zero
$yourarray[0]="one";you can now access this text by using $yourarray[0]
$yourarray[1]="two"
$yourarray[2]="three"
;So to get some random text:
msgbox(0,"",$yourarray[random(0,3)]);if random returns 0 the msgbox will say one, if 1 then it will say two if 2 it will say three
How can I make so the text(one,two,three) shows in notepad and not in a messagebox?

Thanks btw :)

Edited by RandomGuest
Link to comment
Share on other sites

  • Moderators

If it must display in an "open" window, look at ControlSetText() or ControlSend() to set/send the information.

If it's something you just want to open with the data showing, look at FileWrite()+ShellExecute().

P.S.

You've been here, a part of this forum for 6 months, that's more than enough time for knowing the basic questions as you have presented in this post. Show some effort next time, just saying you are "new" doesn't make you immune to reading and comprehending the help file, it's an insult to those of us that have spent a lot of our time to learn what it is that we need to know, to accomplish what we want to achieve.

Edited by SmOke_N

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...