Newer
Older
IDABot
======
.. class:: library.IDABot
This is the basis of your bot. It contains all available managers and some
methods to get you started.
See :ref:`this page <gettingstarted>` for how to properly
inherit from IDABot.
Instances of managers:
.. attribute:: IDABot.base_location_manager
An instance of the class :class:`library.BaseLocationManager`
.. attribute:: IDABot.tech_tree
An instance of the class :class:`library.TechTree`
.. attribute:: IDABot.map_tools
An instance of the class :class:`library.MapTools`
.. attribute:: IDABot.building_placer
An instance of the class :class:`library.BuildingPlacer`
Inherited methods:
.. method:: 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
:ref:`gettingstarted`).
.. method:: 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
:ref:`gettingstarted`).
Methods:
.. method:: IDABot.get_all_units(self) -> List[library.Unit]
Retrieves a list of all visible units
.. method:: IDABot.get_my_units(self) -> List[library.Unit]
Retrieves a list of all your visible units
.. method:: IDABot.get_player_race(self) -> library.Race
Returns the players race, useful if you play Race.Random
.. method:: IDABot.send_chat(self, message)
Sends the string 'message' to the game chat
.. method:: IDABot.has_creep(self, Point2D) -> Boolean
Returns if the position has a creep.
.. method:: IDABot.move_camera(self, Point2DI)
Move the camera to the position.
Attributes:
.. autoattribute:: minerals
.. autoattribute:: gas
.. autoattribute:: current_supply
.. autoattribute:: max_supply
.. autoattribute:: current_frame
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Debug
-----
When developing AI-methods or when simply having a problem.
The debug-methods are a great tool for speeding up the process.
.. method:: IDABot.debug_create_unit(self, UnitTypeID, Point2D, Player Constant, Int)
This method creates the nr (INT) of units on the position of the Point2D, the unit
belongs to the Player Constant.
.. method:: IDABot.debug_kill_unit(self, Unit)
Kills the unit.
.. method:: IDABot.debug_show_map(self)
Make the entire map visible.
.. method:: IDABot.debug_fast_build(self)
Set the build time in game to 1.
.. method:: IDABot.debug_enemy_control(self)
Gives the player full control over the enemy.
.. method:: IDABot.debug_fast_build(self)
Set the build time in game to 1.
.. method:: IDABot.debug_ignore_food(self)
Ignore food in game.
.. method:: IDABot.debug_ignore_resource_cost(self)
Ignore the resource cost in game. Everything cost 0 resources.
.. method:: IDABot.debug_give_all_resources(self)
Set the mineral and vespene gas to 5000.
.. method:: IDABot.debug_god_mode(self)
Give yourself god mode in the game.
.. method:: IDABot.debug_ignore_mineral(self)
Ignore the mineral cost in the game.
.. method:: IDABot.debug_no_cooldowns(self)
Deactivate cooldowns (Basically setting them to 0).
.. method:: IDABot.debug_give_all_tech(self)
Give yourself all tech.
.. method:: IDABot.debug_give_all_upgrades(self)
Give yourself all upgrades.
.. method:: IDABot.debug_set_score(self, Float)
Set the player score in game.
.. method:: IDABot.debug_end_game(self, Boolean)
End the game, if the Boolean is True then victory.
If False, defeat.
.. method:: IDABot.debug_set_energy(self, Float, Unit)
Set the amount (Float) of energy to the unit.
.. method:: IDABot.debug_set_life(self, Float, Unit)
Set the amount (Float) of life to the unit.
.. method:: IDABot.debug_set_shields(self, Float, Unit)
Set the amount (Float) of shield to the unit.