Skip to content

Commit

Permalink
Merge pull request #87 from 9-9-9-9/b/fix-update-29-11-2022
Browse files Browse the repository at this point in the history
Fix bot after Nov 28th 2022
  • Loading branch information
9-9-9-9 authored Nov 30, 2022
2 parents 834a3ff + 43aef39 commit a4305b1
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 18 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Welcome Bit Verse
### and new BH update at Nov 16 2022
### Almost functions were fixed and back to work. Expedition will be fixed as soon as possible
### and new BH update at Nov 16th 2022 & Nov 28th 2022
### Remaining features need to be updated
- [ ] Invasion
- [ ] Gauntlet
- [ ] GVG
- [ ] Idol Dimension (Expedition)
- [ ] Hallowed Dimension (Expedition)
- [ ] Jammie Dimension (Expedition)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>bh.bot</groupId>
<artifactId>99bot</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>

<dependencies>
<dependency>
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/bh/bot/app/AbstractApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,9 @@ protected Tuple2<Point[], Byte> detectRadioButtons(Rectangle scanRect) {

try (ScreenCapturedResult screenCapturedResult = captureElementInEstimatedArea(
new Offset(Math.max(0, scanRect.x - positionTolerant), Math.max(0, scanRect.y - positionTolerant)),
scanRect.width + positionTolerant * 2, scanRect.height + positionTolerant * 2)) {
scanRect.width + positionTolerant * 2,
scanRect.height + positionTolerant * 2
)) {
BufferedImage sc = screenCapturedResult.image;
saveDebugImage(sc, "detectRadioButtons");

Expand Down Expand Up @@ -675,7 +677,7 @@ protected Tuple2<Point[], Byte> detectRadioButtons(Rectangle scanRect) {
else {
if (selectedRadioButtonIndex != curRadioButtonIndex)
throw new InvalidDataException(
"Found more than one selected radio button which is absolutely wrong!"
String.format("Found more than one selected radio button which is absolutely wrong! (no.%d conflicts with no.%d)", curRadioButtonIndex + 1, selectedRadioButtonIndex + 1)
);
}
break;
Expand All @@ -687,6 +689,7 @@ protected Tuple2<Point[], Byte> detectRadioButtons(Rectangle scanRect) {
x, y
);
startingCoords.add(new Point(x, y));
x += Math.max(0, im.getWidth() - 2);
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/bh/bot/app/dev/TestApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ protected void internalRun(String[] args) {
adjustScreenOffset();

//
Tuple2<Point[], Byte> result = detectRadioButtons(
Configuration.screenResolutionProfile.getRectangleRadioButtonsOfRaid()
);
Point[] points = result._1;
int selectedLevel = result._2 + 1;
info("Selected %d", selectedLevel);
for (int i = 0; i < points.length; i++) {
Point p = points[i];
info("[%d] %d,%d", i + 1, p.x - Configuration.gameScreenOffset.X.get(), p.y - Configuration.gameScreenOffset.Y.get());
}
}

private static void testParseTime() {
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/bh/bot/common/types/AttendablePlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ public AttendablePlace(String name, int id, String imgCode, boolean left, int pr

String imgFile;
switch(imgCode) {
case "gvg":
case "gauntlet":
case "invasion":
imgFile = imgCode + "2";
break;
case "pvp":
case "world-boss":
case "raid":
case "gvg":
case "trials":
case "gauntlet":
case "invasion":
case "expedition":
imgFile = imgCode + "2";
imgFile = imgCode + "3";
break;
default:
imgFile = imgCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public Offset getOffsetButtonTownAfterCompetedGauntlet() {

@Override
public Offset getOffsetButtonAuto() {
return new Offset(778, 213);
return new Offset(777, 214);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/bh/bot/common/types/images/BwMatrixMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,17 @@ public static void load() throws IOException {
0xFFFFFF
);
Metas.Globally.Buttons.autoG = BwMatrixMeta.from(//
"buttons/globally.auto-green2?",
"buttons/globally.auto-green3?",
Configuration.screenResolutionProfile.getOffsetButtonAuto(), //
0xFFFFFF
);
Metas.Globally.Buttons.autoR = BwMatrixMeta.from(//
"buttons/globally.auto-red2?",
"buttons/globally.auto-red3?",
Configuration.screenResolutionProfile.getOffsetButtonAuto(), //
0xFFFFFF
);
Metas.Globally.Buttons.radioButton = BwMatrixMeta.from(//
"buttons/globally.radio-button2?",
"buttons/globally.radio-button3?",
Offset.none(), //
0x000000
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bh/bot/common/utils/InteractionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static void hideCursor() {
public static void clickRadioButton(int level, Point[] points, String evName) {
if (level < 1 || level > points.length)
throw new InvalidDataException(
"Can not select level %d of %s because it's not exists, do you setup wrongly?", level, evName
"Can not select level %d/%d of %s because it's not exists, do you setup wrongly?", level, points.length, evName
);
Point p = points[level - 1];
moveCursor(new Point(p.x + 7, p.y + 7));
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 2 additions & 4 deletions web/json/reject-versions-2.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"bv": ["2.12.0","2.11.0","2.10.1","2.10.0","2.9.3","2.9.2","2.9.1","2.9.0","2.8.6","2.8.5","2.8.4","2.8.3","2.8.2","2.8.1","2.8.0","2.7.0","2.6.0","2.5.0","2.4.0","2.3.0","2.2.0","2.1.0","2.0.1","2.0.0"],
"bv": ["3.3.0","3.2.0","3.1.0","3.0.0","2.12.0","2.11.0","2.10.1","2.10.0","2.9.3","2.9.2","2.9.1","2.9.0","2.8.6","2.8.5","2.8.4","2.8.3","2.8.2","2.8.1","2.8.0","2.7.0","2.6.0","2.5.0","2.4.0","2.3.0","2.2.0","2.1.0","2.0.1","2.0.0"],
"bf": {
"3.2.0": ["expedition"],
"3.1.0": ["expedition"],
"3.0.0": ["expedition","invasion","gauntlet"]
"3.4.0": ["invasion","gauntlet"]
}
}

0 comments on commit a4305b1

Please sign in to comment.