forked from OlympicCode/vHackAPI-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsoleExample.java
More file actions
27 lines (24 loc) · 955 Bytes
/
ConsoleExample.java
File metadata and controls
27 lines (24 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package examples;
import me.checkium.vhackapi.vHackAPI;
import me.checkium.vhackapi.vHackAPIBuilder;
import me.checkium.vhackapi.console.ScannedNode;
import me.checkium.vhackapi.console.TransferResult;
public class ConsoleExample {
public static void main(String[] args) {
//Create your API instance
vHackAPI api = new vHackAPIBuilder().password("pass").username("user").getAPI();
//Get an IP trougth console
String ip = api.getConsole().getIP(false, false);
//Scan the IP
ScannedNode scanned = api.getConsole().scanIP(ip);
if(scanned.getSuccessRate() >= 70) {
//if the success rate is bigger or equals 70 then transfer trojan
TransferResult transfer = api.getConsole().transferTrojanTo(scanned);
if(transfer.getSuccess()){
// if transfer is successfull
System.out.println("Got $" + transfer.getMoneyAmount());
System.out.println("Gained " + transfer.getRepGained() + " rep.");
}
}
}
}