Ejemplo n.º 1
0
 /**
  * Attempts to withdraw an item from the bank
  *
  * @param id
  * @param amnt
  * @return true if ending count > start count
  */
 public static boolean withdraw(final int id, final int amnt) {
   final Item item = Bank.getItem(id);
   if (item != null) {
     switch (amnt) {
       case 1:
         item.interact("Withdraw 1");
         break;
       case 5:
         item.interact("Withdraw 5");
       default:
         if (amnt > 9 && amnt < 28) {
           item.interact("Withdraw X");
           for (int i = 0;
               i < 21
                   && Interfaces.getChatboxInterface() != null
                   && Interfaces.getChatboxInterfaceId() != 1;
               i++) {
             Time.sleep(250);
           }
           Time.sleep(1350, 1500);
           Keyboard.getInstance().sendKeys("" + amnt);
         } else {
           item.interact("Withdraw All");
         }
     }
     return true;
   }
   return false;
 }
Ejemplo n.º 2
0
 @Override
 public void execute() {
   if (!Bank.isOpen()) {
     if (booth != null) {
       if (booth.distanceTo() > 5) {
         booth.getLocation().walkTo();
         while (Players.getMyPlayer().getAnimation() != -1) {
           Time.sleep(150);
         }
       }
       booth.interact(0);
       Time.sleep(2500);
     }
   }
 }
Ejemplo n.º 3
0
    public void execute() {
        iTMahoganyBenches.status = "Antirandom";
        // Makes the noise
        if (runnable != null)
            runnable.run();

        Time.sleep(750);

        System.out.println("There is a random nearby!");

        Time.sleep(750);

        if (antiRandom.getDef().getId() == 1091) {
            SceneObject[] portal = SceneObjects.getNearest(8987);

            for (SceneObject aPortal : portal) {
                if (bobsIsland.contains(Players.getMyPlayer().getLocation())) {
                    final SceneObject portal2 = aPortal;

                    aPortal.interact(0);

                    Time.sleep(new SleepCondition() {
                        @Override
                        public boolean isValid() {
                            return portal2.getLocation().distanceTo() < 2;
                        }

                    }, 7500);

                    Time.sleep(1000);
                }
            }

            System.out.println("Bob's Island has been completed");
        } else if (antiRandom.getDef().getId() == 3022 || antiRandom.getDef().getId() == 3351 || antiRandom.getDef().getId() == 409) {
            System.exit(0);

            System.out.println("A mod called a Genie random onto you.\n" +
                    "The client was closed to protect your account.");
        } else {
            antiRandom.interact(0);
            Time.sleep(1500);

            System.out.println("Sandwich lady/Old man random has been completed");
        }

        rCount++;
    }
Ejemplo n.º 4
0
  public void execute() { //

    SceneObject[] Altar = SceneObjects.getNearest(26847);
    System.out.println("executing crafting");
    Altar[0].interact(0);
    //  Menu.sendAction(502, 1513609531, 59, 50, 26847, 3);//Interact with banker
    Time.sleep(2000);
  } // end
Ejemplo n.º 5
0
 /**
  * Sleeps until the SleepCondition is valid.
  *
  * @param conn the condition.
  * @param timeout the time in miliseconds before it stops sleeping.
  * @return whether it ran successfully without timing out.
  */
 public static boolean sleep(SleepCondition conn, int timeout) {
   long start = System.currentTimeMillis();
   while (!conn.isValid()) {
     if (start + timeout < System.currentTimeMillis()) {
       return false;
     }
     Time.sleep(50);
   }
   return true;
 }