Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyCommandCenter v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Bonnaudet
PyCommandCenter v2
Commits
9be6bd16
Commit
9be6bd16
authored
4 years ago
by
Rojikku98
Browse files
Options
Downloads
Patches
Plain Diff
Docs for IDAReplayObserver and ReplayUnit
parent
a3de127a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/idareplayobserver.rst
+39
-0
39 additions, 0 deletions
docs/idareplayobserver.rst
docs/replays.rst
+21
-6
21 additions, 6 deletions
docs/replays.rst
docs/replayunit.rst
+76
-0
76 additions, 0 deletions
docs/replayunit.rst
with
136 additions
and
6 deletions
docs/idareplayobserver.rst
0 → 100644
+
39
−
0
View file @
9be6bd16
IDABot
======
.. class:: library.IDAReplayObserver
This is the basis of a replayObserver.
Inherited methods:
.. method:: IDAReplayObserver.on_game_start(self)
This method is called when a Starcraft replay 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:`replays`).
.. method:: IDAReplayObserver.on_step(self)
This method is called on every tick of the replay, when you inherit it you
have to call the parent's on_step method in order to make it work (see
:ref:`replays`).
.. method:: IDAReplayObserver.on_game_end(self)
This method is called when the replay has ended, when you inherit it you have to
call the parent's on_game_start method in order to make it work (see
:ref:`replays`).
Methods:
.. method:: IDABot.get_all_units(self) -> List[library.ReplayUnit]
Retrieves a list of all visible units
Attributes:
.. autoattribute:: minerals
This diff is collapsed.
Click to expand it.
docs/replays.rst
+
21
−
6
View file @
9be6bd16
...
...
@@ -56,7 +56,7 @@ Here is a short example that uses SC2Reader to extract the build order.
print("Res: " + text)
SC2Reader has
good
documation_ that also describe what information
SC2Reader has documation_ that also describe what information
could be found. `What is in a Replay`_ and Events_ gives a good idea
if the information you want could be colleced whithe SC2Reader.
...
...
@@ -66,8 +66,8 @@ if the information you want could be colleced whithe SC2Reader.
ReplayObserver
--------------
This is the second technique it is much like using a bot but whit the diffren
s
that no action can be preform just observations
This is the second technique it is much like using a bot but whit the
main
diff
e
ren
ce
that no action can be preform just observations
. No debug actions can be taken.
.. code-block:: python
...
...
@@ -85,14 +85,29 @@ that no action can be preform just observations
def on_step(self):
ReplayObserver.on_step(self)
def on_game_end(self):
IDAReplayObserver.on_game_end(self)
def main():
coordinator = Coordinator(r"D:\StarCraft II\Versions\Base69232\SC2_x64.exe")
print(coordinator.load_replay_list("D:\\Replays\\"))
coordinator.add_replay_observer(MyObserver())
my_observer = MyObserver()
coordinator.add_replay_observer(my_observer)
while coordinator.update():
pass
if __name__ == "__main__":
main()
\ No newline at end of file
main()
Replay files
------------
Replay files are version depended.
Replays with tracker events for some versions can be found for example at spawningtool_ and gggreplays_.
Replays without tracker events can be download with s2client-proto_. The requested version is 4.6.2
.. _spawningtool: https://lotv.spawningtool.com/replays/?pro_only=on
.. _gggreplays: https://gggreplays.com/matches
.. _s2client-proto: https://github.com/Blizzard/s2client-proto/tree/master/samples/replay-api
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/replayunit.rst
0 → 100644
+
76
−
0
View file @
9be6bd16
Unit
====
.. class:: library.ReplayUnit
An instance of the class Unit represents one unit in a replay. A ReplayUnit is a
:class`library.Unit` white some limitations.
It is possible to use ReplayUnit as keys in a dictionary, which might be helpful
for bookkeeping.
Properties:
.. autoattribute:: buffs
Returns a list of BuffID
.. autoattribute:: build_percentage
.. autoattribute:: energy
.. autoattribute:: facing
Returns the direction the unit is facing
.. autoattribute:: hit_points
.. autoattribute:: max_hit_points
.. autoattribute:: id
.. autoattribute:: is_alive
.. autoattribute:: is_blip
Returns true if unit is a "blip" - a ping on the map.
.. autoattribute:: is_being_constructed
Returns build_progress > 0
.. autoattribute:: is_burrowed
.. autoattribute:: is_cloaked
.. autoattribute:: is_completed
Returns build_progress >= 1
.. autoattribute:: is_flying
.. autoattribute:: is_idle
.. autoattribute:: is_powered
.. autoattribute:: is_training
.. autoattribute:: is_valid
.. attribute:: ReplayUnit.player
Returns the constant corresponding to player which this unit belongs to.
See :ref:`playerconstants` for more information.
.. autoattribute:: position
.. autoattribute:: current_ability_id
.. autoattribute:: progress
Returns the progress of currently used ability (-1 if not using ability)
.. autoattribute:: radius
Retruns the radius of the unit
.. autoattribute:: shields
.. autoattribute:: tile_position
.. autoattribute:: unit_type
Returns the id of the unit_type
.. autoattribute:: unit_type_name
Returns the name of the unit_type
.. autoattribute:: weapon_cooldown
.. autoattribute:: is_carrying_minerals
Returns if this unit is currently holding minerals
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment