Resolved Magic.isSelected() broken on OSRS.

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

  1. Defeat3d

    Defeat3d Prime Celestial

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

    Joined:
    Jul 28, 2013
    Messages:
    2,585
    Likes Received:
    931
    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 Prime Celestial

    Joined:
    Oct 30, 2014
    Messages:
    1,409
    Likes Received:
    612
    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

    Joined:
    Jul 28, 2013
    Messages:
    2,585
    Likes Received:
    931
    Fixed for the next release.
     

Share This Page

Loading...