robatwarofthepokerbots Posted October 14, 2010 Share Posted October 14, 2010 HELL I AM RECVING TEXT FROM A THIRD PARTY PROGRAM I AM WRITING THE TEXT INTO A FILE AT THE SAME TIME II AM READING THE FILE TO PROCESS THE DATA I AM BUILDING TRAKER SOFTWARE THE PROBLEM IS WHEN I REACH THE EOF FILE ; just experimenting with #include <File.au3> opt("wintitlematchmode",2) global $table = "Play" $file = ("data/table") $file2 = ("data/table2") iniWrite($file2,"a","a","O" ) FileDelete ($file) $text = ControlGettext ( $table, "", "RichEdit20W1") while 1 FileDelete ($file) sleep(2000) IniWrite($file,'a','a','test') FileOpen($file, 0) For $i = 0 to _FileCountLines($file) DirRemove("data/table2", 1) fileWrite($file,$text ) $line = FilereadLine($file, $i) if StringInStr($line,"leniewski10 wins") then msgbox(0,'','the line ' & $i & ' is ' & $line,1) EndIf Next IniDelete($file,'a','a') sleep(1000) $varxx = ("data/table2") iniWrite($varxx,"a","a",$i) msgbox("","test","waiting for next line",1) wend Link to comment Share on other sites More sharing options...
trung0407 Posted October 14, 2010 Share Posted October 14, 2010 Explain more, what problem when you reach EOF? Every file has a EOF, what's wrong with reaching it? Also try to put your code inside an autoit tag Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 14, 2010 Author Share Posted October 14, 2010 Explain more, what problem when you reach EOF? Every file has a EOF, what's wrong with reaching it?Also try to put your code inside an autoit tagthe problem is my file is alway updateing real timeso when i reach the endof the scripts restartsbut it aint realy the eof cos with in 30 seconds the files has more linesall im trying to do is read the file then when it comes to the eof save what ever line its ondelete the old text reopen the file ,copy in the new text, carry on from where it left ofhere is my code im working on im almost there just not yet;----------------------------------------------------------------------------------------------------------------------------------------; just experimenting with #include <File.au3>opt("wintitlematchmode",2)global $table = "Play"$file = ("data/table")$file2 = ("data/table2")iniWrite($file2,"a","a","O" )$Text = ControlGettext ( $table, "", "RichEdit20W1") $iFile = FileOpen($file, 2);<<<<<<<<<<<<<<<<<<<<<<<<<For $i = 0 To _FileCountLines($iFile)FileWrite($iFile, $Text)sleep(1111)$Line = FileReadLine($iFile, $i) if StringInStr($Line,"LENIEWSKI10") then msgbox(0,'','the line ' & $i & ' is ' & $Line,1) endif Next ; MsgBox(1,"waiting!!!!!!!!","looking good") ; iniWrite($file2,"a","a",$i) Link to comment Share on other sites More sharing options...
Developers Jos Posted October 14, 2010 Developers Share Posted October 14, 2010 Have you read my comments in your thread I closed? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 15, 2010 Author Share Posted October 15, 2010 Have you read my comments in your thread I closed?yep i have read your commenti will not use caps and il learn how to tag my scriptsvery sorry as yesterday was my first day using this forumi was only trying to get a bit of help Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 15, 2010 Author Share Posted October 15, 2010 could any 1 please help me im still stuck i have bin trying now for 48 hours and got no further i am trying to read from a file wich i am updateing at the same time the problem is when i come to the eof what i want to do is save the the line number when i come to the end of in a ini form iniWrite($file2,"a","a",$i) so now when the scripts restarts it carry on from the last line sound easy enought [autoit; just experimenting with #include <File.au3> opt("wintitlematchmode",2) global $table = "Play" $file = ("data/table") $file2 = ("data/table2") $iFile = FileOpen($file, 2);<<<<<<<<<<<<<<<<<<<<<<<<< iniWrite($file2,"a","a","O" ) $Text = ControlGettext ( $table, "", "RichEdit20W1") $startat = IniRead($file2,"a","a","" ) For $i = $startat To _FileCountLines($file) $Line = FileReadLine($iFile, $i) if StringInStr($Line,"Dealing down cards") then msgbox(0,'','the line ' & $i & ' is ' & $Line,1) endif Next iniWrite($file2,"a","a",$i ) MsgBox(1,"waiting for next card","looking good") iniWrite($file2,"a","a",$i) [/autoit] i carnt see why it wont work but it just jumps to the last message - ,"waiting for next card","looking good please can some one help me 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