Grepolis bot (Now with attack option)

01/30/2010 13:25 srialmaster#16
Quote:
Originally Posted by Utharnl View Post
That error: The Remote server returned an error: (403) Forbidden.
Is probably because you're using the en3 address now.
A fix is coming soon, if you wait a day I think that problem will be fixed. :)

~Uthar
Ok
01/30/2010 21:14 Utharnl#17
Uploaded new version:
GrepolisBot v1.1
-Fixed login problem with the English servers
-Added support for Greek servers
-Added variable timer
-Added building levels
-Added build permission (Can only add building to queue if you have the required buildings)

Note: Delete your old settings.txt and translation.txt
01/30/2010 21:34 erikpowa#18
uhuu :D woorks!! thank u :).


( i added mize btn+notf_icon: [Only registered and activated users can see links. Click Here To Register...] ...:D hih )
01/31/2010 10:49 HugoE#19
@Utharnl
Thanks, works fine ;)
01/31/2010 18:26 DiedB#20
v1.1 works fine, thanks! :)
02/02/2010 16:44 HugoE#21
Farming/Research/Troops

One of these parts can be added for the next version or?
02/02/2010 21:47 Utharnl#22
I'm not planning to include this any time soon. Started my internship this month so I don't have much time for it atm.
I was also planning to update my other bot (empire craft) first.

But maybe I will look at it after that.

Greetings Uthar
02/03/2010 10:38 soSo88#23
"Building levels not found" it says? Not working, must be something to do with that statement?
02/03/2010 18:11 tungstenleigh#24
cant you make tribalwars bot?
02/03/2010 18:21 tungstenleigh#25
i cant even use it! it doesnt work to me! amft!
02/03/2010 20:39 Utharnl#26
Quote:
Originally Posted by soSo88 View Post
"Building levels not found" it says? Not working, must be something to do with that statement?
Could you give me some more info soSo88?
I can think of two things that could cause this.
1) If you login with a browser while the bot is running, the bot will get disconnected and can't update the building levels any more.
2) It could be that the bot gets disconnected when you run it very long. (Easy to fix if this is the problem)

Quote:
Originally Posted by tungstenleigh View Post
cant you make tribalwars bot?
There are already some bots for tribalwars that are very advanced

Quote:
Originally Posted by tungstenleigh View Post
i cant even use it! it doesnt work to me! amft!
Could you tell me what doesn't work for you?
02/03/2010 21:51 Fatal17#27
Quote:
Originally Posted by Utharnl View Post
There are already some bots for tribalwars that are very advanced
Name one.
02/03/2010 22:03 Utharnl#28
@fatal17 [Only registered and activated users can see links. Click Here To Register...]

Tribal Wars has an anti bot system so i'm not sure if all bots work anymore
02/04/2010 05:58 srialmaster#29
From grepolisbot source v1.1:

String[] l_BuildingLevelsArray = new String[] { "", "" };//dynamic array
l_BuildingLevelsArray = l_BuildingLevels.Split(';');
m_Towns[m_CurrentTown].Buildings[0].Level = int.Parse(l_BuildingLevelsArray[0]);//main
m_Towns[m_CurrentTown].Buildings[1].Level = int.Parse(l_BuildingLevelsArray[5]);//lumber
m_Towns[m_CurrentTown].Buildings[2].Level = int.Parse(l_BuildingLevelsArray[3]);//farm
m_Towns[m_CurrentTown].Buildings[3].Level = int.Parse(l_BuildingLevelsArray[6]);//stoner
m_Towns[m_CurrentTown].Buildings[4].Level = int.Parse(l_BuildingLevelsArray[2]);//storage
m_Towns[m_CurrentTown].Buildings[5].Level = int.Parse(l_BuildingLevelsArray[7]);//ironer
m_Towns[m_CurrentTown].Buildings[6].Level = int.Parse(l_BuildingLevelsArray[10]);//barracks
m_Towns[m_CurrentTown].Buildings[7].Level = int.Parse(l_BuildingLevelsArray[11]);//wall
m_Towns[m_CurrentTown].Buildings[8].Level = int.Parse(l_BuildingLevelsArray[1]);//hide
m_Towns[m_CurrentTown].Buildings[9].Level = int.Parse(l_BuildingLevelsArray[9]);//docks
m_Towns[m_CurrentTown].Buildings[10].Level = int.Parse(l_BuildingLevelsArray[12]);//academy
m_Towns[m_CurrentTown].Buildings[11].Level = int.Parse(l_BuildingLevelsArray[13]);//temple
m_Towns[m_CurrentTown].Buildings[12].Level = int.Parse(l_BuildingLevelsArray[8]);//market
//Get current ingame building queue
String l_QueuedBuilding1 = "";
String l_QueuedBuilding2 = "";
l_Search = "id=\"main_tasks_0\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)

Here where it has "String |_QueuedBuilding1="";", can I possibly add buildings up to 7 in case a user has a que of 7 instead of 2?
02/04/2010 06:42 srialmaster#30
Here's what I did:

//Get current ingame building queue
String l_QueuedBuilding1 = "";
String l_QueuedBuilding2 = "";
String l_QueuedBuilding3 = "";
String l_QueuedBuilding4 = "";
String l_QueuedBuilding5 = "";
String l_QueuedBuilding6 = "";
String l_QueuedBuilding7 = "";
l_Search = "id=\"main_tasks_0\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding1 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[0] = l_QueuedBuilding1;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding2 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[1] = l_QueuedBuilding2;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding3 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[2] = l_QueuedBuilding3;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding4 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[3] = l_QueuedBuilding4;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding5 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = l_QueuedBuilding5;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding6 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = l_QueuedBuilding6;
l_Search = "id=\"main_tasks_1\"";
l_Index = l_Response.IndexOf(l_Search);
if (l_Index != -1)
{
l_Search = "/images/game/main/";
l_Index = l_Response.IndexOf(l_Search, l_Index);
l_QueuedBuilding2 = l_Response.Substring(l_Index + l_Search.Length, l_Response.IndexOf(".", l_Index) - (l_Index + l_Search.Length));
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = l_QueuedBuilding7;
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[3] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[2] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[3] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[1] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[2] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[3] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
}
else
{
m_Towns[m_CurrentTown].IngameBuildingQueue[0] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[1] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[2] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[3] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[4] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[5] = "";
m_Towns[m_CurrentTown].IngameBuildingQueue[6] = "";
}
setStatusBar("Building levels updated.");
refreshBuildingLevels();
updateBuildPermission();
}
else
{
setStatusBar("Building levels not found");
debug("Building levels not found");
}
if (m_IsBotRunning)
m_Timer.Start();
break;
}
}

-Nate