Sign in to follow this  
Followers 0
kw_rock

Filereadline And Send..

2 posts in this topic

#1 ·  Posted (edited)

I have a few question.

First off, how do I send random letter... Say I wanted to type a random letter A through Z... I'd do Send(????)

And another thing,

If i wanted to read and type a random line from a file, how do I do that?

Say file test.txt has 10 lines, and I want to read a random line of those.

THANKS FOR THE HELP :)

Edit: Or I want to Sleep(??) for a random amount of time between 1 second and 5 seconds

Edited by kw_rock

Share this post


Link to post
Share on other sites



I have a few question.

First off, how do I send random letter... Say I wanted to type a random letter A through Z... I'd do Send(????)

And another thing,

If i wanted to read and type a random line from a file, how do I do that?

Say file test.txt has 10 lines, and I want to read a random line of those.

THANKS FOR THE HELP :)

Edit: Or I want to Sleep(??) for a random amount of time between 1 second and 5 seconds

$RandomAlph = Random(Asc('A'), Asc('Z'), 1)
Send(Chr($RandomAlph))

Get Beta for the 2nd question:

#include <file.au3>
$FileFullPath = @ScriptDir & '\Test.txt'
$RandomLine = Random(1, _FileCountLines($FileFullPath), 1)
$ReadLine = FileReadLine($FileFullPath, $RandomLine)
MsgBox(64, 'Line Read = ' & $RandomLine, $ReadLine)
That might work

[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

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