Need help with reading game log txt

Ask gaming related questions (AHK v1.1 and older)
chezzoc
Posts: 18
Joined: 04 Jul 2022, 02:53

Need help with reading game log txt

Post by chezzoc » 18 Aug 2022, 16:52

I have this match here and when it ends, a message of "Game over." appears in the chatbox and on game's log txt file.
image.png
image.png (3.72 KiB) Viewed 445 times
image.png
image.png (2.88 KiB) Viewed 445 times
I'm trying to write a script that every time "Game over." appears in the txt file (evey time a match ends) then I do some actions. e.g MsgBox.
This is my code so far..

Code: Select all

Loop, read, gameLogs.txt
{
    if InStr(A_LoopReadLine, "Game over.")
        {
        	Msgbox, gg
        	; startAnother()
        }
}
So, the issue I'm having here is that "Game over." is always on the txt logs from previous games, that means the code will always execute the Msgbox even when I'm not even in a game. I'm basically trying to make it only look for the new "Game over." lines that freshly get logged every match end ignoring the old ones from previous games. so i want it everytime I actually end a match, the Msgbox executes. I dont know how to go about this.


chezzoc
Posts: 18
Joined: 04 Jul 2022, 02:53

Re: Need help with reading game log txt

Post by chezzoc » 19 Aug 2022, 10:02

Found solutions from these links. thanks so much.

Post Reply

Return to “Gaming Help (v1)”