コード例 #1
0
ファイル: MWalking.java プロジェクト: DropV/TRiBot
  public static boolean toggleRun(boolean enable, Timer timer) {

    if (!timer.isRunning()) {
      final int settings[] = Game.getSettingsArray();

      if (settings != null) {
        if (settings[173] == 0) {
          if (enable) {
            if (GameTab.open(GameTab.TABS.OPTIONS)) {
              if (Interfaces.get(261, 0) != null) {

                Interfaces.get(261, 0).click("Toggle Run");

                if (settings[173] == 1) {
                  GameTab.open(GameTab.TABS.OPTIONS);

                  CSleep(
                      new Timing.Condition() {
                        @Override
                        public boolean validate() {
                          return settings[173] == 1;
                        }
                      },
                      random(2000, 3000));
                }

                GameTab.open(GameTab.TABS.INVENTORY);
                CSleep(
                    new Timing.Condition() {
                      @Override
                      public boolean validate() {
                        return GameTab.open(GameTab.TABS.INVENTORY);
                      }
                    },
                    random(2000, 3000));
                timer.reset();
                return true;
              }
            } else {

              return true;
            }
          }
        } else {
          if (!enable) {
            if (GameTab.open(GameTab.TABS.OPTIONS)) {
              if (Interfaces.get(261, 0) != null) {

                Interfaces.get(261, 0).click("Toggle Run");
              }
            } else {
              GameTab.open(GameTab.TABS.OPTIONS);
              sleep(1000, 2000);
              return true;
            }
          }
        }
      }
    }

    return false;
  }