Resolved RS3 Visibility

Discussion in 'Developer Support' started by countvidal, Apr 17, 2016.

  1. So when I do in rs3 spectre:

    Code (Javascript):
    2. final static public int INTERFACE_FIRST_TRADE = 335;
    3. final static public int INTERFACE_SECOND_TRADE = 334;
    4. InterfaceComponentQueryResults trade1 = Interfaces.newQuery().containers(INTERFACE_FIRST_TRADE).actions("Accept").visible().results();
    5. InterfaceComponentQueryResults trade2 = Interfaces.newQuery().containers(INTERFACE_SECOND_TRADE).actions("Accept").visible().results();
    6. System.out.println("IS TRADING: first screen length: "+trade1.size()+" second screen length: "+trade2.size());
    Its prints out 0 for both when no screen is up and as soon as the first screen goes up it prints 1. However, when you exit out of any trade screen it it keeps printing 1 even though none of them are visible.

  2. Best Answer:
    Post #18 by Cloud, Apr 26, 2016
  3. Okay so do me a favor and take that component that's returning after it shouldn't be visible and call getLayer() on it until it returns null. Print out the toString method of the last non-null value.
  4. This also happened to me, the bot is detecting that the Divination conversion UI is visible. It happened about a hour into botting. I already closed RS, so I can't recreate it at the moment.

  5. @Cloud

    Code (Text):
    1.  InterfaceComponentQueryResults trade1 = Interfaces.newQuery().containers(INTERFACE_FIRST_TRADE).actions("Accept").visible().results();
    2.         InterfaceComponentQueryResults trade2 = Interfaces.newQuery().containers(INTERFACE_SECOND_TRADE).actions("Accept").visible().results();
    3.         System.out.println("IS TRADING: first trade screen: "+(trade1.first() == null ? "null" : trade1.first().getLayer().toString())+" second trade screen: "+(trade2.first() == null ? "null" : trade2.first().getLayer().toString()));
    print out when they have never been up: [​IMG]
    print out when they are up: [​IMG]

    print out when none of them are up: [​IMG]
  6. hmm some speculation and facts. There are 100 possible root slots that can be used to build off of to calculate an interfaces position. When getLayer() returns null, that's when we know it's time to check the root slot. We determine which one to use based on an index that the component will have. If this is -1, then we know that it's simply not visible. But if the index is resolves to is within the valid range, but the root slot contains either a null value or an invalid rectangle, it could result in getBounds() returning null while isVisible() would return true since isVisible() only checked the index's value.
  7. So are you saying I should use getBounds null checked instead of isVisible?
  8. Nah, it was more of an info dump for myself. I'm making some changes that you may see released tomorrow.
    countvidal likes this.
  9. Ok awesome, would appreciate if you reply to this thread when you release the fix.
  10. I'll try to remember but I have a bad memory lol
    --- Double Post Merged, Apr 20, 2016, Original Post Date: Apr 19, 2016 ---
    Can you please check now
  11. Same problem still happening, isVisible still returning true even when they are not visible.
  12. is get bounds still returning a non-null value?
  13. No, getBounds() is null correctly when itsnt visible
  14. Alright I just did a "behind the scenes" update to V2.0.4.1, can you give that a try?
  15. Cant get past v2.0.4 for some reason. Wont download the new one, even tried doing it off site.

  16. The last number typically isn't displayed, if you're running runemate through our exe file then it'll ensure you're on the latest. The last number is used for "silent" updates.
  17. Nope, looks like isVisible still returns true even if its not visible.
  18. Alright so I'm investigating a few theories at the moment. I'd like you to find a situation where isVisible is returning true when getBounds() is returning null. Then, starting with that component, print the component.toString(), component.getWidth(), component.getHeight(), component.getBounds(), and component.getLayer(). Then, if getLayer() != null, repeat the process of printing those values out.
    --- Double Post Merged, Apr 26, 2016, Original Post Date: Apr 26, 2016 ---
    @countvidal Fixed it ;)

Share This Page