sc2ai 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/data/sc2ai/protocol/common.proto +5 -5
  3. data/data/sc2ai/protocol/data.proto +22 -22
  4. data/data/sc2ai/protocol/debug.proto +24 -24
  5. data/data/sc2ai/protocol/error.proto +216 -215
  6. data/data/sc2ai/protocol/raw.proto +20 -20
  7. data/data/sc2ai/protocol/sc2api.proto +111 -111
  8. data/data/sc2ai/protocol/score.proto +3 -3
  9. data/data/sc2ai/protocol/spatial.proto +5 -5
  10. data/data/sc2ai/protocol/ui.proto +16 -16
  11. data/exe/sc2ai +0 -3
  12. data/lib/sc2ai/api/data.rb +3 -3
  13. data/lib/sc2ai/connection/connection_listener.rb +3 -3
  14. data/lib/sc2ai/connection/requests.rb +31 -35
  15. data/lib/sc2ai/connection/status_listener.rb +1 -1
  16. data/lib/sc2ai/connection.rb +1 -1
  17. data/lib/sc2ai/local_play/client.rb +2 -2
  18. data/lib/sc2ai/local_play/match.rb +7 -2
  19. data/lib/sc2ai/paths.rb +12 -2
  20. data/lib/sc2ai/player/actions.rb +54 -35
  21. data/lib/sc2ai/player/debug.rb +21 -21
  22. data/lib/sc2ai/player/game_state.rb +11 -18
  23. data/lib/sc2ai/player/geo.rb +54 -64
  24. data/lib/sc2ai/player/units.rb +16 -16
  25. data/lib/sc2ai/player.rb +103 -41
  26. data/lib/sc2ai/ports.rb +1 -1
  27. data/lib/sc2ai/protocol/_meta_documentation.rb +265 -265
  28. data/lib/sc2ai/protocol/common_pb.rb +3865 -15
  29. data/lib/sc2ai/protocol/data_pb.rb +9109 -18
  30. data/lib/sc2ai/protocol/debug_pb.rb +10437 -26
  31. data/lib/sc2ai/protocol/error_pb.rb +1086 -10
  32. data/lib/sc2ai/protocol/extensions/ability_remapable.rb +9 -9
  33. data/lib/sc2ai/protocol/extensions/action.rb +60 -0
  34. data/lib/sc2ai/protocol/extensions/point_2_d.rb +5 -0
  35. data/lib/sc2ai/protocol/extensions/position.rb +10 -35
  36. data/lib/sc2ai/protocol/extensions/power_source.rb +3 -0
  37. data/lib/sc2ai/protocol/extensions/unit.rb +19 -35
  38. data/lib/sc2ai/protocol/query_pb.rb +5025 -17
  39. data/lib/sc2ai/protocol/raw_pb.rb +18350 -27
  40. data/lib/sc2ai/protocol/sc2api_pb.rb +48420 -93
  41. data/lib/sc2ai/protocol/score_pb.rb +5968 -12
  42. data/lib/sc2ai/protocol/spatial_pb.rb +11944 -18
  43. data/lib/sc2ai/protocol/ui_pb.rb +12927 -28
  44. data/lib/sc2ai/unit_group/action_ext.rb +0 -2
  45. data/lib/sc2ai/unit_group/filter_ext.rb +10 -9
  46. data/lib/sc2ai/unit_group/geo_ext.rb +0 -2
  47. data/lib/sc2ai/unit_group.rb +1 -1
  48. data/lib/sc2ai/version.rb +2 -3
  49. data/lib/sc2ai.rb +10 -11
  50. data/lib/templates/ladderzip/bin/ladder.tt +0 -3
  51. data/lib/templates/new/api/common.proto +6 -6
  52. data/lib/templates/new/api/data.proto +23 -20
  53. data/lib/templates/new/api/debug.proto +25 -21
  54. data/lib/templates/new/api/error.proto +217 -215
  55. data/lib/templates/new/api/query.proto +1 -1
  56. data/lib/templates/new/api/raw.proto +16 -14
  57. data/lib/templates/new/api/sc2api.proto +108 -94
  58. data/lib/templates/new/api/score.proto +4 -3
  59. data/lib/templates/new/api/spatial.proto +6 -5
  60. data/lib/templates/new/api/ui.proto +17 -14
  61. data/lib/templates/new/boot.rb.tt +1 -1
  62. data/lib/templates/new/my_bot.rb.tt +1 -1
  63. data/lib/templates/new/run_example_match.rb.tt +2 -2
  64. data/sig/sc2ai.rbs +11005 -1926
  65. metadata +26 -21
  66. data/lib/sc2ai/overrides/kernel.rb +0 -33
  67. data/sig/minaswan.rbs +0 -10323
