Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Magic.isSelected() broken on OSRS.

Engineer
Joined
Jul 28, 2013
Messages
2,776
It relies on border thickness changing. Do getComponent() and then check it's border thickness when it is and isn't selected.
 
Primate
Joined
Oct 30, 2014
Messages
3,469
It relies on border thickness changing. Do getComponent() and then check it's border thickness when it is and isn't selected.
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:
(05:02:35) Selected: false
(05:02:35) Border thickness: 2
(05:02:35) Selected: true
(05:02:35) Border thickness: 0
Code:
        add(new CTask() {

            private InterfaceComponent alch;

            @Override
            public void execute() {
                System.out.println("Selected: " + Magic.HIGH_LEVEL_ALCHEMY.isSelected());
                System.out.println("Border thickness: " + alch.getBorderThickness());
            }

            @Override
            public boolean validate() {
                return (alch = Magic.HIGH_LEVEL_ALCHEMY.getComponent()) != null;
            }

        });
 
Top