Jump to content

Filereadline And Send..


Recommended Posts

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

  • Moderators

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

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...