Click here to Skip to main content
11,924,995 members (56,181 online)
Click here to Skip to main content
Add your own
alternative version


44 bookmarked

Auto-Task Tool for Web Game Travian

, 29 Oct 2007
Rate this:
Please Sign up or sign in to vote.
Developing Auto-Task Tool for Web Game Travian
Screenshot - travianauto_snap2.jpg


Travian is a web game of an ancient European tribal war. I developed this tool to automatically accomplish tasks.

Tasks Category

Currently, there are six kinds of Travian tasks supported:

  • Upgrade task (upgrading resources or buildings)
  • Build task (the build task)
  • Develop task (used for Academy, Armoury and Blacksmith)
  • Training troop task (used for Barracks, Stable, Workshop, Palace and Residence)
  • Transporting resource task (used for Marketplace)
  • Troop dispatch task (used for rally point)


  • Supports multiple threads. Tasks queue can be executed in a separated thread.
  • Supports event log. Event can log to file and UI window. Event log supports multiple threads.
  • Supports HTTP Get/Post method, raw cookie, UTF-8 encode/decode, gzip decompression, and URL encode/decode. HTTP functions based on the MFC class CInternetSession, so it's less dependent.
  • HTTP Response decompression uses class Gunzip in Crypto++, which is a C++ Class Library of Cryptographic Schemes. Refer to Crypto++.
  • Uses Regular expressions to parse HTML, so it's compact.
  • Once assigned tasks file, Travian server and user name/password, all tasks are accomplished unattended.

Compile Source Code

This project is built by VC8.0.50727 (VC2005 SP1). Before compiling the source project, you need to compile the cryptopp54 project first. The cryptopp54 project is located in the "cryptopp54" sub-folder of Travian's source code directory. Then place cryptlibD.lib (Debug build) or cryptlib.lib (Release build) in the Travian source code folder.

Description of Main Classes

Class Name


Class Dependencies
(Apart from MFC/STL)


About dialog



Event buffer management, log event to file and notify registered windows to fetch new events.


Send HTTP Request and get HTTP response. Support Get/Post method, gzip decompression, URL encode/decode, UTF-8 encode/decode, raw cookie.


URL encode/decode.


Encapsulation for ATL regular expression class CAtlRegExp<>, written by Paul DiLascia.


Travian tasks base class, which presents the upgrade tasks. It parses HTML form fields given tasks' URL and special tag mark. If player has more than one village, then is CTravianTask responsible for switching current villages. CTravianTask also provides a static function to parse tasks from the tasks file.

CHttpClient, CEventLog


CTravianTaskBuild is CTravianTask child class. It presents the build task.

CTravianTask, CEventLog


CTravianTaskDevelop is a CTravianTask child class. It presents the develop task.

CTravianTask, CEventLog


CTravianTaskTrain is CTravianTask child class. It presents the troop training task.

CTravianTask, CEventLog


CTravianTaskResourceTransport is a CTravianTask child class. It presents the resource transporting task.

CTravianTask, CEventLog


CTravianTaskDispatchTroop is a CTravianTask child class. It presents the troop dispatch task.

CTravianTask, CEventLog


CTravianTaskDispatchTroop is a CTravianTask child class. It presents the troop dispatch task.

CTravianTask, CEventLog


typedef of the CTravianTask* vector. It's used as tasks queue.



Schedule thread for the tasks queue.

CTravianTask, Tasks, CEventLog


Schedule thread for the tasks queue.

CTravianTaskSchedule, CEventLog


Form view for tasks parameter.

CThreadSchedule, CEventLog


Event output view.



View for tasks list.



  • Initial Release: (23 July 2007)
  • Release: (18 August 2007)
    Fixed parsing negative village coordinate number problem.
  • released by mila

