Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
7.6 update for gwent 7.2
Browse files Browse the repository at this point in the history
* leader fixed
*
  • Loading branch information
vadash committed Sep 1, 2020
1 parent 0a31a7e commit 48d008a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("7.5.*")]
[assembly: AssemblyVersion("7.6.*")]
4 changes: 4 additions & 0 deletions gwent-daily-reborn/Model/Cards/Leader/WoodlandSpirit.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Drawing;
using gwent_daily_reborn.Model.Control.BotTasks;
using gwent_daily_reborn.Model.Helpers.Keyboard;
using gwent_daily_reborn.Model.Settings;

namespace gwent_daily_reborn.Model.Cards.Leader
Expand Down Expand Up @@ -30,6 +31,9 @@ private static bool EndPlayModified(ICollection<IBotTask> tasks)
tasks.Add(new MouseMoveTask(emptyArea));
tasks.Add(new LeftMouseClick());
tasks.Add(new SleepTask(1000));
tasks.Add(new KeyboardTask(Messaging.VKeys.Up));
tasks.Add(new KeyboardTask(Messaging.VKeys.Down));
tasks.Add(new KeyboardTask(Messaging.VKeys.Enter));
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion gwent-daily-reborn/Model/Recognition/OpenCvOcrMt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public OpenCvOcrMt()
for (var i = 0; i < MaxTextOcr; i++)
{
// fast eng version
var ocr = new Tesseract(path, "eng", OcrEngineMode.TesseractLstmCombined);
var ocr = new Tesseract(path, "eng", OcrEngineMode.LstmOnly);
ocr.SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
ocr.PageSegMode = PageSegMode.SingleLine;
OcrText.Add(new OcrWithMutex(ocr, new object()));
Expand Down
21 changes: 11 additions & 10 deletions gwent-daily-reborn/Model/Recognition/Recognition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Emgu.CV.Structure;
using gwent_daily_reborn.Model.Cards;
using gwent_daily_reborn.Model.GameInfo;
using gwent_daily_reborn.Model.Helpers.Tooltip;
using gwent_daily_reborn.Model.NN;
using gwent_daily_reborn.Model.Recognition.ScreenShotManager;
using gwent_daily_reborn.Model.Settings;
Expand Down Expand Up @@ -205,21 +206,25 @@ private async Task<bool> UpdateExtraDataParallel()
{
var leaderChargeScreen = ssManager.CloneImage(Hardware.LeaderChargeOn.Rectangle);
var howManyToCheck = leaderChargeScreen.Width * leaderChargeScreen.Height * Hardware.LeaderChargeOn.Percent / 100;
return ImageCompare.SearchForPixel(
var result = ImageCompare.SearchForPixel(
leaderChargeScreen,
Hardware.LeaderChargeOn.Color,
Hardware.LeaderChargeOn.ColorVarience,
howManyToCheck);
Services.Container.GetInstance<ITooltip>().Show($"isLeaderOn = {result}");
return result;
});
var isLeaderOff = Task.Run(() =>
{
var leaderChargeScreen = ssManager.CloneImage(Hardware.LeaderChargeOff.Rectangle);
var howManyToCheck = leaderChargeScreen.Width * leaderChargeScreen.Height * Hardware.LeaderChargeOff.Percent / 100;
return ImageCompare.SearchForPixel(
var result = ImageCompare.SearchForPixel(
leaderChargeScreen,
Hardware.LeaderChargeOff.Color,
Hardware.LeaderChargeOff.ColorVarience,
howManyToCheck);
Services.Container.GetInstance<ITooltip>().Show($"isLeaderOff = {result}");
return result;
});
var isEnemyPassed = Task.Run(() =>
{
Expand Down Expand Up @@ -260,14 +265,10 @@ private async Task<bool> UpdateExtraDataParallel()
});
var needStartGame = Task.Run(() =>
{
var startGameScreen = ssManager.CloneImage(Hardware.StartGameDetection.Rectangle);
var howManyToCheck = startGameScreen.Width * startGameScreen.Height *
(Hardware.StartGameDetection.Percent / 100f);
return ImageCompare.SearchForPixel(
startGameScreen,
Hardware.StartGameDetection.Color,
Hardware.StartGameDetection.ColorVarience,
(int) howManyToCheck);
var image = ssManager.CloneImage(Hardware.StartGameDetection.Rectangle).Convert<Gray, byte>();
PreProcessText(image, 127);
return Ocr.AreSame(
Hardware.StartGameDetection.Text, image);
});
var isModalDialog1Opened = Task.Run(() =>
{
Expand Down
20 changes: 10 additions & 10 deletions gwent-daily-reborn/Model/Settings/Hardware1080p.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ internal class Hardware1080P : IHardwareConstants
new Rectangle(830, 33, 93, 45),
"PICK");

public RectoColor StartGameDetection => new RectoColor(
new Rectangle(1856, 999, 7, 20),
Color.FromArgb(176, 134, 80), 20, 32);
public RectoString StartGameDetection => new RectoString(
new Rectangle(619, 336, 228, 46),
"STANDARD");

public Rectangle StartGameClickLocation => new Rectangle(432, 365, 123, 365);

Expand Down Expand Up @@ -104,21 +104,21 @@ internal class Hardware1080P : IHardwareConstants
"anywhere");

/// <summary>
/// placeholder
/// Main screen - Choose Play between 4 options
/// </summary>
public RectoString ModalDialogButton7 => new RectoString(
new Rectangle(1, 1, 1, 1),
"1111111111111");
new Rectangle(956, 642, 81, 34),
"PLAY");

public Rectangle LeaderLocation => new Rectangle(28, 696, 134, 152);

public RectoColor LeaderChargeOn => new RectoColor(
new Rectangle(35, 752, 5, 5),
Color.FromArgb(126, 24, 8), 50, 24);
new Rectangle(57, 784, 5, 5),
Color.FromArgb(154, 93, 37), 50, 24);

public RectoColor LeaderChargeOff => new RectoColor(
new Rectangle(35, 752, 5, 5),
Color.FromArgb(75, 16, 9), 50, 24);
new Rectangle(57, 784, 5, 5),
Color.FromArgb(91, 67, 39), 50, 24);

public Rectangle LeaderChargeLocationBig => new Rectangle(33, 902, 51, 51);

Expand Down
2 changes: 1 addition & 1 deletion gwent-daily-reborn/Model/Settings/IHardwareConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal interface IHardwareConstants
/// <summary>
/// Object to look for starting game stage
/// </summary>
RectoColor StartGameDetection { get; }
RectoString StartGameDetection { get; }

/// <summary>
/// Play -> Classic union zone
Expand Down

0 comments on commit 48d008a

Please sign in to comment.