@@ -1,5 +1,5 @@
1
1
 
2
- syntax = "proto2";
2
+ syntax = "proto3";
3
3
 
4
4
  package Api;
5
5
 
@@ -155,13 +155,14 @@ message Response {
155
155
  }
156
156
 
157
157
  enum Status {
158
- launched = 1; // Game has been launch and is not yet doing anything.
159
- init_game = 2; // Create game has been called, and the host is awaiting players.
160
- in_game = 3; // In a single or multiplayer game.
161
- in_replay = 4; // In a replay.
162
- ended = 5; // Game has ended, can still request game info, but ready for a new game.
163
- quit = 6; // Application is shutting down.
164
- unknown = 99; // Should not happen, but indicates an error if it occurs.
158
+ ENUM_STATUS_UNSET = 0; // PROTO3 COMPAT
159
+ LAUNCHED = 1; // GAME HAS BEEN LAUNCH AND IS NOT YET DOING ANYTHING.
160
+ INIT_GAME = 2; // CREATE GAME HAS BEEN CALLED, AND THE HOST IS AWAITING PLAYERS.
161
+ IN_GAME = 3; // IN A SINGLE OR MULTIPLAYER GAME.
162
+ IN_REPLAY = 4; // IN A REPLAY.
163
+ ENDED = 5; // GAME HAS ENDED, CAN STILL REQUEST GAME INFO, BUT READY FOR A NEW GAME.
164
+ QUIT = 6; // APPLICATION IS SHUTTING DOWN.
165
+ UNKNOWN = 99; // SHOULD NOT HAPPEN, BUT INDICATES AN ERROR IF IT OCCURS.
165
166
  }
166
167
 
167
168
  //-----------------------------------------------------------------------------
