Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking Combat Style

Featured Replies

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. 

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

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.

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 by Eagle Scripts

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();
    	}

     

  • Author

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:

9Whhgka.png

When you enable this you will see a list of id:value pairs appear:

iochpa7.png

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:

PgeyyXB.png

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
}
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:

9Whhgka.png

When you enable this you will see a list of id:value pairs appear:

iochpa7.png

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:

PgeyyXB.png

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

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

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 :boge:

Dont suppose you know more to save me some effort :boge:

Edited by Fruity

11 minutes ago, Fruity said:

never knew that, clever bug :boge:

Dont suppose you know more to save me some effort :boge:

Maybe I do :boge:

What might you need :boge: ?

10 minutes ago, FrostBug said:

Maybe I do :boge:

What might you need :boge: ?

whatever might be on offer :boge: 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.