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

Request Force *no* menu interaction

Discussion in 'Client & Site Suggestions' started by Jux7apose, Feb 6, 2018.

  1. Snufalufugus

    Joined:
    Aug 23, 2015
    Messages:
    1,961
    Likes Received:
    757
    Ty, Menu.getItemAt(0) gets the hover text, I will make something with that.
     
  2. Overflow

    Joined:
    Mar 26, 2014
    Messages:
    33
    Likes Received:
    4
    Id be interested to see what you came up with, my interpretation for this from a while ago is below. You can ignore most of the various InteractVar's there based on player profiling.
    Code (Text):
    1.     protected boolean interact(Interactable target) {
    2.         Pattern action = this.getVar(InteractVar.ACTION);
    3.         Pattern name = this.getVar(InteractVar.NAME);
    4.         this.ctx.logger.fine(this.status("Action: " + action + " -> Target: " + target));
    5.         MenuItem item = null;
    6.         if (!Menu.isOpen() || ((item = Menu.getItem(target, action, name)) == null && Menu.close())) {
    7.             if (this.<Boolean>getVar(InteractVar.CLICK_ENABLED) && this.<Boolean>getVar(InteractVar.CLICK_ATTEMPT) && (target.contains(Mouse.getPosition()) || target.hover())) {
    8.                 if (Menu.indexOf(action, name) == 0) {
    9.                     if (target.click() && this.ctx.profile.reacting()) {
    10.                         this.ctx.logger.fine(this.status("Left Click: " + target));
    11.                         return true;
    12.                     }
    13.                     this.setVar(InteractVar.CLICK_ATTEMPT, false, Lifespan.TRANSIENT);
    14.                     return false;
    15.                 }
    16.                 this.setVar(InteractVar.CLICK_ATTEMPT, false, Lifespan.TRANSIENT);
    17.             }
    18.             if ((target.contains(Mouse.getPosition()) || target.hover())) {
    19.                 if (Mouse.click(Mouse.Button.RIGHT) && (Menu.isOpen() || Execution.delayUntil(Menu::isOpen, this.ctx.profile.rest(50, 100, 200)))) {
    20.                     item = Menu.getItem(target instanceof ActionBar.Slot ? null : target, action, name);
    21.                 }
    22.             }
    23.         }
    24.         if (item != null && (item.isVisible() || Execution.delayUntil(item::isVisible, this.ctx.profile.rest(300, 600, 900)))) {
    25.             Execution.delay(this.ctx.profile.decision(Menu.getItemCount()));
    26.             if ((item.contains(Mouse.getPosition()) || item.hover()) && item.isVisible()) {
    27.                 if (Mouse.click(Mouse.Button.LEFT) && Mouse.wasClickSuccessful(target) && this.ctx.profile.reacting()) {
    28.                     this.ctx.logger.fine(this.status("Right Click: " + action + " -> " + target));
    29.                     return true;
    30.                 }
    31.             }
    32.         }
    33.         return false;
    34.     }
    35.  
     

Share This Page

Loading...