averagee Posted August 15, 2017 Share Posted August 15, 2017 How do I get info of players that are near my scout bot? like name,position, equipped wealth? Quote Link to comment Share on other sites More sharing options...
bugsinmycode Posted August 15, 2017 Share Posted August 15, 2017 Look at the API docs. You can get players and then check them for each of the things you're asking about. https://osbot.org/api/ Quote Link to comment Share on other sites More sharing options...
bugsinmycode Posted August 15, 2017 Share Posted August 15, 2017 (edited) Here is an example where I've done something similar to what you're asking. This just gets the closest player to your character (that is not your character). Players players = api.getPlayers(); if (players != null) { // get the closest player that is not the script users character closest_player = players.closest((p) -> p.getId() != api.myPlayer().getId()); if (closest_player != null) { // do w/e with closest player } } Edited August 15, 2017 by bugsinmycode 1 Quote Link to comment Share on other sites More sharing options...
averagee Posted August 15, 2017 Author Share Posted August 15, 2017 3 minutes ago, bugsinmycode said: Here is an example where I've done something similar to what you're asking. This just gets the closest player to your character (that is not your character). Players players = api.getPlayers(); if (players != null) { // get the closest player that is not the script users character closest_player = players.closest((p) -> p.getId() != api.myPlayer().getId()); if (closest_player != null) { // do w/e with closest player } } Thank you very much sir. very new with the API Quote Link to comment Share on other sites More sharing options...
bugsinmycode Posted August 15, 2017 Share Posted August 15, 2017 2 minutes ago, averagee said: Thank you very much sir. very new with the API No problem :), and best of luck with your script! Quote Link to comment Share on other sites More sharing options...