Open RobinReinecke opened 5 years ago
I hope I don't bore you. I love your work. I try to improve your work as well as improve myself in programming.
I trying to make sound alarm with auto sending troops(attack units) the safe location system for full attack towns.
Ok I fixed the problem but still I cant figure where is the incoming_attacks_total data :)
I'll try different codes in my free time at work.
My another idea(project) changing the your bot's default browser to Selenium Chrome with plugin. I will open a pull request when the project is completed :)
Yeah okay. That's unfortunate. Then there are two points to get this information inside the bot:
First in the response processes in UpdateGameDataResponse
is a new class called "class_name": "Attacks",
. You have to look if this contains the needed information. I don't have an active Grepolis account to test this.
Also I can't simmulate the town switch.
But every response from the Grepolis server contains the notifications array. I expect when there are incoming attacks you can extract them from the notifications.
@tgg4ever For the attack warning we need the information, if there are incoming attacks. Your idea with the JS command won't word, because the bot isn't using any JS logic so far. It communicates with the server directy. BUT: Please have a look at
private void SwitchTownResponse(string p_Response)
in line 3117:Player.IncomingAttacks = int.Parse(l_Incoming_attacks_total);
There should be the current count of incoming attacks. The bot gets these information on each town switch. In the following lines the bot stores every movement that goes from and to the town. You could extract the information, which town gets attacked, from here.But apart from that: Why don't you simple use the Grepolis App. It got a push notification service for incoming attacks.