Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Keeping mouse in specific tile, NEED HELP.

Featured Replies

Hey all, been scratching my head for hours on this one. 

 

Is there a way to keep clicking within a certain tile on the screen until you gather a resource from that specific tile? I'm using objects.closest("   "); However since the field is crowded it sometimes clicks multiple different ones.

I have the x,y position of the tile saved.

 

Thanks, any advice helps, I have been looking through the API

Use a filter on your objects.closest, match only objects with that tile as their position.

  • Author

You guys are the best, I'll try these.

 

46 minutes ago, Charlotte said:

Hover on the position, if appears, then interact?

Can you give me an example to learn from?

46 minutes ago, Night said:

Use a filter on your objects.closest, match only objects with that tile as their position.

Same as above, anything helps. First script in this API.

  • Author
54 minutes ago, Imateamcape said:

Position pos;

getMouse().click(new MainScreenTileDestination(getBot(), pos));

This is the tile on the screen right judged by difference from the bot right? Trying to have it do this on the maps x,y position if possible. 

Edited by blokus

1 minute ago, blokus said:

This is the tile on the screen right judged by difference from the bot right? Trying to have it do this on the maps x,y position if possible. 

that's what it does.

  • Author
15 minutes ago, Imateamcape said:

that's what it does.

So getMouse().click(new MainScreenTileDestination(getBot(), potatoXY)); should click on a potato only in that tile if I have the position stored in potatoXY?

Edited by blokus

11 minutes ago, blokus said:

So getMouse().click(new MainScreenTileDestination(getBot(), potatoXY)); should click on a potato only in that tile if I have the position stored in potatoXY?

should click on the tile. if you're looking to click on the potato without writing a complex interaction method, try getting the bounding box of the position and clicking in a smaller area surrounding its center (this is completely ignoring right-click scenarios as well, assuming there's nothing above it).

Edited by Imateamcape

  • Author
20 hours ago, Imateamcape said:

should click on the tile. if you're looking to click on the potato without writing a complex interaction method, try getting the bounding box of the position and clicking in a smaller area surrounding its center (this is completely ignoring right-click scenarios as well, assuming there's nothing above it).

Thanks a ton man! This is a very steep learning curve for me (just C,C++ experience). 

 

Can someone please give me a code example of how to click the second and or third closest object? Would really appreciate it. <3 

2 minutes ago, blokus said:

Thanks a ton man! This is a very steep learning curve for me (just C,C++ experience). 

 

Can someone please give me a code example of how to click the second and or third closest object? Would really appreciate it. <3 

get a list of the objects (getObjects().getAll()), sort using a comparator, and get the 2nd or 3rd if there are more than 3 in there.

  • Author
12 minutes ago, Imateamcape said:

get a list of the objects (getObjects().getAll()), sort using a comparator, and get the 2nd or 3rd if there are more than 3 in there.

Do i store them in an int array? How would you just target potatoes?

  • Author
22 hours ago, Imateamcape said:

Position pos;

getMouse().click(new MainScreenTileDestination(getBot(), pos));

This works flawlessly <3 was too noob yesterday to utilize it. Thanks again

2 hours ago, blokus said:

Do i store them in an int array?

how would you store the objects in an int array and why would that help? bro...

filter out all invalid objects, sort by distance to your position using a comparator, and grab the 2nd or 3rd one (given that there's enough elements in the list)

  • Author

Thanks, figured you could store the objects x,y positions in an array and sort from closest to furthest. It's my second day with this API, thanks for the help :) I'll try not to ask more dumb questions.. I have no idea how to do what you said but I'll look around the forums more inventively. 

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.