1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question InterfaceWindows.getCombatOptions

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

  1. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    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. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,212
    Likes Received:
    1,042
    OSRSTab.COMBAT_OPTIONS
     
  3. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    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. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,212
    Likes Received:
    1,042
    @Vaped I have some of this stuff in my API, could probably polish it up and implement it if you wanted.
     
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Sure
    --- Double Post Merged, May 30, 2016, Original Post Date: May 18, 2016 ---
    @SlashnHax
     
  6. BruteForce

    Joined:
    Feb 12, 2018
    Messages:
    48
    Likes Received:
    10
    Sorry for bumping an old thread, but has there been any progress on this functionality?

    CombatOptions could be added as separate interface similar to Inventory / Equipment / Magic / Prayer interfaces.
    Would allow easy access to changing combat styles / using special attacks / changing auto-retaliate.

    Currently those options are not available, and everyone has to manually track interfaceComponents with corresponding text / id.
     
  7. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,212
    Likes Received:
    1,042
    Back in the day I did it based on the wielded weapon, not sure if it was dynamic using itemdefinitions or I possibly had it predefined based on matching the weapon name to the combat options.

    Edit: I believe there's a gitlab or similar issue tracker you can make these suggestions on now?
     
    #7 SlashnHax, Aug 20, 2019
    Last edited: Aug 20, 2019
  8. Makutu

    Makutu The Omen

    Joined:
    Dec 27, 2018
    Messages:
    159
    Likes Received:
    132
    Issues · RuneMate · GitLab

    To answer the question there's nothing in the API which can help you yet. However you may be aware Runelite offers an Attack Styles alerter if you switch to an undesired style (if a pure switches to defence mode, for example). I'd recommend looking at what they do to see if you can make this yourself and contribute it to the API :) runelite/runelite
     
    BruteForce likes this.

Share This Page

Loading...