Click here to Skip to main content
Click here to Skip to main content

Auto-Task Tool for Web Game Travian

By , 29 Oct 2007
 
Screenshot - travianauto_snap2.jpg

Introduction

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)

Features

  • 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

Description

Class Dependencies
(Apart from MFC/STL)

CAboutDlg

About dialog

CHyperLink

CEventLog

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

CHttpClient

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

CURLEncDec

URL encode/decode.

CRegex

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

CTravianTask

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

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

CTravianTask, CEventLog

CTravianTaskDevelop

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

CTravianTask, CEventLog

CTravianTaskTrain

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

CTravianTask, CEventLog

CTravianTaskResourceTransport

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

CTravianTask, CEventLog

CTravianTaskDispatchTroop

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

CTravianTask, CEventLog

CTravianTaskDispatchTroop

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

CTravianTask, CEventLog

Tasks

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

CTravianTask

CTravianTaskSchedule

Schedule thread for the tasks queue.

CTravianTask, Tasks, CEventLog

CThreadSchedule

Schedule thread for the tasks queue.

CTravianTaskSchedule, CEventLog

CFormTask

Form view for tasks parameter.

CThreadSchedule, CEventLog

CViewOutput

Event output view.

CEventLog

CViewTaskList

View for tasks list.

Tasks

History

  • Initial Release: 1.0.0.0 (23 July 2007)
  • Release: 1.0.0.1 (18 August 2007)
    Fixed parsing negative village coordinate number problem.
  • 1.0.0.8 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. s2.travian.hu)
    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)

License

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

HasAName
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questionauto travian: TObotmemberjerryno630 Dec '11 - 16:54 
Generalcannot loginmemberNguyễn Thanh Tuấn8 Oct '10 - 5:12 
try to use but show errors:
INFO 2010-10-08 21:33:55 Begin to execute task:Upgrade Task: VillageIndex=1 LocationID=39 Time:2010-10-08 19:33:00
INFO 2010-10-08 21:33:57 Need to login.
ERROR 2010-10-08 21:33:57 Can't find the form input field named autologin. Form input fields count: 5.
ERROR 2010-10-08 21:33:57 ------Format post data from returned HTML failed. Server:x5.travian.com.vn, User:Sweitenger
ERROR 2010-10-08 21:33:57 ------Login failed.
 
Help to guide using.
GeneralHelp newbie!!!memberpoldek12312 Aug '09 - 11:39 
GeneralC# versionmemberjammmie9998 Jun '09 - 5:16 
Generali can't use this toolmemberTru Bat Gioi27 Mar '09 - 18:02 
GeneralLogin problemmembersirtyler5417 Jan '09 - 19:41 
GeneralRe: Login problemmembermagikcm10 Mar '09 - 3:48 
AnswerRe: Login problemmemberMember 428824815 May '09 - 5:44 
GeneralThe task file isn't workingmembersirtyler5416 Jan '09 - 20:49 
GeneralRe: The task file isn't workingmembersirtyler5416 Jan '09 - 21:45 
GeneralError with train troop ordermembernico12349 Jul '08 - 20:03 
GeneralRe: Error with train troop ordermemberYzZzN2 Dec '08 - 8:18 
GeneralFail to log inmemberratsilva5 Jun '08 - 12:03 
Generalconvertmemberkreont25 Apr '08 - 2:22 
GeneralError that i couldnt Solve it ! ُmemberalmashm_aa7 Apr '08 - 0:16 
GeneralRe: Error that i couldnt Solve it ! ُmembersherpishoru9 Apr '08 - 2:37 
GeneralRe: Error that i couldnt Solve it ! ُmemberalmashm_aa9 Apr '08 - 23:36 
GeneralRe: Error that i couldnt Solve it ! ُmemberratsilva29 Apr '08 - 21:33 
GeneralNew error on speed.travian.de (so far)membersherpishoru21 Mar '08 - 7:52 
GeneralRe: New error on speed.travian.de (so far)memberCelao28 Apr '08 - 19:03 
QuestionVillageIndexmemberMZS1 Mar '08 - 20:40 
GeneralRe: VillageIndexmembersherpishoru21 Mar '08 - 7:46 
GeneralRe: VillageIndexmemberMZS21 Mar '08 - 21:21 
GeneralRe: VillageIndex [modified]membersherpishoru21 Mar '08 - 23:51 
GeneralRe: VillageIndexmemberlunalovelygood21 Sep '08 - 7:52 
AnswerRe: VillageIndexmembersherpishoru21 Sep '08 - 9:10 
Questionae servermemberA.Shamli29 Feb '08 - 10:34 
AnswerRe: ae servermembersikas_C++11 Sep '08 - 15:27 
QuestionCan't log inmemberjo me22 Jan '08 - 15:55 
GeneralSelecting target with catapultmemberRAADOO15 Dec '07 - 11:58 
GeneralGetting Gunzip: decoding header failedmemberwoot999030 Nov '07 - 5:08 
GeneralRe: Getting Gunzip: decoding header failedmembersherpishoru6 Dec '07 - 20:41 
Generaltrain troop task failedmemberPeter Pivarc22 Nov '07 - 20:49 
GeneralRe: train troop task failedmemberrfsimoes15 Mar '08 - 5:29 
GeneralRe: train troop task failedmemberfjux22 Mar '08 - 7:13 
Generalcan't send troopsmemberJePriRa8 Nov '07 - 5:36 
GeneralRe: can't send troopsmemberhltohin16 Nov '07 - 1:58 
GeneralSuggestions [modified]memberastroboy19287 Nov '07 - 5:27 
GeneralRe: Suggestionsmemberlokys12328 Nov '07 - 2:51 
GeneralRe: Suggestionsmembersherpishoru6 Dec '07 - 20:45 
GeneralERROR on Read Scriptfilemembergrandmasta17 Nov '07 - 2:53 
GeneralErrmemberkokooot6 Nov '07 - 6:52 
GeneralBuild Warnings CountmemberBlake Miller5 Nov '07 - 3:35 
Questionversion 1.0.0.8's sourcesmembernikoTyu3 Nov '07 - 23:44 
AnswerRe: version 1.0.0.8's sourcesmemberRAADOO4 Nov '07 - 5:00 
GeneralRe: version 1.0.0.8's sourcesmembernikoTyu4 Nov '07 - 23:44 
GeneralRe: version 1.0.0.8's sourcesmemberBlake Miller5 Nov '07 - 3:46 
GeneralRe: version 1.0.0.8's sourcesmemberRAADOO5 Nov '07 - 21:14 
GeneralRe: version 1.0.0.8's sourcesmemberrfsimoes22 Mar '08 - 15:37 
GeneralGot Error Msg!membersmoothjazz2 Nov '07 - 20:39 

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 29 Oct 2007
Article Copyright 2007 by HasAName
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid