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

Bug Right click menus

Discussion in 'Developer Support' started by hotyute, Nov 12, 2017.

  1. hotyute

    Joined:
    Dec 30, 2014
    Messages:
    13
    Likes Received:
    1
    I said that I would post this but almost forgot. Sometime ago while running my bot I came back to find that a right click menu had been opened on the viewport of the game (it appeared that Clouse performed this action). The menu appeared to overlap one of the game objects and RM had issues discovering that the menu overlapped the object (I think.. cant remember). Anyway the mouse appeared to just move up and down the menu in a looping fashion. Luckily I stopped it in time but I think it should be looked at. Thanks.
     
  2. CodeNinja

    Joined:
    Dec 20, 2016
    Messages:
    37
    Likes Received:
    3
    This has happened to me. I'm not sure if runemate supports this. But I would implement a failsafe.

    Ex: if you failed to click that object 10 times in a row, try clicking your inventory, or move your mouse around the screen.
     
  3. hotyute

    Joined:
    Dec 30, 2014
    Messages:
    13
    Likes Received:
    1
    Okay, I think "click()" returns false each time? I guess you could just add a counter for up to 5 - 10 then instruct RM to do something else.
     
  4. CodeNinja

    Joined:
    Dec 20, 2016
    Messages:
    37
    Likes Received:
    3
    yup, if (click()) {
    //works
    } else {
    // didnt work
    failcount++;
    }
     
  5. Digits

    Joined:
    Oct 3, 2015
    Messages:
    10
    Likes Received:
    1
    Also have encountered this. If you're not enforcing left clicks, here's another workaround:
    Code (Text):
    1. //GameObject obj
    2. boolean menuOpen = Menu.isOpen();
    3. boolean menuContains = menuOpen && Menu.contains("Interact", "Object");
    4. if(menuContains || (obj.isVisible() && !menuOpen)) {
    5.     //obj.interact("Interact", "Object");
    6. } else if(menuOpen) {
    7.     Menu.close();
    8. }
    If you do need to left-click or want something more robust, you could probably grab Menu.getBounds() if it's open and see if it intersects the game object's bounds, haven't tried this myself though.
     

Share This Page

Loading...