GithubHelp home page GithubHelp logo

travianapi's Introduction

TravianApi

Guerrilla Api for Travian. Why Guerrilla? Because is not oficcial, scraping bassed api.


WARNING: If u use the api, you can be baneated from game. It's for educational porpouses only.

What can i do with that?

Actually, i have implemented the construction functionality. You can build resources, build builgings (no, it's not redundant), consult actual production, consult actual queue, map resoures and map buildings.

Methods:

General


Constructor:

api = TravianGuerrillaApi("user_example","password_example", "server_example","domain_example")


Initialize the api

loggin(user, pasword)
Log in the travian webpage ( constructor do that)

Resources and buildings

actual_queue()
Show the actual construction queue

busy_until()
Return the seconds to complete the construction queue

build_resource(resource_id)
Build (if its posible) a resource (dorf1) in the resource_id position

show_avilable_building(solar_id,category_id=1):
Show the possible buildings for a certain solar, category is arbitrari, default 1 (1 - infraestructure, 2 - military, 3 - resources)

build_building(solar_id, building_id)
If posible, build a certain building in the specified solar

upgrade_building(solar_id):
If possible, upgrade the building in the speified solar

get_actual_production()
Show the actual resource production

map_resources()
Show the actual resources (dorf1) ,their levels and the id

map_buildings()
Show the actual buildings (dorf2) ,their levels and the id

actual_resources()
Show the actual balance of the resources

Units production

show_available_units(solar_id)
Show the actual available units (infantry)

create_units(solar_id,t1,t2,t3)
Create units in the barracks, only infantry (on construction)

get_actual_units()
Returns a dict with {'troop_name':'number of units'}

get_actual_units_by_tier()
Returns a dict with {'tier':'number of units'}

Units movements

send_attack(coord, mode='4', t1=0, t2=0, t3=0, t4=0, t5=0, t6=0, t7=0, t8=0, t9=0, t10=0)
Send attack to the specified coordenates:
Usage

  • coord -> ['88','-55']
  • mode:
    • '2' -> reinforcement
    • '3' -> normal attack
    • '4' -> raid attack

Village management

list_villages()
Return a dict of village and id

set_village(village_id)
set the village to manage

World infromation

get_alliance(alliance_id)
Returns an Alliance object with information of the ally and their members

show_land(coord_x, coord_y)
Return inormation about the selected land

travianapi's People

Contributors

sarrablo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

travianapi's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.