chardragon Posted August 25, 2023 Share Posted August 25, 2023 (edited) Hi, I want to click on a specific square and I've created a position called target which has the x, y, and z all visible from the bank. Atm I am using getmap().walk(target) which uses the map which i don't think is realistic as its right next to the bank. so I think its better to just click on the map after fast closing the bank interface with escape. How can i do this as i tried using the api but i didnt get very far. Edit: I would also appreciate if someone can tell me how i can do actions on specific locations for example say I want to mine 3 rocks is there a way I can make the bot focus on the 3 rocks in a way which is better than RS2Object ore_vein = getObjects().closest(obj -> obj.getName().equals("Iron rocks") && MiningArea.contains(obj)); Ideally I would like to cycle through 3 rocks so that it does the same order rather than atm this produces somewhat random results sometimes it picks the top one then the middle then back to the top then bottom etc. which isnt very real like Edited August 25, 2023 by chardragon Quote Link to comment Share on other sites More sharing options...
skillerkidos1 Posted August 25, 2023 Share Posted August 25, 2023 for walking make an event and use setMiniMapDistanceThreshold Quote Link to comment Share on other sites More sharing options...
skillerkidos1 Posted August 25, 2023 Share Posted August 25, 2023 private void test() { RS2Object rock1 = getObjects().getAll().stream().filter( a -> a.getName().equals("Iron rock") && a.getX() == 123 && a.getY() == 234) .findAny().orElse(null); boolean minedRock1 = false; boolean minedRock2 = false; if (minedRock1 && minedRock2) { //make all false } else if (!minedRock1) { //mine rock 1 //set true } else if (!minedRock2) { //mine rock2 //set true } } 1 Quote Link to comment Share on other sites More sharing options...
abc3 Posted August 25, 2023 Share Posted August 25, 2023 8 hours ago, chardragon said: Edit: I would also appreciate if someone can tell me how i can do actions on specific locations for example say I want to mine 3 rocks is there a way I can make the bot focus on the 3 rocks in a way which is better than RS2Object ore_vein = getObjects().closest(obj -> obj.getName().equals("Iron rocks") && MiningArea.contains(obj)); Ideally I would like to cycle through 3 rocks so that it does the same order rather than atm this produces somewhat random results sometimes it picks the top one then the middle then back to the top then bottom etc. which isnt very real like Doing it your way is way more bot like, clicking the same rocks in the same order forever. A player just clicks the closest rock when it spawns. More random is better. Also your script should be stateless. I.e. we don't keep track of what we have done, we simply read the game state and decide what to do each time. Quote Link to comment Share on other sites More sharing options...
chardragon Posted August 25, 2023 Author Share Posted August 25, 2023 1 minute ago, abc3 said: Doing it your way is way more bot like, clicking the same rocks in the same order forever. A player just clicks the closest rock when it spawns. More random is better. Also your script should be stateless. I.e. we don't keep track of what we have done, we simply read the game state and decide what to do each time. I disagree mate, maybe i explained it wrong but imagine you are mining 3 rocks around you so your character stands still you are more likely in real life to go say top middle bottom and repeat than to to top middle back to top etc... and just to clarify i am specifically talking about iron ore here so that you mine one the next one has spawned. I try to just try to implement what i do when i play. Regarding your last point ill try to bare that in mind thanks for taking the time to reply 7 hours ago, skillerkidos1 said: private void test() { RS2Object rock1 = getObjects().getAll().stream().filter( a -> a.getName().equals("Iron rock") && a.getX() == 123 && a.getY() == 234) .findAny().orElse(null); boolean minedRock1 = false; boolean minedRock2 = false; if (minedRock1 && minedRock2) { //make all false } else if (!minedRock1) { //mine rock 1 //set true } else if (!minedRock2) { //mine rock2 //set true } } Thank you! Quote Link to comment Share on other sites More sharing options...
abc3 Posted August 25, 2023 Share Posted August 25, 2023 (edited) 5 hours ago, chardragon said: I disagree mate, maybe i explained it wrong but imagine you are mining 3 rocks around you so your character stands still you are more likely in real life to go say top middle bottom and repeat than to to top middle back to top etc... and just to clarify i am specifically talking about iron ore here so that you mine one the next one has spawned. I try to just try to implement what i do when i play. Regarding your last point ill try to bare that in mind thanks for taking the time to reply Thank you! Do you think a player will perfectly click 3 rocks in order with no mistakes for any more than a few minutes? No, because a human doesn't have perfect memory, a human makes mistakes, and the game can be unpredictable. You'd be better off just checking for rocks that are facing you or facing next to you first. That's more how real players mine. Then if none are immediately close you mine the other rock. Edited August 25, 2023 by abc3 Quote Link to comment Share on other sites More sharing options...