August 15, 20178 yr How do I get info of players that are near my scout bot? like name,position, equipped wealth?
August 15, 20178 yr 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/
August 15, 20178 yr 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, 20178 yr by bugsinmycode
August 15, 20178 yr Author 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
August 15, 20178 yr 2 minutes ago, averagee said: Thank you very much sir. very new with the API No problem :), and best of luck with your script!
Create an account or sign in to comment