Axolotl 31 Posted September 1, 2021 Hey everyone, So one of the things I want the script I'm making to do is PK. I created a method to scan and find players that are within combat level to attack based on the wilderness level you're in, and I sort it to prioritize the lowest combat. The player will then attack the target player. However... I have 2 things I'd like to do but am struggling to find any dreambot methods to do so: 1. How to get a list of what target player's equipment is, it would be nice to know if they are using melee / range / mage so I know what type of weapon / armor / prayer to use 2. How to get target's skill levels, so I can know what their max hit is (will likely have to know equipment for this, but I can speculate even without) Would appreciate any help, Thank you
Hosfad 155 Posted September 1, 2021 List<String> itemNames = new ArrayList<>(); int[] playerAppearance = player.getComposite().getAppearance(); if (playerAppearance != null) { for (int equipmentID : playerAppearance) { int formattedID = equipmentID - 512; Item itemName = new Item(formattedID,1); if (formattedID > 0) { itemNames.add(itemName.getName()); } } This will get you the names of the the player , you just have to modify the second line to the nearby player you are trying to get the equipment for
Axolotl 31 Author Posted September 1, 2021 @Hosfad Thank you!! Had a feeling it was something simple, but couldn't for the life of me find it. Will test it out later tonight @Hosfad Any chance you also know how to get their skill levels?
Pseudo 179 Posted September 1, 2021 1 hour ago, Axolotl said: @Hosfad Thank you!! Had a feeling it was something simple, but couldn't for the life of me find it. Will test it out later tonight @Hosfad Any chance you also know how to get their skill levels? You'd more than likely have to use a hiscores query.
brave 29 Posted September 1, 2021 You can use this for stats: https://secure.runescape.com/m=hiscore_oldschool/index_lite.ws?player=X where X is the player's name.
Axolotl 31 Author Posted September 1, 2021 23 hours ago, Pseudo said: You'd more than likely have to use a hiscores query. 20 hours ago, braveheart said: You can use this for stats: https://secure.runescape.com/m=hiscore_oldschool/index_lite.ws?player=X where X is the player's name. Thank you guys for the response, but do you know if there are any DreamBot methods for requesting highscore querys / getting return result? I can definitely do this myself as it's just grabbing the html text off the website and parsing it, but I feel like it would be a very useful thing to have built in. Figured I'd ask first is all before coding what could be redundant stuff EDIT: All good here, created a method to parse the url response. Thank you both for the helpful suggestions with getting skills @Pseudo and @braveheart. Your link was really helpful for removing redundant info needing to be parsed
Recommended Posts
Archived
This topic is now archived and is closed to further replies.