Hi there. I need to make a very custom for each statement.
As the source of information I'm using a console file of the game.
Now in that file it says SOMEPLAYER has selected a hero.
Now I need to find a players name who selected a hero. What hero is not important.
There are 10 players all together. So foreach loop has to loop through the file and search for "has selected" then it should only filter the part with the nick name and go to the next "has selected" line.
Another thing is that if player played more than one game, the program will also take 10 players from last game. To fix that I think when for each statement took first 10 player names it should store the text up to the line where he picked the last player name and then when the statement reads the log file again it should ignore all previous lines.
Same thing applies if player played 3 or 5 games in a row. I hope it is clear what I need to do.
Here is how the console writes hero selection string.
Line 10567: ^479[ZRG]Rutsuko^* has selected a hero.
Line 10579: ^132Love_Him^* has selected a hero.
Line 10594: ^521Zit0un^* has selected a hero.
Line 10621: ^187[GEN]Rejanu^* has selected ^885Zephyr^*.
Line 10674: ^507[GEN]Kenchik^* has selected ^885Magmus^*.
Line 10688: ^990[2xP]SCOTU^* has selected ^885Plague Rider^*.
Line 10700: ^950[2xP]Analcucumber^* has selected ^885Thunderbringer^*.
Line 10702: ^029[GREM]PapaLoko^* has selected ^885Moon Queen^*.
Line 10703: ^836[ImwS]NightyD^* has selected a hero.
Line 10704: ^555[HUGR]Mariop4rty^* has selected a hero.
Line 70163: ^029[GEN]Rejanu^* has selected ^885Night Hound^*.
Line 70186: ^836[GEN]Kenchik^* has selected ^885Witch Slayer^*.
As you can see there are 12 lines. 10 from one game and 2 from another so it's not always 10 people in the game.... so for each statement must loop until the last "has selected" and count that as the end point. then remember it and ignore everything up to that point next time he searches through the file.