What's New in This Release?

  • Troop dispatch bug fixed
  • user.ini file. If this file exists, the program read it line by line. In the lines you can specify:
    1. line: URL of the server. (e.g.
    2. line: name of the user (e.g. habakuk)
    3. line: password (e.g. babzsak)
    4. line: name of the file (e.g. tasks_en.txt)
    5. line: tribe type (e.g. 3)
    The tribe type can be:
    1. Roman
    2. Teuton
    3. Gall
  • Calculation for enough resources to complete the task.
    If there is not enough resources in the moment when the task runs, the program calculates the time when you will have enough resources to complete the task. This new date will set as the execution date of the task. (The icon, in the task list, will change for a clock to show this situation.)
  • <DTime> specification instead of >Time< means an offset to the date of the previous task.
    This also ensures in which order the tasks should run. Because the DTime task will be always later than the previous task. Dtime := delata time.
  • An empty time specification: >Time<>/Time< means the actual date.
    So the task will execute as soon as possible (within 2 min.)
  • New <Spy> tag. If you send your spys to scouting only (Scouting troop types only in the dispatched army) you can specify here what you are interested in. The type of spy can be 1 or 2.
    1. scouting resources and units
    2. scouting defender devices and other units
    NOTE! You are responsible to send only scouters in the >Troop<...>/Troop< section.
  • Display user name and server on the title.
  • Logging HTML only in debug mode. In the final release the whole HTML page was not logged. Therefore the size of the log file decreased dramatically.
  • "------" in the beginning of the line in the log file shows an ERROR
  • Task description in the list view has a shorter form. The list view is much more readable.
  • Display the name of the troops instead of the numbers. (Need to define the tribe type in the user.ini file)


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

Questionauto travian: TObot Pin
jerryno630-Dec-11 17:54
memberjerryno630-Dec-11 17:54 
Generalcannot login Pin
Nguyễn Thanh Tuấn8-Oct-10 6:12
memberNguyễn Thanh Tuấn8-Oct-10 6:12 
GeneralHelp newbie!!! Pin
poldek12312-Aug-09 12:39
memberpoldek12312-Aug-09 12:39 
GeneralC# version Pin
jammmie9998-Jun-09 6:16
memberjammmie9998-Jun-09 6:16 
Generali can't use this tool Pin
Tru Bat Gioi27-Mar-09 19:02
memberTru Bat Gioi27-Mar-09 19:02 
GeneralLogin problem Pin
sirtyler5417-Jan-09 20:41
membersirtyler5417-Jan-09 20:41 
GeneralRe: Login problem Pin
magikcm10-Mar-09 4:48
membermagikcm10-Mar-09 4:48 
AnswerRe: Login problem Pin
Member 428824815-May-09 6:44
memberMember 428824815-May-09 6:44 
GeneralThe task file isn't working Pin
sirtyler5416-Jan-09 21:49
membersirtyler5416-Jan-09 21:49 
I am getting errors with the task file. I put in:


and I get an error:

Readed Line has invalid format:1
GeneralRe: The task file isn't working Pin
sirtyler5416-Jan-09 22:45
membersirtyler5416-Jan-09 22:45 
GeneralError with train troop order Pin
nico12349-Jul-08 21:03
membernico12349-Jul-08 21:03 
GeneralRe: Error with train troop order Pin
YzZzN2-Dec-08 9:18
memberYzZzN2-Dec-08 9:18 
GeneralFail to log in Pin
ratsilva5-Jun-08 13:03
memberratsilva5-Jun-08 13:03 
Generalconvert Pin
kreont25-Apr-08 3:22
memberkreont25-Apr-08 3:22 
GeneralError that i couldnt Solve it ! ُ Pin
almashm_aa7-Apr-08 1:16
memberalmashm_aa7-Apr-08 1:16 
GeneralRe: Error that i couldnt Solve it ! ُ Pin
sherpishoru9-Apr-08 3:37
membersherpishoru9-Apr-08 3:37 
GeneralRe: Error that i couldnt Solve it ! ُ Pin
almashm_aa10-Apr-08 0:36
memberalmashm_aa10-Apr-08 0:36 
GeneralRe: Error that i couldnt Solve it ! ُ Pin
ratsilva29-Apr-08 22:33
memberratsilva29-Apr-08 22:33 
GeneralNew error on (so far) Pin
sherpishoru21-Mar-08 8:52
membersherpishoru21-Mar-08 8:52 
GeneralRe: New error on (so far) Pin
Celao28-Apr-08 20:03
memberCelao28-Apr-08 20:03 
QuestionVillageIndex Pin
MZS1-Mar-08 21:40
memberMZS1-Mar-08 21:40 
GeneralRe: VillageIndex Pin
sherpishoru21-Mar-08 8:46
membersherpishoru21-Mar-08 8:46 
GeneralRe: VillageIndex Pin
MZS21-Mar-08 22:21
memberMZS21-Mar-08 22:21 
GeneralRe: VillageIndex [modified] Pin
sherpishoru22-Mar-08 0:51
membersherpishoru22-Mar-08 0:51 
GeneralRe: VillageIndex Pin
lunalovelygood21-Sep-08 8:52
memberlunalovelygood21-Sep-08 8:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151125.3 | Last Updated 29 Oct 2007
Article Copyright 2007 by HasAName
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid