Sign in to follow this  
Followers 0
robatwarofthepokerbots

HELP WITH FILE COMMANDS PLEASE

9 posts in this topic

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

Share this post


Link to post
Share on other sites



Stop making threads on the same subject.... Stop bumping your posts... Just go to bed, because you are becoming a troll.


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Reopen File with Flag 2 to clear contents

FileOpen($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 by Varian

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Spiff59

Share this post


Link to post
Share on other sites

Reopen File with Flag 2 to clear contents

FileOpen($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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 BED

AND SAYING THAT I AM A TROLL

I 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 ALONE

I WILL BE REPORTING YOU

I HAVE REPORTED YOU

JUST FOR THE RECORD I AM BUILDING A POKER PLAYER TRAKER

A DATA BASE ON POKER PLAYERS WICH READS HAND HISTORY FILES AND RICHEDIT20

WHATS THE ARM IN THAT

PLEASE STOP WHAT YOU ARE DOING PUTING DOWNERS ON ME AND MY WORK

IM ASKING FOR A LITTLE HELP IM NEW TO THIS SITE FORUMS

I HAVE SPENT AT LEAST A HOUR TRYING TO SETUP THE ACCOUNT NOT TO REACH PEOPLE LIKE YOU AT THE OTHER END

HOW CAN YOU CALL ME A TROLL I AINT SPOKE TO YOU ,AND TELLING ME TO GO BED

MAN WHAT PLANET ARE YOU FROM

WELL ANY WAY I HAVE WAISTED ENOUGHT OF MY TIME ON THIS MESSAGE

BACK TO WHAT IM DOING PLEASE IF YO CARNT HELP ME DONT COMMENT ,WHAT DO YOU GET OUT OF TRYING TO UPSET PEOPLE FOR NO REASONN

REGUARDS ROB LENIEWSKI

Edited by robatwarofthepokerbots

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thanks for the reply

I 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 THANKS

IF EVERY 1 WAS LIKE YOU .LIFE WOULD BE A LOT EASYER

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

Edited by robatwarofthepokerbots

Share this post


Link to post
Share on other sites

Reopen File with Flag 2 to clear contents

FileOpen($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)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

HELLO DO YOU WORK FOR AUTOIT

WHO ARE YOU TO TELL ME TO GO TO BED

AND SAYING THAT I AM A TROLL

I 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 ALONE

I WILL BE REPORTING YOU

I HAVE REPORTED YOU

JUST FOR THE RECORD I AM BUILDING A POKER PLAYER TRAKER

A DATA BASE ON POKER PLAYERS WICH READS HAND HISTORY FILES AND RICHEDIT20

WHATS THE ARM IN THAT

PLEASE STOP WHAT YOU ARE DOING PUTING DOWNERS ON ME AND MY WORK

IM ASKING FOR A LITTLE HELP IM NEW TO THIS SITE FORUMS

I HAVE SPENT AT LEAST A HOUR TRYING TO SETUP THE ACCOUNT NOT TO REACH PEOPLE LIKE YOU AT THE OTHER END

HOW CAN YOU CALL ME A TROLL I AINT SPOKE TO YOU ,AND TELLING ME TO GO BED

MAN WHAT PLANET ARE YOU FROM

WELL ANY WAY I HAVE WAISTED ENOUGHT OF MY TIME ON THIS MESSAGE

BACK TO WHAT IM DOING PLEASE IF YO CARNT HELP ME DONT COMMENT ,WHAT DO YOU GET OUT OF TRYING TO UPSET PEOPLE FOR NO REASONN

REGUARDS ROB LENIEWSKI

Learn 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 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]

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