Grepolis bot (Now with attack option)

04/18/2010 12:35 Utharnl#346
No not randomly. Each farmer has an id. The bot attacks the farmers with id's from low to high or from high to low if you use the reverse attack option.

//edit
Unfortunately it isn't possible to check the distance. The only way to separate farmers is with their id. The bot checks each farmers mood/strength and attacks the first positive match (with your mood/strength setting).

The sources files are for Visual Studio 2008.

~Uthar
04/18/2010 12:51 KingM4x#347
Hmm... so you set it like this: If "normal attack", then attack Farm with Highest ID, else if "Reverse Attack Order" then attack Farm with Lowest ID... thats how i understood it.

But what is if you do it like this (just for example): If "normal attack" then attack Farm with ( Highest ID / 2 ), so he would attack the Farm with the "middle" ID..

Of course i just showed it in a simple way, but isn't it possible to go on like this?
04/18/2010 13:38 Utharnl#348
Something like that. But in normal mode it will attack the one with the lowest id first, when using the reverse attack option it will attack the highest id first.

The farmers ID are global, meaning it's not an id from 0-7 on your island but more like 0-10000 for the whole world map.
But that's not really a problem if you do "Highest ID" - "Lowest ID" you know the range on your island too.

The problem with your method is that it doesn't work for everyone. For example if there's someone who has the farmer with the lowest id closest to his town. For him the bot works perfect. The same thing for someone who has the farmer with the highest id closest to his town.

What I had in mind to make it work for everyone is to add a selection window where you can choose which farmers you want to attack. You can choose then to only attack the farmers that are near you.

~Uthar
04/18/2010 16:08 KingM4x#349
hmm you used m_ID and p_ID but what is the "high" and what the "low" id?

Or can u tell me the code for "high / 2" so i can configure the bot so he attacks the village which is near to me?^^
04/18/2010 16:23 Utharnl#350
m_ID or p_ID doesn't say directly anything about a "low" or "high" id.

Everything that starts with m_ in the source code is a member of the current class (Global variable for that class). And the variables that start with p_ are parameters.

I think you are looking in the Farmer.cs file now?
If your town is on an Island with farmers the bot will create 8 Farmer objects. Each one of them has a different value for m_ID. You will have to compare the variable m_ID of all farmers if you want to know which one is the lowest/highest.

~Uthar
04/18/2010 18:40 KingM4x#351
hmm ok i tried it now a few hours, but i didn't get it... how do i have zo write that down? I think it's too complicated for me :D
04/19/2010 19:27 Utharnl#352
It's indeed not very easy to add if you see the source code for the first time. But if you wait a few weeks it should be ready. First going to add the the army queue and separate units for attack and support.

If there's someone here that want to help with the army queue I could use some help. Lost my town this weekend and don't have the barracks yet in my new town.
The only thing you need to have is FireFox and the addon called "Live HTTP headers"

~Uthar
04/19/2010 20:09 jago#353
it would be nice, if the bot could auto-trade between your own cities. that way your colonies that are surrounded by villages could provide the ones on islands without those with ressources. that way it would become possible to max out all the storage room in every city, even if it's offensive/farming army is currently unavailable/destroyed.
04/20/2010 11:41 predi2k#354
Patch 1.11 is on at german servers - Bot workin' ;-)
04/20/2010 21:26 Utharnl#355
Nice, don't have to change anything then :)
And new version of bot is ready too.

Version: 1.8.3 Date: 20-04-2010
-Added separate units for attack and support.
-Added a check for updates. See Help -> Check for Updates.

~Uthar
04/21/2010 07:23 martijntje#356
how do i install a bot?
04/21/2010 08:48 Utharnl#357
First you have to extract zip file you downloaded.
Make sure the text files and GrepolisBot.exe are in the same directory.
Then run GrepolisBot and see the Guide in the start post or [Only registered and activated users can see links. Click Here To Register...] to get the bot working.

~Uthar
04/21/2010 10:30 tguts#358
21/04/2010 6:23:44 PM Error in attackFarmerResponse(): Probably a corrupt http response(0)

getting this with 1.8.2
04/21/2010 15:07 martijntje#359
Quote:
Originally Posted by Utharnl View Post
First you have to extract zip file you downloaded.
Make sure the text files and GrepolisBot.exe are in the same directory.
Then run GrepolisBot and see the Guide in the start post or [Only registered and activated users can see links. Click Here To Register...] to get the bot working.

~Uthar
Thanks, it works :)
04/21/2010 17:17 Utharnl#360
@tguts
That sometimes happens when the Grepolis server is too busy. It probably works fine the next time the bot tries to attack a farmer.

I suppose it works fine most of the time when the bot attacks a farmer?
Let me know when you get this problem with each attack.

~Uthar