Sign in to follow this  
Followers 0
lasse46

Random Input Text?

10 posts in this topic

Hi im quite a new with autoit3 nad my english is not so good, but i'll try.

I scripted the autoit to click in a box, now i want it to put in a line from a text file... something like this:

Input Line 17 (randomText.txt)

get it? :think:

Would love help. bye

Share this post


Link to post
Share on other sites



send(FileReadLine("LOCATIONTO FILE", 17))

Share this post


Link to post
Share on other sites

Then is it possible to randomize the number of the line, for this example 17.. ??

Thanks for fast reply

Share this post


Link to post
Share on other sites

RTFM


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

send(FileReadLine("D:\Program\AutoIt3\texten.txt", & Random, 1, 1, 54) )

don't get it to work

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

send(FileReadLine("LOCATIONTO FILE", Random(1,54)))

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Thanks ure really kind

Share this post


Link to post
Share on other sites

RTFM

I hope that does not stand for 'Read The $%$%ing Manual' as you need to stop your counterproductive belidgerance

and here is the code that will do what you are asking, and check to see if the file really exists.

$filename = "D:\Program\AutoIt3\texten.txt"
$linecount = _FileCountLines($filename)
if @error = 0 then
send(FileReadLine($filename,Random(1,$linecount,1))
else
msgbox(0,"Error","Error Reading File")
endif

Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font]

Share this post


Link to post
Share on other sites

I hope that does not stand for 'Read The $%$%ing Manual' as you need to stop your counterproductive belidgerance

and here is the code that will do what you are asking, and check to see if the file really exists.

$filename = "D:\Program\AutoIt3\texten.txt"
$linecount = _FileCountLines($filename)
if @error = 0 then
send(FileReadLine($filename,Random(1,$linecount,1))
else
msgbox(0,"Error","Error Reading File")
endif
u forgot to include misc.au3

#include <misc.au3>
$filename = "D:\Program\AutoIt3\texten.txt"
$linecount = _FileCountLines($filename)
if @error = 0 then
send(FileReadLine($filename,Random(1,$linecount,1))
else
msgbox(0,"Error","Error Reading File")
endif

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Yes, it does stand for Read The ****ing manual. This problem could be easily solved, had he read the documentaiton provided. There was really no need for a post on the forums. Furthermore, I don't see how it was counterproductive, when I was simply trying to help him help himself

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

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