yfoo Posted January 21, 2018 Share Posted January 21, 2018 How do you check what combat skill is being trained? Upon a cursory check with the widget debugger there does not seem to be a difference in the combat style button widget variables when a said button is selected or not but I am likely missing something. The other way I can think of is using the experience tracker to find out which skill's xp is increasing but that feels like a clunky approach. Thanks. Quote Link to comment Share on other sites More sharing options...
Butters Posted January 21, 2018 Share Posted January 21, 2018 configs.get(43) Here you go my friend. Each config value means something different. I do believie that 0 - Attack 1 - Strength 3 - Defence Might be wrong, once you check those feel free to post the correct values Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted January 21, 2018 Share Posted January 21, 2018 (edited) Take a look into configs Edit: I found something in my workspaces for you. The general idea of this should be able to help you : https://hastebin.com/miloqepima.java It should be used in combination with s.getConfigs().get(43) Edited January 21, 2018 by Eagle Scripts 1 Quote Link to comment Share on other sites More sharing options...
Alek Posted January 21, 2018 Share Posted January 21, 2018 10 hours ago, Eagle Scripts said: Take a look into configs Edit: I found something in my workspaces for you. The general idea of this should be able to help you : https://hastebin.com/miloqepima.java It should be used in combination with s.getConfigs().get(43) Know of a reliable way to tell if you're currently on range/mage/melee? I think I ran into that issue years ago when I first started scripting here. Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted January 21, 2018 Share Posted January 21, 2018 (edited) 49 minutes ago, Alek said: Know of a reliable way to tell if you're currently on range/mage/melee? I think I ran into that issue years ago when I first started scripting here. I haven't had to particularly check that so I have never given it an approach. You should always be able to compare the attackStyle that is included in the enum however that'd obviously require the script to open the attack tab which isn't the most efficient. Edit: You could probably also go with the config that stores the magic spell that's on autocast. If there's any; we're doing magic. If there's none than you could do an arrow in the equipment check. Still not a very fancy way though Edited January 21, 2018 by Eagle Scripts Quote Link to comment Share on other sites More sharing options...
Chris Posted January 21, 2018 Share Posted January 21, 2018 1 hour ago, Alek said: Know of a reliable way to tell if you're currently on range/mage/melee? I think I ran into that issue years ago when I first started scripting here. try range = if our WEAPON slot name.contains("crossbow", "bow", ....) melee = if all other options fail or check weapon type with names magic = autocasting or has special staff with attackable option (trident, ...) public boolean isAutocasting(AutocastSpell auto) { return ctx.getConfigs().get(AUTOCAST_SPELL_CONFIG) == auto.getConfigValue(); } Quote Link to comment Share on other sites More sharing options...
yfoo Posted January 22, 2018 Author Share Posted January 22, 2018 Cool, I can now track and display xp gained for a specific combat skill instead of having to track them all. Must have missed the section on configs when I read expliv's scripting tutorial. I had to do some research on what exactly 43 refered to. 13. Configs Hide contents Configs are persistent id-value pairs that are updated on the RuneScape servers when certain events occur in game. For example, there is a config for your player's attack style, it has a fixed id, and it's value changes whenever you select a different attack style in game. There is also a config for your sound settings, and configs for quests, where the value indicates your player's progress through that quest. Like with widgets, there is an option in the OSBot debug settings to enable a config view: When you enable this you will see a list of id:value pairs appear: If you then perform an action in game, for example changing attack style, you will see new id:value pairs appear at the top. If you have multiple id:value pairs with the same id, the highest one on the list displays the current value. For example, the id of the config for attack style is 43. When I start changing the attack style, I can see the config 43's value changing: To retrieve a config's value, you can use the Configs class, to retrieve the instance of this class there is a getter method in the MethodProvider class So to retrieve the current attack style I would write: int attackStyle = getConfigs().get(43); To check if the first attack style is selected I would write: if (getConfigs().get(43) == 0) { // First attack style is selected } Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted January 22, 2018 Share Posted January 22, 2018 48 minutes ago, PayPalMeRSGP said: Cool, I can now track and display xp gained for a specific combat skill instead of having to track them all. Must have missed the section on configs when I read expliv's scripting tutorial. I had to do some research on what exactly 43 refered to. 13. Configs Reveal hidden contents Configs are persistent id-value pairs that are updated on the RuneScape servers when certain events occur in game. For example, there is a config for your player's attack style, it has a fixed id, and it's value changes whenever you select a different attack style in game. There is also a config for your sound settings, and configs for quests, where the value indicates your player's progress through that quest. Like with widgets, there is an option in the OSBot debug settings to enable a config view: When you enable this you will see a list of id:value pairs appear: If you then perform an action in game, for example changing attack style, you will see new id:value pairs appear at the top. If you have multiple id:value pairs with the same id, the highest one on the list displays the current value. For example, the id of the config for attack style is 43. When I start changing the attack style, I can see the config 43's value changing: To retrieve a config's value, you can use the Configs class, to retrieve the instance of this class there is a getter method in the MethodProvider class So to retrieve the current attack style I would write: int attackStyle = getConfigs().get(43); To check if the first attack style is selected I would write: if (getConfigs().get(43) == 0) { // First attack style is selected } Why would you need configs to track the xp gained in a specific skill? https://osbot.org/api/org/osbot/rs07/api/Skills.html Quote Link to comment Share on other sites More sharing options...
yfoo Posted January 22, 2018 Author Share Posted January 22, 2018 3 hours ago, HeyImJamie said: Why would you need configs to track the xp gained in a specific skill? https://osbot.org/api/org/osbot/rs07/api/Skills.html To determine what to put in the paint. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted January 25, 2018 Share Posted January 25, 2018 On 21/1/2018 at 10:25 PM, Alek said: Know of a reliable way to tell if you're currently on range/mage/melee? I think I ran into that issue years ago when I first started scripting here. Your class of weapon is in config 843. You can use that for the most part. The ranged classes are: Bow: 3 Crossbow: 5 Chinchompa: 7 Thrown: 19 Tho more could potentially be added in the future; so it's not exactly future-proof 3 Quote Link to comment Share on other sites More sharing options...
Fruity Posted January 25, 2018 Share Posted January 25, 2018 (edited) 1 hour ago, FrostBug said: Your class of weapon is in config 843. You can use that for the most part. The ranged classes are: Bow: 3 Crossbow: 5 Chinchompa: 7 Thrown: 19 Tho more could potentially be added in the future; so it's not exactly future-proof never knew that, clever bug Dont suppose you know more to save me some effort Edited January 25, 2018 by Fruity Quote Link to comment Share on other sites More sharing options...
FrostBug Posted January 25, 2018 Share Posted January 25, 2018 11 minutes ago, Fruity said: never knew that, clever bug Dont suppose you know more to save me some effort Maybe I do What might you need ? Quote Link to comment Share on other sites More sharing options...
Fruity Posted January 25, 2018 Share Posted January 25, 2018 10 minutes ago, FrostBug said: Maybe I do What might you need ? whatever might be on offer Quote Link to comment Share on other sites More sharing options...