Question InterfaceWindows.getCombatOptions

Discussion in 'Developer Support' started by Party, May 17, 2016.

  1. Current available methods are:
    InterfaceWindows.getInventory()
    ..getEquipment()
    ..getMagic()
    ..getPrayer()

    Should really be a getCombatOptions()/getCombat() to open the following menu:

    [​IMG]
    --- Double Post Merged, May 17, 2016, Original Post Date: May 17, 2016 ---
    @Vaped
    --- Double Post Merged, May 17, 2016 ---
    Further to that, there should also be an option to perform a special attack.

    Special attack button: Interfaces.getAt(593, 30)
    Special attack % text: Interfaces.getAt(593, 34)

    My method to parse spec percentage:
    Code (Text):
    1.     public void parseSpecPercentage() {
    2.         String full;
    3.         if (specValue != null) {
    4.             full = Interfaces.getAt(593, 34).getText().replace("Special Attack: ", ""); //Label "Special Attack: x%"
    5.             specPercentage = Integer.valueOf(full.replace("%", ""));
    6.         }
    7.     }
    Method to determine if spec is selected:

    Code (Text):
    1.             if (!Equipment.containsAnyOf(specWeapon.getItemNames())) {
    2.                 if (Inventory.containsAnyOf(specWeapon.getItemNames())) {
    3.                     SpriteItem weapon = Inventory.newQuery().names(specWeapon.getItemNames()).results().first();
    4.                     if (weapon != null) weapon.interact("Wield");
    5.                     Log.info("Equipping spec weapon");
    6.                 }
    7.             } else if (specButton != null) {
    8.                 if (specButton.isVisible() && specButton.getTextColor().equals(new Color(0, 0, 16))) {
    9.                     specButton.interact("Use Special Attack");
    10.                 } else if(!specButton.isVisible()){
    11.                     InterfaceComponent component = Interfaces.getAt(161,44);
    12.                     if(component != null) component.interact("Combat Options");
    13.                 }
    14.             }
     
  2. OSRSTab.COMBAT_OPTIONS
     
  3. Ah nice! Would still be good to get the "Use Special Attack" implemented. I'm sure there's a varp somewhere to get the spec percent a bit better.
     
  4. @Vaped I have some of this stuff in my API, could probably polish it up and implement it if you wanted.
     
  5. Sure
    --- Double Post Merged, May 30, 2016, Original Post Date: May 18, 2016 ---
    @SlashnHax
     

Share This Page

Loading...