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

Resolved Magic.isSelected() broken on OSRS.

Discussion in 'Client & Site Support' started by Defeat3d, Sep 18, 2015.

  1. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,072
    Likes Received:
    1,894
  2. Best Answer:
    Post #4 by Cloud, Sep 18, 2015
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    It relies on border thickness changing. Do getComponent() and then check it's border thickness when it is and isn't selected.
     
  4. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,072
    Likes Received:
    1,894
    Looks like it's reversed for some reason, isSelected() returns false when I select the spell (border thickness 2) and returns true when it's not selected (border thickness 0).

    Code (Text):
    1. (05:02:35) Selected: false
    2. (05:02:35) Border thickness: 2
    3. (05:02:35) Selected: true
    4. (05:02:35) Border thickness: 0
    Code (Text):
    1.         add(new CTask() {
    2.  
    3.             private InterfaceComponent alch;
    4.  
    5.             @Override
    6.             public void execute() {
    7.                 System.out.println("Selected: " + Magic.HIGH_LEVEL_ALCHEMY.isSelected());
    8.                 System.out.println("Border thickness: " + alch.getBorderThickness());
    9.             }
    10.  
    11.             @Override
    12.             public boolean validate() {
    13.                 return (alch = Magic.HIGH_LEVEL_ALCHEMY.getComponent()) != null;
    14.             }
    15.  
    16.         });
     
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Fixed for the next release.
     

Share This Page

Loading...