averagee Posted August 15, 2017 Posted August 15, 2017 How do I get info of players that are near my scout bot? like name,position, equipped wealth?
bugsinmycode Posted August 15, 2017 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/
bugsinmycode Posted August 15, 2017 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
averagee Posted August 15, 2017 Author 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
bugsinmycode Posted August 15, 2017 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!