Welcome!

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

Sign up now!

Request Force *no* menu interaction

Joined
Mar 26, 2014
Messages
33
Ty, Menu.getItemAt(0) gets the hover text, I will make something with that.
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:
    protected boolean interact(Interactable target) {
        Pattern action = this.getVar(InteractVar.ACTION);
        Pattern name = this.getVar(InteractVar.NAME);
        this.ctx.logger.fine(this.status("Action: " + action + " -> Target: " + target));
        MenuItem item = null;
        if (!Menu.isOpen() || ((item = Menu.getItem(target, action, name)) == null && Menu.close())) {
            if (this.<Boolean>getVar(InteractVar.CLICK_ENABLED) && this.<Boolean>getVar(InteractVar.CLICK_ATTEMPT) && (target.contains(Mouse.getPosition()) || target.hover())) {
                if (Menu.indexOf(action, name) == 0) {
                    if (target.click() && this.ctx.profile.reacting()) {
                        this.ctx.logger.fine(this.status("Left Click: " + target));
                        return true;
                    }
                    this.setVar(InteractVar.CLICK_ATTEMPT, false, Lifespan.TRANSIENT);
                    return false;
                }
                this.setVar(InteractVar.CLICK_ATTEMPT, false, Lifespan.TRANSIENT);
            }
            if ((target.contains(Mouse.getPosition()) || target.hover())) {
                if (Mouse.click(Mouse.Button.RIGHT) && (Menu.isOpen() || Execution.delayUntil(Menu::isOpen, this.ctx.profile.rest(50, 100, 200)))) {
                    item = Menu.getItem(target instanceof ActionBar.Slot ? null : target, action, name);
                }
            }
        }
        if (item != null && (item.isVisible() || Execution.delayUntil(item::isVisible, this.ctx.profile.rest(300, 600, 900)))) {
            Execution.delay(this.ctx.profile.decision(Menu.getItemCount()));
            if ((item.contains(Mouse.getPosition()) || item.hover()) && item.isVisible()) {
                if (Mouse.click(Mouse.Button.LEFT) && Mouse.wasClickSuccessful(target) && this.ctx.profile.reacting()) {
                    this.ctx.logger.fine(this.status("Right Click: " + action + " -> " + target));
                    return true;
                }
            }
        }
        return false;
    }
 
Top