Jump to content

Hover over and click a specific tile


T0ffee

Recommended Posts

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. 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 👍

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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