robatwarofthepokerbots Posted October 14, 2010 Share Posted October 14, 2010 PLEASE CAN SOME ONE HELP ME I HAVE A FILE THAT IS BEING UPDATED IN REAL TIME I CAN READ THE TEXT FROM THE FILE I CAN PRCCESS THE INFO WITH THE FIL THE PROBLEM IS WHEN I REACH THE EOF FILE THE SCRIPTS RESTARTS I HAVE ADDED CODE TO SAVE THE LAST FILE LINE NUMBER SO WHEN YHE SCRIPT RESTARTS IT CONTINUES FROM WHERE IT LEFT OFF THE PROBLEM I AM HAVING IS WHEN I DELET THE FILE OR ITS CONTENT AND RE OPEN THE FILE COPY THE NEW TEXT IN THE OLD TEXT STILL SEEM TO BE THERE CAN ANY 1 HELP ME OR POINT ME IN THE RIGHT DIRECTION $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,"Dealing down cards") 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...
Somerset Posted October 14, 2010 Share Posted October 14, 2010 Stop making threads on the same subject.... Stop bumping your posts... Just go to bed, because you are becoming a troll. Link to comment Share on other sites More sharing options...
Varian Posted October 14, 2010 Share Posted October 14, 2010 (edited) Reopen File with Flag 2 to clear contentsFileOpen($file, 2)You may want to use handles if the files are larger and you will be writing/reading to the file(s) often$iFile = FileOpen($file, 2) For $i = 0 To _FileCountLines($iFile) ; FileWrite($iFile, $Text) ; $Line = FileReadLine($iFile, $i) Edited October 14, 2010 by Varian Link to comment Share on other sites More sharing options...
Spiff59 Posted October 14, 2010 Share Posted October 14, 2010 (edited) There's a policy here regarding gamebots. It's the very very first topic in this forum. I think there's also some sort of policy regarding starting three threads on the same topic within 40 minutes. Mr. V will likely visit you in your sleep. Edited October 14, 2010 by Spiff59 Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 14, 2010 Author Share Posted October 14, 2010 Reopen File with Flag 2 to clear contentsFileOpen($file, 2)You may want to use handles if the files are larger and you will be writing/reading to the file(s) often$iFile = FileOpen($file, 2) For $i = 0 To _FileCountLines($iFile) ; FileWrite($iFile, $Text) ; $Line = FileReadLine($iFile, $i) thanks for the reply as all help i can get is well needed i carnt see any difference in the code except for $file,2 what dose the 2 stand for the problem im haveing is that the for and next loop seem to run as if its a loop on its own reguardless of the while and wend ,once running reguardless of what i put befor the for or after the next dosent seem to be included in the loop, also if i open the file do i have to close it befor i can delete it ,something is telling me this could be the problem, im close but aint geting it, and i have been useing autoit for a while now ,just this is the first time i have played with data ini files all i am trying to do is read text from outher source (save it in a file) read the file and process it ,read the outer source (save in the file i have to replace every thing so it dosent double )or simply delet the file and create a new 1 thanks to the lovly >>>Varian<<< i havent solved my problem but i now feel as tho there is light at the end of the tunnel Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 14, 2010 Author Share Posted October 14, 2010 (edited) Stop making threads on the same subject.... Stop bumping your posts... Just go to bed, because you are becoming a troll.HELLO DO YOU WORK FOR AUTOIT WHO ARE YOU TO TELL ME TO GO TO BEDAND SAYING THAT I AM A TROLLI DONT EVEN NO YOU ,YOU DONT NO ME YOU DONT NO WHAT I AM WORKING ON STOP ASSUMING TRING TO BE A NO IT ALL AND LEAVE ME ALONEI WILL BE REPORTING YOU I HAVE REPORTED YOUJUST FOR THE RECORD I AM BUILDING A POKER PLAYER TRAKERA DATA BASE ON POKER PLAYERS WICH READS HAND HISTORY FILES AND RICHEDIT20WHATS THE ARM IN THATPLEASE STOP WHAT YOU ARE DOING PUTING DOWNERS ON ME AND MY WORKIM ASKING FOR A LITTLE HELP IM NEW TO THIS SITE FORUMSI HAVE SPENT AT LEAST A HOUR TRYING TO SETUP THE ACCOUNT NOT TO REACH PEOPLE LIKE YOU AT THE OTHER ENDHOW CAN YOU CALL ME A TROLL I AINT SPOKE TO YOU ,AND TELLING ME TO GO BEDMAN WHAT PLANET ARE YOU FROMWELL ANY WAY I HAVE WAISTED ENOUGHT OF MY TIME ON THIS MESSAGEBACK TO WHAT IM DOING PLEASE IF YO CARNT HELP ME DONT COMMENT ,WHAT DO YOU GET OUT OF TRYING TO UPSET PEOPLE FOR NO REASONNREGUARDS ROB LENIEWSKI Edited October 14, 2010 by robatwarofthepokerbots Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 14, 2010 Author Share Posted October 14, 2010 (edited) thanks for the replyI THINK YOU HAVE SUSSED IT FOR ME ,I WAS USEING FILEOPEN,0 HAHA (THIS IS READ ONLY MODE) 2 = Write mode (erase previous contents)I HAVENT REBUILT IT YET JUST LOOKING INTO IT ONCE AGAIN THANKSIF EVERY 1 WAS LIKE YOU .LIFE WOULD BE A LOT EASYERas all help i can get is well neededi carnt see any difference in the code except for $file,2 what dose the 2 stand forthe problem im haveing is that the for and next loop seem to run as if its a loop on its own reguardless of the while and wend ,once running reguardless of what i put befor the for or after the next dosent seem to be included in the loop, also if i open the file do i have to close it befor i can delete it ,something is telling me this could be the problem,im close but aint geting it, and i have been useing autoit for a while now ,just this is the first time i have played with data ini files all i am trying to do is read text from outher source (save it in a file) read the file and process it ,read the outer source (save in the file i have to replace every thing so it dosent double )or simply delet the file and create a new 1thanks to the lovly >>>Varian<<<i havent solved my problem but i now feel as tho there is light at the end of the tunnel Edited October 14, 2010 by robatwarofthepokerbots Link to comment Share on other sites More sharing options...
robatwarofthepokerbots Posted October 14, 2010 Author Share Posted October 14, 2010 Reopen File with Flag 2 to clear contentsFileOpen($file, 2)You may want to use handles if the files are larger and you will be writing/reading to the file(s) often$iFile = FileOpen($file, 2) For $i = 0 To _FileCountLines($iFile) ; FileWrite($iFile, $Text) ; $Line = FileReadLine($iFile, $i) I HAVE REWRITEN MY CODE WITH YOU ADVICE I THINK THIS IS RIGHT NOW I HAVENT TESTED IT YET WILL DO SO IN 5 MINS ; 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") IniWrite($file,'a','a',"0") $iFile = FileOpen($file, 2);<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To _FileCountLines($iFile) ; FileWrite($iFile, $Text) $Line = FileReadLine($iFile, $i) if StringInStr($line,"Dealing down cards") then msgbox(0,'','the line ' & $i & ' is ' & $line,1) EndIf Next $varxx = ("data/table2") iniWrite($varxx,"a","a",$i) msgbox("","test","waiting for next line",1) Link to comment Share on other sites More sharing options...
bo8ster Posted October 14, 2010 Share Posted October 14, 2010 (edited) HELLO DO YOU WORK FOR AUTOIT WHO ARE YOU TO TELL ME TO GO TO BEDAND SAYING THAT I AM A TROLLI DONT EVEN NO YOU ,YOU DONT NO ME YOU DONT NO WHAT I AM WORKING ON STOP ASSUMING TRING TO BE A NO IT ALL AND LEAVE ME ALONEI WILL BE REPORTING YOU I HAVE REPORTED YOUJUST FOR THE RECORD I AM BUILDING A POKER PLAYER TRAKERA DATA BASE ON POKER PLAYERS WICH READS HAND HISTORY FILES AND RICHEDIT20WHATS THE ARM IN THATPLEASE STOP WHAT YOU ARE DOING PUTING DOWNERS ON ME AND MY WORKIM ASKING FOR A LITTLE HELP IM NEW TO THIS SITE FORUMSI HAVE SPENT AT LEAST A HOUR TRYING TO SETUP THE ACCOUNT NOT TO REACH PEOPLE LIKE YOU AT THE OTHER ENDHOW CAN YOU CALL ME A TROLL I AINT SPOKE TO YOU ,AND TELLING ME TO GO BEDMAN WHAT PLANET ARE YOU FROMWELL ANY WAY I HAVE WAISTED ENOUGHT OF MY TIME ON THIS MESSAGEBACK TO WHAT IM DOING PLEASE IF YO CARNT HELP ME DONT COMMENT ,WHAT DO YOU GET OUT OF TRYING TO UPSET PEOPLE FOR NO REASONNREGUARDS ROB LENIEWSKILearn some manners!!!!Firstly don't write in caps, its SHOUTING! Secondly learn how to use code tags like everyone one else.Thirdly stop filling the general help section with your posts, FFS! You are not more important than other members! Everyone's issue is important . Forthly don't bump or double post, its the rules!Learn how to conduct yourself in a forum! Read http://www.autoitscript.com/forum/index.php?showforum=28 and http://www.autoitscript.com/forum/index.php?showtopic=33797 for more information.Show some more respect for other members and they will for you! Edited October 14, 2010 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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