wpsatisfide Posted January 23, 2007 Share Posted January 23, 2007 (edited) Im a total noob to autoit, and have only written a few scripts with actool in the past. This is to look in a chat log from a game and see if a certain string is in it. The game auto time stamps the file, so it would be c:\chatlog_time_date.txt this is what i got so far, but it doesnt work CODE$file = FileFindFirstFile("c:\chatlog*.txt") $Contents = FileRead($file) $location = StringInStr($contents,"sometext") If $location Then MsgBox(0,"Found","The search string is in the log") Edited January 23, 2007 by wpsatisfide Link to comment Share on other sites More sharing options...
Glyph Posted January 23, 2007 Share Posted January 23, 2007 Your not declaring a true... like $file = FileFindFirstFile("c:\chatlog*.txt") $Contents = FileRead($file) $location = StringInStr($contents,"sometext") If $location = 1 Then MsgBox(0,"Found","The search string is in the log") endif but then again i dont understand wtf you are trying to do here... you want to read the text document or tell you if there is text in it? tolle indicium Link to comment Share on other sites More sharing options...
wpsatisfide Posted January 23, 2007 Author Share Posted January 23, 2007 but then again i dont understand wtf you are trying to do here...you want to read the text document or tell you if there is text in it?sorry I want to see if a certain phrase, "sometext" for example, is in the text file Link to comment Share on other sites More sharing options...
wpsatisfide Posted January 24, 2007 Author Share Posted January 24, 2007 up cause im 4 pages back. What i want to do is make a buffbot for a game. This bot would cast buffs on another player if given the password in a tell. The part I need help with is this. I can type /log in game and it creates a chat log file in the format Chat_log_year_date_time.txt, I cant specify the file name like /log chatlog.txt. So what I need to do is open this logfile every minute or 2 and scan for the password. This is the only part I need help with. As i mentioned I have used actool and in asherons call i could specify the filename when saving it and easily search the file. Actool does not support wildcard filename searches so thats why im here. Although autoit is more complicated, I think it will be able to do what i want. After I get to the point where I can check for the password, the rest of the file should be a breeze. 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