Skip to content

Commit

Permalink
fix setting app (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: 9-9-9-9 <9-9-9-9>
  • Loading branch information
9-9-9-9 authored Sep 5, 2021
1 parent d4efc68 commit 5a47073
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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>BitHeroes</artifactId>
<version>1.5.2</version>
<version>1.5.3</version>

<dependencies>
<dependency>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/bh/bot/app/AbstractApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,11 @@ protected void autoReactiveAuto(AtomicBoolean masterSwitch) {
}
if (ImageUtil.isRedLikeColor(color)) {
continousRed++;
if (continousRed >= 2)
info("Detected Auto is not turned on, gonna reactive it soon");
if (continousRed >= 2 && continousRed < maxContinousRed) {
info("Detected Auto is not turned on, gonna reactive it after %d seconds", (maxContinousRed - continousRed) * sleepMs / 1_000);
}
if (continousRed >= maxContinousRed) {
info("Detected Auto is not turned on, gonna reactive it soon");
moveCursor(point);
sleep(100);
mouseClick();
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/bh/bot/app/SettingApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ protected void internalRun(String[] args) {
tmp = readIntInput(sb.toString(), woldBossLevelRange._1, woldBossLevelRange._2);
worldBossLevel = tmp == null ? worldBossLevel : tmp;
//

sb = new StringBuilder();
sb.append(String.format("%s=%d\n", UserConfig.raidLevelKey, raidLevel));
sb.append(String.format("%s=%d\n", UserConfig.raidModeKey, raidMode));
sb.append(String.format("%s=%d\n", UserConfig.worldBossLevelKey, worldBossLevel));

UserConfig newCfg = new UserConfig(profileNumber, (byte) raidLevel, (byte) raidMode, (byte) worldBossLevel);

sb = new StringBuilder("Your setting:\n");
Expand All @@ -115,6 +109,10 @@ protected void internalRun(String[] args) {
});

if (save) {
sb = new StringBuilder();
sb.append(String.format("%s=%d\n", UserConfig.raidLevelKey, raidLevel));
sb.append(String.format("%s=%d\n", UserConfig.raidModeKey, raidMode));
sb.append(String.format("%s=%d\n", UserConfig.worldBossLevelKey, worldBossLevel));
Files.write(Paths.get(fileName), sb.toString().getBytes());
info("Saved successfully");
} else {
Expand Down

0 comments on commit 5a47073

Please sign in to comment.