Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.abyssCrafter;
- import org.tribot.api.Clicking;
- import org.tribot.api.General;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Equipment;
- import org.tribot.api2007.Game;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Skills;
- import org.tribot.api2007.Skills.SKILLS;
- import org.tribot.api2007.types.RSItem;
- public class Banker extends Crafter{
- public static void gearUp() {
- if (Inventory.find(Crafter.RUNE_TYPE).length > 0
- || Inventory.find("Amulet of glory").length > 0 ) {
- depositInventory();
- }
- else if (Skills.getCurrentLevel(SKILLS.HITPOINTS) <= Crafter.SAFE_HEALTH) {
- healUp();
- }
- else if (Crafter.usingEnergyPotion
- ? needEnergyPotion() : false) {
- // **gets and drinks energy potion if player wants to use them**\\
- if(!ENERGY_ITEM.equals("Resting"))
- getEnergy();
- else
- General.sleep(100);
- }
- else if (!Equipment.isEquipped(GLORY)) {
- // **Gets & Equipts glory**\\
- getGlory();
- } else if (usingEmergencyTeleport
- ? Inventory.find(TELE_TABS).length < 1 : false) {
- getEmergenyTeleport();
- }
- else if (Inventory.find(POUCHES).length > 0 &&!pouchesFilled()) {
- // **fills pouches if needs to be filled**\\
- fillPouches();
- }
- else if (Inventory.find(ESSENCE_TYPE).length < Inventory.find(ESSENCE_TYPE).length + (28 - Inventory.getAll().length)) {
- // **Gets essence if player is ready**\\
- getEssence();
- }
- }
- private static void getEssence() {
- if(openBank()){
- if(Banking.withdraw(inventorySpace(), ESSENCE_TYPE)){
- General.sleep(1200, 2100);
- }
- }
- }
- private static void getEmergenyTeleport() {
- if(openBank()){
- if(Banking.withdraw(1, TELE_TABS)){
- General.sleep(1200, 2100);
- }
- }
- }
- private static void fillPouches() {
- if(Inventory.find(ESSENCE_TYPE).length < 4){
- if(openBank()){
- if(Banking.withdraw(inventorySpace(), ESSENCE_TYPE)){
- General.sleep(1200, 2100);
- }
- }
- }
- else if(Banking.close()){
- storeEssence();
- }
- }
- private static void getGlory() {
- if(Inventory.find(GLORY).length > 0){
- if(Banking.close()){
- if(Clicking.click(Inventory.find(GLORY))){
- General.sleep(2200, 4200);
- }
- }
- }
- else if(openBank()){
- if(Banking.find(GLORY).length > 0){
- if(Banking.withdraw(1, GLORY)){
- General.sleep(1300, 2330);
- }
- }
- else {
- General.println("Out of glories!, will add support for recharge, thanks for using");
- GloryRechargeNavigator.start();
- }
- }
- }
- private static void getEnergy() {
- RSItem[] energy = Inventory.find(ENERGY_ITEMS);
- if(energy.length > 0){
- if(Banking.close()){
- if(Clicking.click(energy[0])){
- General.sleep(2200, 4200);
- }
- }
- }
- else if(openBank()){
- if(Banking.withdraw(1, ENERGY_ITEMS)){
- General.sleep(1300, 2330);
- }
- }
- }
- private static void healUp() {
- if(Inventory.find(FOOD_NAME).length > 0){
- eatFood();
- }
- else if(openBank()){
- if(Inventory.isFull()){
- if(Banking.deposit(getFoodCount(), ESSENCE_TYPE)){
- General.sleep(800, 1300);
- }
- }
- else {
- getFood();
- }
- }
- }
- private static void getFood() {
- if(Banking.find(FOOD_NAME).length > 0){
- if(Banking.withdraw(getFoodCount(), FOOD_NAME)){
- General.sleep(1300, 2330);
- }
- }
- else {
- General.println("Out of food thanks for using!");
- running = false;
- }
- }
- private static void eatFood() {
- if(Banking.close()){
- if(Clicking.click(Inventory.find(FOOD_NAME))){
- General.sleep(900, 2900);
- }
- }
- }
- private static void depositInventory() {
- if(openBank()){
- Banking.depositAllExcept(POUCHES);
- }
- }
- public static boolean openBank() {
- return Banking.isBankScreenOpen() || Banking.openBank();
- }
- public static boolean pouchesFilled() {
- return ((Inventory.find(POUCHES[3]).length > 0)
- ? Game.getSetting(SMALL_POUCH_SETTING) >= SMALL_FILLED_ID : true)
- &&
- ((Inventory.find(POUCHES[2]).length > 0)
- ? Game.getSetting(MED_POUCH_SETTING) >= MED_FILLED_ID : true)
- &&
- ((Inventory.find(POUCHES[1]).length > 0)
- ? Game.getSetting(LRG_POUCH_SETTING) >= LRG_FILLED_ID : true)
- &&
- ((Inventory.find(POUCHES[0]).length > 0)
- ? Game.getSetting(GIANT_POUCH_SETTING) >= GIANT_FILLED_ID : true);
- }
- private static void storeEssence() {
- for (RSItem e : Inventory.find(POUCHES)) {
- if (e != null) {
- if (e.getDefinition().getName().contains("Small")) {
- if (Game.getSetting(SMALL_POUCH_SETTING) < SMALL_FILLED_ID) {
- if (Clicking.click(FILL_POUCH, e)) {
- General.sleep(400, 1700);
- }
- }
- }
- else if (e.getDefinition().getName().contains("Medium")) {
- if (Game.getSetting(MED_POUCH_SETTING) < MED_FILLED_ID) {
- if (Clicking.click(FILL_POUCH, e)) {
- General.sleep(400, 1700);
- }
- }
- }
- else if (e.getDefinition().getName().contains("Large")) {
- if (Game.getSetting(LRG_POUCH_SETTING) < LRG_FILLED_ID) {
- if (Clicking.click(FILL_POUCH, e)) {
- General.sleep(400, 1700);
- }
- }
- }
- else if (e.getDefinition().getName().contains("Giant")) {
- if (Game.getSetting(GIANT_POUCH_SETTING) < GIANT_FILLED_ID) {
- if (Clicking.click(FILL_POUCH, e)) {
- General.sleep(400, 1700);
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment