mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
move to nearest banker/booth/chest if one not within interaction range
This commit is contained in:
@@ -4,6 +4,7 @@ import ParaScript.data.Variables;
|
|||||||
import org.parabot.environment.api.utils.Time;
|
import org.parabot.environment.api.utils.Time;
|
||||||
import org.parabot.environment.scripts.framework.Strategy;
|
import org.parabot.environment.scripts.framework.Strategy;
|
||||||
import org.rev317.min.api.wrappers.Npc;
|
import org.rev317.min.api.wrappers.Npc;
|
||||||
|
import org.rev317.min.api.wrappers.SceneObject;
|
||||||
import org.rev317.min.api.methods.*;
|
import org.rev317.min.api.methods.*;
|
||||||
import org.rev317.min.api.wrappers.Item;
|
import org.rev317.min.api.wrappers.Item;
|
||||||
|
|
||||||
@@ -32,15 +33,31 @@ public class Bank implements Strategy {
|
|||||||
if (isBankOpen()) {
|
if (isBankOpen()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Npc banker = Npcs.getClosest(494);
|
|
||||||
|
// Try find a nearby bank booth/chest
|
||||||
|
SceneObject bank_booth = SceneObjects.getClosest(11338, 2214, 3045, 5276, 6084, 11758, 14367, 4483, 3194, 10517, 2213);
|
||||||
|
if (bank_booth != null) {
|
||||||
|
bank_booth.interact(SceneObjects.Option.USE_QUICKLY);
|
||||||
|
Time.sleep(() -> isBankOpen(), 10000);
|
||||||
|
if (isBankOpen()) {
|
||||||
|
UpdateBank.saveBankFile();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try find a nearby banker
|
||||||
|
Npc banker = Npcs.getClosest(953, 166, 1702, 495, 496, 497, 498, 499, 567, 1036, 1360, 2163, 2164, 2354, 2355, 2568, 2569, 2570, 2271, 494, 2619);
|
||||||
if (banker != null) {
|
if (banker != null) {
|
||||||
banker.interact(Npcs.Option.BANK);
|
banker.interact(Npcs.Option.BANK);
|
||||||
Time.sleep(() -> isBankOpen(), 10000);
|
Time.sleep(() -> isBankOpen(), 10000);
|
||||||
return true;
|
if (isBankOpen()) {
|
||||||
} else {
|
UpdateBank.saveBankFile();
|
||||||
System.out.println("Unable to find a banker");
|
return true;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("Unable to find a nearby bank booth or banker");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getInventorySlot(int item_id){
|
public static int getInventorySlot(int item_id){
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ public class UpdateBank implements Strategy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Variables.bank_items = Bank.getBankItemIDs();
|
|
||||||
Time.sleep(500);
|
|
||||||
saveBankFile();
|
saveBankFile();
|
||||||
// Variables.setStatus("none");
|
// Variables.setStatus("none");
|
||||||
}
|
}
|
||||||
@@ -31,7 +29,9 @@ public class UpdateBank implements Strategy {
|
|||||||
return "." + seperator + "bank" + seperator + Variables.getAccountUsername() + ".bank";
|
return "." + seperator + "bank" + seperator + Variables.getAccountUsername() + ".bank";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveBankFile(){
|
public static void saveBankFile(){
|
||||||
|
Variables.bank_items = Bank.getBankItemIDs();
|
||||||
|
Time.sleep(500);
|
||||||
String filePath = getfileName();
|
String filePath = getfileName();
|
||||||
checkOrCreateFile(filePath);
|
checkOrCreateFile(filePath);
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user