Since the new API was released I tried to recreate and adapt my code from the past to the current one.
When I change everything from a single IP to multiple IPs I still get the FileNotFoundException, followed by the NullPointerException.
I changed the sleep times but still the same issue remains. Already tried 2 seconds sleep between every scan, because the last bot worked just fine with that configuration and still after an amount of scans I get the Exception.
java.io.FileNotFoundException: https://api.vhack.cc/v/2/vh_scan.php?user=YOURUSERHASH&pass=YOURPASSHASH
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at me.checkium.vhackapi.Utils.StringRequest(Utils.java:115)
at me.checkium.vhackapi.console.Console.scanIP(Console.java:91)
at me.checkium.vhackapi.console.Console.lambda$0(Console.java:100)
at java.util.ArrayList.forEach(Unknown Source)
at me.checkium.vhackapi.console.Console.scanIPs(Console.java:100)
at examples.ConsoleExample.newCode(ConsoleExample.java:34)
at examples.ConsoleExample.main(ConsoleExample.java:20)
Exception in thread "main" java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at me.checkium.vhackapi.console.Console.parseScanResult(Console.java:127)
at me.checkium.vhackapi.console.Console.scanIP(Console.java:91)
at me.checkium.vhackapi.console.Console.lambda$0(Console.java:100)
at java.util.ArrayList.forEach(Unknown Source)
at me.checkium.vhackapi.console.Console.scanIPs(Console.java:100)
at examples.ConsoleExample.newCode(ConsoleExample.java:34)
at examples.ConsoleExample.main(ConsoleExample.java:20)
ArrayList<String> ip = api.getConsole().getIPs(12, false, false);
//Scan the IP
ArrayList<ScannedNode> scanned = api.getConsole().scanIPs(ip);
for(ScannedNode scan:scanned)
if(scan.getSuccessRate() >= 70) {
//if the success rate is bigger or equals 70 then transfer trojan
TransferResult transfer = api.getConsole().transferTrojanTo(scan);
if(transfer.getSuccess()){
// if transfer is successfull
System.out.println("Got $" + transfer.getMoneyAmount());
System.out.println("Gained " + transfer.getRepGained() + " rep.");
}
}