lasse46 Posted April 17, 2006 Share Posted April 17, 2006 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? Would love help. bye Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 17, 2006 Share Posted April 17, 2006 send(FileReadLine("LOCATIONTO FILE", 17)) Link to comment Share on other sites More sharing options...
lasse46 Posted April 17, 2006 Author Share Posted April 17, 2006 Then is it possible to randomize the number of the line, for this example 17.. ?? Thanks for fast reply Link to comment Share on other sites More sharing options...
cdkid Posted April 17, 2006 Share Posted April 17, 2006 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! Link to comment Share on other sites More sharing options...
lasse46 Posted April 17, 2006 Author Share Posted April 17, 2006 send(FileReadLine("D:\Program\AutoIt3\texten.txt", & Random, 1, 1, 54) ) don't get it to work Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 17, 2006 Share Posted April 17, 2006 (edited) send(FileReadLine("LOCATIONTO FILE", Random(1,54))) Edited April 17, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
lasse46 Posted April 17, 2006 Author Share Posted April 17, 2006 Thanks ure really kind Link to comment Share on other sites More sharing options...
Onoitsu2 Posted April 17, 2006 Share Posted April 17, 2006 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] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 17, 2006 Share Posted April 17, 2006 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 Link to comment Share on other sites More sharing options...
cdkid Posted April 17, 2006 Share Posted April 17, 2006 (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 April 17, 2006 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now