Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 3d9581c

Browse files
committed
Fixed withdraw error
1 parent 68a7325 commit 3d9581c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/net/olympiccode/vhackos/bot/core/networking/NetworkingConfigValues.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ public class NetworkingConfigValues {
1515

1616
@ConfigOption(path = "networking.onFail", defaultValue = "retry", options = {"retry", "remove"})
1717
public static String onFail;
18+
19+
@ConfigOption(path = "networking.withdrawPorcentage", defaultValue = "100", options = {""})
20+
public static int withdrawPorcentage;
21+
1822
}

src/main/java/net/olympiccode/vhackos/bot/core/networking/NetworkingService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void runService() {
6666

6767
if (banking.isBruteForced()) {
6868
long av = banking.getAvaliableMoney();
69-
if (av > 0 && banking.withdraw()) {
69+
if (av > 0 && banking.withdraw(NetworkingConfigValues.withdrawPorcentage)) {
7070
LOG.info("Withdrawed " + av + " of " + banking.getTotal() + " from " + etarget.getIp() + ".");
7171
} else {
7272
LOG.error("Failed to withdraw from " + etarget.getIp() + ".");
@@ -88,7 +88,7 @@ public void runService() {
8888
switch (NetworkingConfigValues.onFail) {
8989
case "retry":
9090
LOG.info("Retrying bruteforce at " + bruteForce.getIp() + " has it failed.");
91-
((BruteForceImpl) bruteForce).retry();
91+
bruteForce.retry();
9292
case "remove":
9393
LOG.info("Removing bruteforce from " + bruteForce.getIp() + " has it failed.");
9494
bruteForce.remove();

0 commit comments

Comments
 (0)