@@ -191,14 +192,15 @@ message LocalMap {
191
192
 
192
193
  message ResponseCreateGame {
193
194
  enum Error {
194
- MissingMap = 1;
195
- InvalidMapPath = 2;
196
- InvalidMapData = 3;
197
- InvalidMapName = 4;
198
- InvalidMapHandle = 5;
199
- MissingPlayerSetup = 6;
200
- InvalidPlayerSetup = 7;
201
- MultiplayerUnsupported = 8; // Multiplayer is not supported in the current build.
195
+ ENUM_RESPONSE_CREATE_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
196
+ MISSING_MAP = 1;
197
+ INVALID_MAP_PATH = 2;
198
+ INVALID_MAP_DATA = 3;
199
+ INVALID_MAP_NAME = 4;
200
+ INVALID_MAP_HANDLE = 5;
201
+ MISSING_PLAYER_SETUP = 6;
202
+ INVALID_PLAYER_SETUP = 7;
203
+ MULTIPLAYER_UNSUPPORTED = 8; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD.
202
204
  }
203
205
  optional Error error = 1;
204
206
  optional string error_details = 2;
@@ -231,21 +233,22 @@ message ResponseJoinGame {
231
233
  optional uint32 player_id = 1;
232
234
 
233
235
  enum Error {
234
- MissingParticipation = 1;
235
- InvalidObservedPlayerId = 2;
236
- MissingOptions = 3;
237
- MissingPorts = 4;
238
- GameFull = 5;
239
- LaunchError = 6;
240
-
241
- // Multiplayer specific.
242
- FeatureUnsupported = 7; // Multiplayer is not supported in the current build for the requested features.
243
- NoSpaceForUser = 8;
244
- MapDoesNotExist = 9;
245
- CannotOpenMap = 10;
246
- ChecksumError = 11;
247
- NetworkError = 12;
248
- OtherError = 13;
236
+ ENUM_RESPONSE_JOIN_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
237
+ MISSING_PARTICIPATION = 1;
238
+ INVALID_OBSERVED_PLAYER_ID = 2;
239
+ MISSING_OPTIONS = 3;
240
+ MISSING_PORTS = 4;
241
+ GAME_FULL = 5;
242
+ LAUNCH_ERROR = 6;
243
+
244
+ // MULTIPLAYER SPECIFIC.
245
+ FEATURE_UNSUPPORTED = 7; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD FOR THE REQUESTED FEATURES.
246
+ NO_SPACE_FOR_USER = 8;
247
+ MAP_DOES_NOT_EXIST = 9;
248
+ CANNOT_OPEN_MAP = 10;
249
+ CHECKSUM_ERROR = 11;
250
+ NETWORK_ERROR = 12;
251
+ OTHER_ERROR = 13;
249
252
  }
250
253
  optional Error error = 2;
251
254
  optional string error_details = 3;
@@ -258,7 +261,8 @@ message RequestRestartGame {
258
261
  // The defaultRestartGameLoops is specified to be (1<<18) by default
259
262
  message ResponseRestartGame {
260
263
  enum Error {
261
- LaunchError = 1;
264
+ ENUM_RESPONSE_RESTART_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
265
+ LAUNCH_ERROR = 1;
262
266
  }
263
267
  optional Error error = 1;
264
268
  optional string error_details = 2;
@@ -282,13 +286,14 @@ message RequestStartReplay {
282
286
 
283
287
  message ResponseStartReplay {
284
288
  enum Error {
285
- MissingReplay = 1;
286
- InvalidReplayPath = 2;
287
- InvalidReplayData = 3;
288
- InvalidMapData = 4;
289
- InvalidObservedPlayerId = 5;
290
- MissingOptions = 6;
291
- LaunchError = 7;
289
+ ENUM_RESPONSE_START_REPLAY_ERROR_UNSET = 0; // PROTO3 COMPAT
290
+ MISSING_REPLAY = 1;
291
+ INVALID_REPLAY_PATH = 2;
292
+ INVALID_REPLAY_DATA = 3;
293
+ INVALID_MAP_DATA = 4;
294
+ INVALID_OBSERVED_PLAYER_ID = 5;
295
+ MISSING_OPTIONS = 6;
296
+ LAUNCH_ERROR = 7;
292
297
  }
293
298
  optional Error error = 1;
294
299
  optional string error_details = 2;
@@ -301,7 +306,8 @@ message RequestMapCommand {
301
306
 
302
307
  message ResponseMapCommand {
303
308
  enum Error {
304
- NoTriggerError = 1;
309
+ ENUM_RESPONSE_MAP_COMMAND_ERROR_UNSET = 0; // PROTO3 COMPAT
310
+ NO_TRIGGER_ERROR = 1;
305
311
  }
306
312
  optional Error error = 1;
307
313
  optional string error_details = 2;
@@ -343,11 +349,11 @@ message RequestGameInfo {
343
349
 
344
350
  message ResponseGameInfo {
345
351
  optional string map_name = 1;
346
- repeated string mod_names = 6;
347
352
  optional string local_map_path = 2;
348
353
  repeated PlayerInfo player_info = 3;
349
354
  optional StartRaw start_raw = 4; // Populated if Raw interface is enabled.
350
355
  optional InterfaceOptions options = 5;
356
+ repeated string mod_names = 6;
351
357
  }
352
358
 
353
359
  //-----------------------------------------------------------------------------
@@ -453,11 +459,12 @@ message ResponseReplayInfo {
453
459
  optional uint32 base_build = 8;
454
460
 
455
461
  enum Error {
456
- MissingReplay = 1;
457
- InvalidReplayPath = 2;
458
- InvalidReplayData = 3;
459
- ParsingError = 4;
460
- DownloadError = 5;
462
+ ENUM_RESPONSE_REPLAY_INFO_ERROR_UNSET = 0; // PROTO3 COMPAT
463
+ MISSING_REPLAY = 1;
464
+ INVALID_REPLAY_PATH = 2;
465
+ INVALID_REPLAY_DATA = 3;
466
+ PARSING_ERROR = 4;
467
+ DOWNLOAD_ERROR = 5;
461
468
  }
462
469
  optional Error error = 9;
463
470
  optional string error_details = 10;
@@ -484,7 +491,8 @@ message RequestSaveMap {
484
491
 
485
492
  message ResponseSaveMap {
486
493
  enum Error {
487
- InvalidMapData = 1;
494
+ ENUM_RESPONSE_SAVE_MAP_ERROR_UNSET = 0; // PROTO3 COMPAT
495
+ INVALID_MAP_DATA = 1;
488
496
  }
489
497
  optional Error error = 1;
490
498
  }
@@ -514,31 +522,34 @@ message ResponseDebug {
514
522
  //
515
523
 
516
524
  enum Difficulty {
517
- VeryEasy = 1;
518
- Easy = 2;
519
- Medium = 3;
520
- MediumHard = 4;
521
- Hard = 5;
522
- Harder = 6;
523
- VeryHard = 7;
524
- CheatVision = 8;
525
- CheatMoney = 9;
526
- CheatInsane = 10;
525
+ ENUM_DIFFICULTY_UNSET = 0; // PROTO3 COMPAT
526
+ VERY_EASY = 1;
527
+ EASY = 2;
528
+ MEDIUM = 3;
529
+ MEDIUM_HARD = 4;
530
+ HARD = 5;
531
+ HARDER = 6;
532
+ VERY_HARD = 7;
533
+ CHEAT_VISION = 8;
534
+ CHEAT_MONEY = 9;
535
+ CHEAT_INSANE = 10;
527
536
  }
528
537
 
529
538
  enum PlayerType {
530
- Participant = 1;
531
- Computer = 2;
532
- Observer = 3;
539
+ ENUM_PLAYER_TYPE_UNSET = 0; // PROTO3 COMPAT
540
+ PARTICIPANT = 1;
541
+ COMPUTER = 2;
542
+ OBSERVER = 3;
533
543
  }
534
544
 
535
545
  enum AIBuild {
536
- RandomBuild = 1;
537
- Rush = 2;
538
- Timing = 3;
539
- Power = 4;
540
- Macro = 5;
541
- Air = 6;
546
+ ENUM_AI_BUILD_UNSET = 0; // PROTO3 COMPAT
547
+ RANDOM_BUILD = 1;
548
+ RUSH = 2;
549
+ TIMING = 3;
550
+ POWER = 4;
551
+ MACRO = 5;
552
+ AIR = 6;
542
553
  }
543
554
 
544
555
  message PlayerSetup {
@@ -638,8 +649,9 @@ message Action {
638
649
 
639
650
  message ActionChat {
640
651
  enum Channel {
641
- Broadcast = 1;
642
- Team = 2;
652
+ ENUM_CHANNEL_UNSET = 0; // PROTO3 COMPAT
653
+ BROADCAST = 1;
654
+ TEAM = 2;
643
655
  }
644
656
  optional Channel channel = 1;
645
657
  optional string message = 2;
@@ -681,35 +693,37 @@ message ActionObserverCameraFollowUnits {
681
693
  }
682
694
 
683
695
  enum Alert {
684
- AlertError = 3;
685
- AddOnComplete = 4;
686
- BuildingComplete = 5;
687
- BuildingUnderAttack = 6;
688
- LarvaHatched = 7;
689
- MergeComplete = 8;
690
- MineralsExhausted = 9;
691
- MorphComplete = 10;
692
- MothershipComplete = 11;
693
- MULEExpired = 12;
694
- NuclearLaunchDetected = 1;
695
- NukeComplete = 13;
696
- NydusWormDetected = 2;
697
- ResearchComplete = 14;
698
- TrainError = 15;
699
- TrainUnitComplete = 16;
700
- TrainWorkerComplete = 17;
701
- TransformationComplete = 18;
702
- UnitUnderAttack = 19;
703
- UpgradeComplete = 20;
704
- VespeneExhausted = 21;
705
- WarpInComplete = 22;
696
+ ENUM_ALERT_UNSET = 0; // PROTO3 COMPAT
697
+ ALERT_ERROR = 3;
698
+ ADD_ON_COMPLETE = 4;
699
+ BUILDING_COMPLETE = 5;
700
+ BUILDING_UNDER_ATTACK = 6;
701
+ LARVA_HATCHED = 7;
702
+ MERGE_COMPLETE = 8;
703
+ MINERALS_EXHAUSTED = 9;
704
+ MORPH_COMPLETE = 10;
705
+ MOTHERSHIP_COMPLETE = 11;
706
+ MULE_EXPIRED = 12;
707
+ NUCLEAR_LAUNCH_DETECTED = 1;
708
+ NUKE_COMPLETE = 13;
709
+ NYDUS_WORM_DETECTED = 2;
710
+ RESEARCH_COMPLETE = 14;
711
+ TRAIN_ERROR = 15;
712
+ TRAIN_UNIT_COMPLETE = 16;
713
+ TRAIN_WORKER_COMPLETE = 17;
714
+ TRANSFORMATION_COMPLETE = 18;
715
+ UNIT_UNDER_ATTACK = 19;
716
+ UPGRADE_COMPLETE = 20;
717
+ VESPENE_EXHAUSTED = 21;
718
+ WARP_IN_COMPLETE = 22;
706
719
  }
707
720
 
708
721
  enum Result {
709
- Victory = 1;
710
- Defeat = 2;
711
- Tie = 3;
712
- Undecided = 4;
722
+ ENUM_RESULT_UNSET = 0; // PROTO3 COMPAT
723
+ VICTORY = 1;
724
+ DEFEAT = 2;
725
+ TIE = 3;
726
+ UNDECIDED = 4;
713
727
  }
714
728
 
715
729
  message PlayerResult {
@@ -1,12 +1,13 @@
1
1
 
2
- syntax = "proto2";
2
+ syntax = "proto3";
3
3
 
4
4
  package Api;
5
5
 
6
6
  message Score {
7
7
  enum ScoreType {
8
- Curriculum = 1; // map generated score (from curriculum maps with special scoring)
9
- Melee = 2; // summation of in-progress and current units/buildings value + minerals + vespene
8
+ ENUM_SCORE_TYPE_UNSET = 0; // PROTO3 COMPAT
9
+ CURRICULUM = 1; // MAP GENERATED SCORE (FROM CURRICULUM MAPS WITH SPECIAL SCORING)
10
+ MELEE = 2; // SUMMATION OF IN_PROGRESS AND CURRENT UNITS/BUILDINGS VALUE + MINERALS + VESPENE
10
11
  }
11
12
 
12
13
  optional ScoreType score_type = 6;
@@ -1,5 +1,5 @@
1
1
 
2
- syntax = "proto2";
2
+ syntax = "proto3";
3
3
 
4
4
  package Api;
5
5
 
@@ -101,10 +101,11 @@ message ActionSpatialCameraMove {
101
101
  message ActionSpatialUnitSelectionPoint {
102
102
  optional PointI selection_screen_coord = 1;
103
103
  enum Type {
104
- Select = 1; // Equivalent to normal click. Changes selection to unit.
105
- Toggle = 2; // Equivalent to shift+click. Toggle selection of unit.
106
- AllType = 3; // Equivalent to control+click. Selects all units of a given type.
107
- AddAllType = 4; // Equivalent to shift+control+click. Selects all units of a given type.
104
+ ENUM_ACTION_SPATIAL_UNIT_SELECTION_POINT_TYPE_UNSET = 0; // PROTO3 COMPAT
105
+ SELECT = 1; // EQUIVALENT TO NORMAL CLICK. CHANGES SELECTION TO UNIT.
106
+ TOGGLE = 2; // EQUIVALENT TO SHIFT+CLICK. TOGGLE SELECTION OF UNIT.
107
+ ALL_TYPE = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
108
+ ADD_ALL_TYPE = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
108
109
  }
109
110
  optional Type type = 2;
110
111
  }
@@ -1,5 +1,5 @@
1
1
 
2
- syntax = "proto2";
2
+ syntax = "proto3";
3
3
 
4
4
  package Api;
5
5
 
@@ -90,11 +90,12 @@ message ActionUI {
90
90
 
91
91
  message ActionControlGroup {
92
92
  enum ControlGroupAction {
93
- Recall = 1; // Equivalent to number hotkey. Replaces current selection with control group.
94
- Set = 2; // Equivalent to Control + number hotkey. Sets control group to current selection.
95
- Append = 3; // Equivalent to Shift + number hotkey. Adds current selection into control group.
96
- SetAndSteal = 4; // Equivalent to Control + Alt + number hotkey. Sets control group to current selection. Units are removed from other control groups.
97
- AppendAndSteal = 5; // Equivalent to Shift + Alt + number hotkey. Adds current selection into control group. Units are removed from other control groups.
93
+ ENUM_CONTROL_GROUP_ACTION_UNSET = 0; // PROTO3 COMPAT
94
+ RECALL = 1; // EQUIVALENT TO NUMBER HOTKEY. REPLACES CURRENT SELECTION WITH CONTROL GROUP.
95
+ SET = 2; // EQUIVALENT TO CONTROL + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION.
96
+ APPEND = 3; // EQUIVALENT TO SHIFT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP.
97
+ SET_AND_STEAL = 4; // EQUIVALENT TO CONTROL + ALT + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
98
+ APPEND_AND_STEAL = 5; // EQUIVALENT TO SHIFT + ALT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
98
99
  }
99
100
  optional ControlGroupAction action = 1;
100
101
  optional uint32 control_group_index = 2;
@@ -113,20 +114,22 @@ message ActionSelectLarva {
113
114
 
114
115
  message ActionSelectIdleWorker {
115
116
  enum Type {
116
- Set = 1; // Equivalent to click with no modifiers. Replaces selection with single idle worker.
117
- Add = 2; // Equivalent to shift+click. Adds single idle worker to current selection.
118
- All = 3; // Equivalent to control+click. Selects all idle workers.
119
- AddAll = 4; // Equivalent to shift+control+click. Adds all idle workers to current selection.
117
+ ENUM_ACTION_SELECT_IDLE_WORKER_TYPE_UNSET = 0; // PROTO3 COMPAT
118
+ SET = 1; // EQUIVALENT TO CLICK WITH NO MODIFIERS. REPLACES SELECTION WITH SINGLE IDLE WORKER.
119
+ ADD = 2; // EQUIVALENT TO SHIFT+CLICK. ADDS SINGLE IDLE WORKER TO CURRENT SELECTION.
120
+ ALL = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL IDLE WORKERS.
121
+ ADD_ALL = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. ADDS ALL IDLE WORKERS TO CURRENT SELECTION.
120
122
  }
121
123
  optional Type type = 1;
122
124
  }
123
125
 
124
126
  message ActionMultiPanel {
125
127
  enum Type {
126
- SingleSelect = 1; // Click on icon
127
- DeselectUnit = 2; // Shift Click on icon
128
- SelectAllOfType = 3; // Control Click on icon.
129
- DeselectAllOfType = 4; // Control+Shift Click on icon.
128
+ ENUM_ACTION_MULTI_PANEL_TYPE_UNSET = 0; // PROTO3 COMPAT
129
+ SINGLE_SELECT = 1; // CLICK ON ICON
130
+ DESELECT_UNIT = 2; // SHIFT CLICK ON ICON
131
+ SELECT_ALL_OF_TYPE = 3; // CONTROL CLICK ON ICON.
132
+ DESELECT_ALL_OF_TYPE = 4; // CONTROL+SHIFT CLICK ON ICON.
130
133
  }
131
134
  optional Type type = 1;
132
135
  optional int32 unit_index = 2;
@@ -3,4 +3,4 @@
3
3
  # as $bot is created correctly. if not, your ladder bot will break.
4
4
 
5
5
  require_relative "<%= @bot_file %>"
6
- $bot = <%= @classname %>.new(name: "<%= @botname %>", race: Api::Race::<%= @race %>)
6
+ $bot = <%= @classname %>.new(name: "<%= @botname %>", race: Api::Race::<%= @race.upcase %>)
@@ -15,7 +15,7 @@ class <%= @classname %> < Sc2::Player::Bot
15
15
 
16
16
  # If your attack fails, "good game" and exit
17
17
  if units.workers.size.zero?
18
- action_chat("gg", channel: Api::ActionChat::Channel::Broadcast)
18
+ action_chat("gg", channel: Api::ActionChat::Channel::BROADCAST)
19
19
  leave_game
20
20
  end
21
21
  end
@@ -2,13 +2,13 @@
2
2
  require "./boot.rb"
3
3
 
4
4
  # Or simply, create by hand
5
- #my_bot = MyBot.new(name: "Botname", race: Api::Race::Random)
5
+ #my_bot = MyBot.new(name: "Botname", race: Api::Race::RANDOM)
6
6
 
7
7
  # Start a match
8
8
  Sc2::Match.new(
9
9
  players: [
10
10
  $bot,
11
- Sc2::Player::Computer.new(race: Api::Race::Random, difficulty: Api::Difficulty::VeryEasy)
11
+ Sc2::Player::Computer.new(race: Api::Race::RANDOM, difficulty: Api::Difficulty::VERY_EASY)
12
12
  ],
13
13
  map: "GoldenAura513AIE" # Or any of the downloaded map names
14
14
  ).run