Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: AFK Questing Loop #93

Merged
merged 28 commits into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a7fc382
add initial questing
daredoes Jan 20, 2023
fa8f1d8
Add bmp
daredoes Jan 20, 2023
7061bf7
select quest and cancel
daredoes Jan 20, 2023
3a04c1a
attempt to add quest app basics
daredoes Jan 20, 2023
82c7ece
Add Quest Mode
daredoes Jan 20, 2023
7c9c505
reorder quest
daredoes Jan 21, 2023
57ada12
add experimental quest finder
daredoes Jan 22, 2023
fc90ea3
add experimental quest finder
daredoes Jan 22, 2023
71896aa
support entering any found level
daredoes Jan 22, 2023
5ff48bc
support multiple quest modes
daredoes Jan 22, 2023
e28980d
mostly get quest level lookup working
daredoes Jan 22, 2023
cb07a98
find boss level
daredoes Jan 22, 2023
cf766c0
refactor
daredoes Jan 22, 2023
80a2113
update version
daredoes Jan 22, 2023
4326a99
modify screen select
daredoes Jan 25, 2023
544b2e7
start adding confirmation of level select
daredoes Jan 26, 2023
b94125b
use energy to confirm level choice
daredoes Jan 26, 2023
247ac60
revert unused changes
daredoes Jan 27, 2023
ed11841
remove unused files
daredoes Jan 27, 2023
1120f4f
auto bat file
daredoes Jan 27, 2023
fa15071
auto bat file
daredoes Jan 27, 2023
b37b794
minor lint changes
daredoes Jan 27, 2023
458f011
convert to long
daredoes Jan 27, 2023
7942019
increase description on settings app
daredoes Jan 27, 2023
701ef4b
update quest to prevent leave dungeon and image quality
daredoes Jan 29, 2023
cf8dc62
swap image name
daredoes Jan 29, 2023
ae26800
merge
daredoes Jan 29, 2023
385b575
bump version in pom file and reject version file
daredoes Jan 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor
  • Loading branch information
daredoes committed Jan 22, 2023
commit cf766c009a7170cf94bb58cd3779ea738024a5aa
2 changes: 1 addition & 1 deletion ReRun.web.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
:: Consider adding `--profile=YourProfileName` so you no longer needed to select profile manually
:: You can remove flag `--ear` to keep game online all day (but still gone if you got Disconnected)
:: With steam version of BH, refer to AFK.steam.bat file
call web.bot.bat quest --debug --img --profile=dare
call web.bot.bat afk Q --profile=dare
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
2 changes: 1 addition & 1 deletion src/main/java/bh/bot/app/AbstractApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ protected boolean tryEnterQuest(boolean doQuest, UserConfig userConfig, Supplier
Point emptyStarCoords = game.findByScanScreen(BwMatrixMeta.Metas.Dungeons.Buttons.emptyStar, 63, 96, 36, 115);
if (emptyStarCoords == null) {
debug("Looking for next level");
Point nextLevelCoords = game.findQuest(BwMatrixMeta.Metas.Dungeons.Buttons.questLevel);
Point nextLevelCoords = game.findByScanScreen(BwMatrixMeta.Metas.Dungeons.Buttons.questLevel, 63, 96, 36, 115);
if (nextLevelCoords == null) {
} else {
levelCoords = nextLevelCoords;
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/bh/bot/app/farming/QuestApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,4 @@ protected String getLimitationExplain() {
protected int getDefaultMainLoopInterval() {
return 1_000;
}

@SuppressWarnings("unused")
private Point findQuest(BwMatrixMeta levelIm) {
return this.gameScreenInteractor.findQuest(levelIm);
}

}
36 changes: 18 additions & 18 deletions src/main/java/bh/bot/common/types/AttendablePlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@ public AttendablePlace(String name, int id, String imgName, boolean left) throws
this(name, id, imgName, left, (short) 30);
}

public AttendablePlace(String name, int id, String imgCode, boolean left, int procedureTicketMinutes) throws IOException {
public AttendablePlace(String name, int id, String imgCode, boolean left, int procedureTicketMinutes)
throws IOException {
this.name = name;
this.id = id;

String imgFile;
switch(imgCode) {
case "pvp":
case "world-boss":
case "raid":
case "invasion":
case "trials":
case "gvg":
switch (imgCode) {
case "pvp":
case "world-boss":
case "raid":
case "invasion":
case "trials":
case "gvg":
case "quest":
case "gauntlet":
case "expedition":
imgFile = imgCode + "3";
break;
default:
imgFile = imgCode;
break;
case "gauntlet":
case "expedition":
imgFile = imgCode + "3";
break;
default:
imgFile = imgCode;
break;
}
this.img = BwMatrixMeta.from(
String.format("labels/attendable-places/%s?", imgFile),
new Offset(0, 0),
0xFFFFFF
);
0xFFFFFF);
this.left = left;
this.procedureTicketMinutes = (short) procedureTicketMinutes;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bh/bot/common/types/AttendablePlaces.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class Ids {
public static final int Pvp = 0b00100000;
public static final int WorldBoss = 0b01000000;
public static final int Raid = 0b10000000;
public static final int Quest = 0b11000000;
public static final int Quest = 0b00000011;
daredoes marked this conversation as resolved.
Show resolved Hide resolved
}

public static AttendablePlace invasion = null;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/bh/bot/common/types/ScreenResolutionProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public abstract class ScreenResolutionProfile {
// forward,
// max x

public abstract Tuple4<Integer, Integer, Integer, Integer> getBackwardScanQuests(); // min x, max
// y, step
// backward,
// max x

public abstract Offset getOffsetButtonSummonOnListingPartiesWorldBoss();

public abstract Offset getOffsetLabelWorldBossInSummonDialog();
Expand Down Expand Up @@ -339,11 +334,6 @@ public Tuple4<Integer, Integer, Integer, Integer> getBackwardScanLeftSideAttenda
return new Tuple4<>(14, 0, 96, 59);
}

@Override
public Tuple4<Integer, Integer, Integer, Integer> getBackwardScanQuests() {
return new Tuple4<>(63, 108, 96, 737);
}

@Override
public Offset getOffsetButtonSummonOnListingPartiesWorldBoss() {
return new Offset(452, 451);
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/bh/bot/common/utils/InteractionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,6 @@ public Point findAttendablePlace(AttendablePlace event) {
return null;
}

public Point findQuest(BwMatrixMeta levelIm) {
int minX, maxX, stepY, firstY;
Tuple4<Integer, Integer, Integer, Integer> backwardsScan = Configuration
.screenResolutionProfile
.getBackwardScanQuests();
minX = backwardsScan._1;
firstY = backwardsScan._2;
stepY = backwardsScan._3;
maxX = backwardsScan._4;

minX += Configuration.gameScreenOffset.X.get();
maxX += Configuration.gameScreenOffset.X.get();
firstY += Configuration.gameScreenOffset.Y.get();

return findByScanColumn(levelIm, minX, maxX, stepY, firstY, 5);
}

public Point findByScanScreen(BwMatrixMeta im, int minX, int maxX, int stepY, int firstY) {
int maxScreen = 800;
Point located = null;
Expand Down