Jump to content

Hover over and click a specific tile


Recommended Posts

Posted

Hello, 

I've been having some trouble getting my script to hover over and click a specific tile near the player (in this case in the Al-kharid mine). 

 

new Position(3299, 3273, 0).hover(getBot());
getMouse().click(false);

 

It seems neither of these methods work, even when directly next to the tile. I've cobbled this solution together from a few old threads but perhaps the API has changed? I'm using mirror mode if that makes any difference.

Any help would be appreciated. 

Posted
4 hours ago, T0ffee said:

Hello, 

I've been having some trouble getting my script to hover over and click a specific tile near the player (in this case in the Al-kharid mine). 

 


new Position(3299, 3273, 0).hover(getBot());
getMouse().click(false);

 

It seems neither of these methods work, even when directly next to the tile. I've cobbled this solution together from a few old threads but perhaps the API has changed? I'm using mirror mode if that makes any difference.

Any help would be appreciated. 

 

Hello old bean

Are you trying to just walk to said tile? If so you can do it with a WalkingEvent:

 

WalkingEvent walkingEvent = new WalkingEvent(new Position(3299, 3273, 0));
walkingEvent.setMinDistanceThreshold(0);
execute(walkingEvent);

 

Could you please also elaborate on what you mean by "neither of these methods work"? Does it not hover the tile? Does it hover but not click?

  • Like 1
Posted
4 hours ago, Explv said:

 

Hello old bean

Are you trying to just walk to said tile? If so you can do it with a WalkingEvent:

 


WalkingEvent walkingEvent = new WalkingEvent(new Position(3299, 3273, 0));
walkingEvent.setMinDistanceThreshold(0);
execute(walkingEvent);

 

Could you please also elaborate on what you mean by "neither of these methods work"? Does it not hover the tile? Does it hover but not click?

 

Rather embarrassingly my original snippet worked perfectly once I put it inside a skeleton script.

My original intention was to interact with a rather obscure NPC for whom the .interact() method doesn't work (but I could extract its position).

 

Many thanks for your reply, and for your work more generally within the OSBot community. 

 

 

  • Like 1
Posted
2 hours ago, T0ffee said:

 

Rather embarrassingly my original snippet worked perfectly once I put it inside a skeleton script.

My original intention was to interact with a rather obscure NPC for whom the .interact() method doesn't work (but I could extract its position).

 

Many thanks for your reply, and for your work more generally within the OSBot community. 

 

 

Glad you got it working 👍

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...