Skip to content

Commit

Permalink
fix Fishing app does not stop after long time can not detect + Add so…
Browse files Browse the repository at this point in the history
…me sample scripts
  • Loading branch information
9-9-9-9 committed Feb 25, 2022
1 parent 70ac792 commit 9878d2b
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 10 deletions.
1 change: 1 addition & 0 deletions AFK.steam.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
:: Do chaining tasks PVP, WB, GVG/Invasion/Expedition, TG, Raid and then exit after completed them all
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22afk%22
:: 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 web version of BH (or mini-client), refer to AFK.web.bat file
Expand Down
1 change: 1 addition & 0 deletions AFK.web.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
:: Do chaining tasks PVP, WB, GVG/Invasion/Expedition, TG, Raid and then exit after completed them all
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22afk%22
:: 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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ _(Example for Windows only, you can save into a bat file to be able to click-to-
> call steam.bot.bat fishing
- ReRun
> call steam.bot.bat rerun
- Explore the `./sample-scripts/` folder

[Learn more about how to create script files here](https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Script-example)
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>2.8.5</version>
<version>2.8.6</version>

<dependencies>
<dependency>
Expand Down
6 changes: 5 additions & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ EOF
# Copy files for mini client
cp ./prepare-mini-chrome-client.txt ./release/

# Copy launch scripts for Linux/Mac
# Copy sample scripts
mkdir ./release/sample-scripts/
cp ./sample-scripts/*.bat ./release/sample-scripts/

# Copy launch scripts for Linux
cp ./bot.sh ./release/
cp ./client.sh ./release/
cp ./help.sh ./release/
Expand Down
7 changes: 7 additions & 0 deletions sample-scripts/AFK.steam.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Do chaining tasks PVP, WB, GVG/Invasion/Expedition, TG, Raid and then exit after completed them all
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22afk%22
:: 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 web version of BH (or mini-client), refer to AFK.web.bat file
call steam.bot.bat afk a --ear
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
7 changes: 7 additions & 0 deletions sample-scripts/AFK.web.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Do chaining tasks PVP, WB, GVG/Invasion/Expedition, TG, Raid and then exit after completed them all
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22afk%22
:: 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 afk a --ear
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
7 changes: 7 additions & 0 deletions sample-scripts/Fishing.steam.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Do fishing
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22fishing%22
:: With web version of BH (or mini-client), refer to Fishing.web.bat file
call steam.bot.bat fishing 500
:: ARGUMENTS: (you can adjust to fit your need)
:: First argument: 500: hook 500 times
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
7 changes: 7 additions & 0 deletions sample-scripts/Fishing.web.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Do fishing
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22fishing%22
:: With steam version of BH, refer to Fishing.steam.bat file
call web.bot.bat fishing 500
:: ARGUMENTS: (you can adjust to fit your need)
:: First argument: 500: hook 500 times
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
11 changes: 11 additions & 0 deletions sample-scripts/World-Boss-Team.steam.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:: Fight World Boss in Team
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22world-boss%22-(team)
:: With web version of BH (or mini-client), refer to World-Boss-Team.web.bat file
:: READ EVERYTHING CAREFULLY BEFORE USE IT
call steam.bot.bat world-boss-team 2500 2 3
:: ARGUMENTS: (you can adjust to fit your need)
:: First argument: 2500: is number of loop (do World Boss Team)
:: Second argument: 2: is number of minimum required to start world boss team
:: Third argument: 3: is number of maximum team member the world boss supported (for example Titan is 3)
:: For detailed information, visit this url: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22world-boss%22-(team)
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
11 changes: 11 additions & 0 deletions sample-scripts/World-Boss-Team.web.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:: Fight World Boss in Team
:: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22world-boss%22-(team)
:: With steam version of BH, refer to World-Boss-Team.steam.bat file
:: READ EVERYTHING CAREFULLY BEFORE USE IT
call web.bot.bat world-boss-team 2500 2 3
:: ARGUMENTS: (you can adjust to fit your need)
:: First argument: 2500: is number of loop (do World Boss Team)
:: Second argument: 2: is number of minimum required to start world boss team
:: Third argument: 3: is number of maximum team member the world boss supported (for example Titan is 3)
:: For detailed information, visit this url: https://github.com/9-9-9-9/Bit-Heroes-bot/wiki/Function-%22world-boss%22-(team)
:: Move this file to bot's folder in order to use (this file was distributed within `sample-script` folder so it unable to run)
12 changes: 4 additions & 8 deletions src/main/java/bh/bot/app/FishingApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,39 +273,35 @@ private void detectScreen(final AtomicBoolean masterSwitch, final Point anchorPo
while (!masterSwitch.get()) {
sleep(1000);

BufferedImage sc = captureScreen(anchorPoint.x, anchorPoint.y,
BufferedImage sc = captureScreen(
anchorPoint.x, anchorPoint.y,
Configuration.screenResolutionProfile.getSupportedGameResolutionWidth(),
Configuration.screenResolutionProfile.getSupportedGameResolutionHeight());
Configuration.screenResolutionProfile.getSupportedGameResolutionHeight()
);
try {
saveDebugImage(sc, "detectScreen_fishing");

if (isContains(sc, BwMatrixMeta.Metas.Fishing.Buttons.catch_)) {
screen.set(screenCatch);
unsure.set(false);
unsureFrom.set(Long.MAX_VALUE);
seeBtnStartFrom.set(Long.MAX_VALUE);
continue;
}

if (isContains(sc, BwMatrixMeta.Metas.Fishing.Buttons.cast)) {
screen.set(screenCast);
unsure.set(false);
unsureFrom.set(Long.MAX_VALUE);
seeBtnStartFrom.set(Long.MAX_VALUE);
continue;
}

if (isContains(sc, BwMatrixMeta.Metas.Fishing.Buttons.start)) {
screen.set(screenStart);
unsure.set(false);
unsureFrom.set(Long.MAX_VALUE);
seeBtnStartFrom.set(System.currentTimeMillis());
continue;
}

unsure.set(true);
unsureFrom.set(System.currentTimeMillis());
seeBtnStartFrom.set(Long.MAX_VALUE);
} catch (Exception ex) {
ex.printStackTrace();
sleep(2000);
Expand Down

0 comments on commit 9878d2b

Please sign in to comment.