IDABot

class library.IDABot

This is the basis of your bot. It contains all available managers and some methods to get you started.

See this page for how to properly inherit from IDABot.

Instances of managers:

IDABot.base_location_manager

An instance of the class library.BaseLocationManager

IDABot.tech_tree

An instance of the class library.TechTree

IDABot.map_tools

An instance of the class library.MapTools

IDABot.building_placer

An instance of the class library.BuildingPlacer

Inherited methods:

IDABot.on_game_start(self)

This method when Starcraft has stared, when you inherit it you have to call the parent’s on_game_start method in order to make it work (see Getting started).

IDABot.on_step(self)

This method is run on every tick of the game, when you inherit it you have to call the parent’s on_step method in order to make it work (see Getting started).

Methods:

IDABot.get_all_units(self) → List[library.Unit]

Retrieves a list of all visible units

IDABot.get_my_units(self) → List[library.Unit]

Retrieves a list of all your visible units

IDABot.get_player_race(self) → library.Race

Returns the players race, useful if you play Race.Random

IDABot.send_chat(self, message)

Sends the string ‘message’ to the game chat

IDABot.has_creep(self, Point2D) → Boolean

Returns if the position has a creep

IDABot.move_camera(self, Point2DI)

Move the camera to the position

IDABot.ability_for_upgrade(self, UpgradeID)

Ability that researches this upgrade

Example: If we send in UPGRADE_ID.BANSHEECLOAK, it will return ABILITY_ID.RESEARCH_BANSHEECLOAKINGFIELD. In this case, the unit of scv has the ability for this. You can then use the unit.ability(AbilityID) on the scv for creating the upgrade.

IDABot.upgrade_mineral_cost(self, UpgradeID)

Mineral cost of researching the upgrade

IDABot.upgrade_gas_cost(self, UpgradeID)

Vespene/gas cost of researching the upgrade

IDABot.upgrade_research_time(self, UpgradeID)

Time in GameLoops to research this upgrade

IDABot.effect_radius(self, EffectID)

Size of the circle the effect impacts

Attributes:

IDABot.minerals

How much minerals we currently have

IDABot.gas

How much gas we currently have

IDABot.current_supply

How much supply we are currently using

IDABot.max_supply

How much supply we can currently use

IDABot.current_frame

Which frame we are currently on

Debug

When developing AI-methods or when simply having a problem. The debug-methods are a great tool for speeding up the process.

IDABot.debug_create_unit(self, UnitTypeID, Point2D, Player Constant, Int)

This method creates the nr (INT) of units on the position library.Point2D, the unit belongs to the Player Constant

IDABot.debug_kill_unit(self, Unit)

Kills the library.Unit

IDABot.debug_show_map(self)

Make the entire map visible

IDABot.debug_fast_build(self)

Set the build time in game to 1

IDABot.debug_enemy_control(self)

Gives the player full control over the enemy

IDABot.debug_fast_build(self)

Set the build time in game to 1

IDABot.debug_ignore_food(self)

Ignore food in game

IDABot.debug_ignore_resource_cost(self)

Ignore the resource cost in game. Everything cost 0 resources

IDABot.debug_give_all_resources(self)

Set the mineral and vespene gas to 5000

IDABot.debug_god_mode(self)

Give yourself god mode in the game

IDABot.debug_ignore_mineral(self)

Ignore the mineral cost in the game

IDABot.debug_no_cooldowns(self)

Deactivate cooldowns (Basically setting them to 0)

IDABot.debug_give_all_tech(self)

Give yourself all tech

IDABot.debug_give_all_upgrades(self)

Give yourself all upgrades

IDABot.debug_set_score(self, Float)

Set the player score in game

IDABot.debug_end_game(self, Boolean)

End the game, if the Boolean is True then victory. If False, defeat.

IDABot.debug_set_energy(self, Float, Unit)

Set the amount (Float) of energy to the library.Unit The maximum depends on the unit maxenergy. Note: This is not in percent of the unit energy. Same goes for life and shields.

IDABot.debug_set_life(self, Float, Unit)

Set the amount (Float) of life to the unit

IDABot.debug_set_shields(self, Float, Unit)

Set the amount (Float) of shield to the unit