# Get hexadecimal value of a config

## Recommended Posts

Hey,

For a private nmz script I'm having the issue to check wether the player already has a dream bought or not. It's the config id 1058 that changes but the value changes. Suppose you buy a dream and the config changes to a number, then you cancel the dream and the config changes again. This would work but the problem is that when you enter the dream and exit it, the configs from before are not the same anymore when having or not having a dream.

I figured out that the hexadecimal value can be used to compare that, since it's always the same two values.

How can I get the hexadecimal value of a config?

Thanks a lot for your time!

Edited by _Ace_
##### Share on other sites

Integer.toHexString(int)

##### Share on other sites

Why aren't you working with the decimal value?

##### Share on other sites

Why aren't you working with the decimal value?

What do you mean?
##### Share on other sites

What do you mean?

In config debugger you have 3 big buttons for hexadecimal, decimal and binary display. The hexadecimal one is completely useless because there is no case in runescape history where information is stored on nibbles but quite often on bits (hence we sometimes use binary values for example when I wrote Demon Slayer the incantation is written in the quest config). The internal representation of numbers is binary in 2's complement but if you write Ah, 10 or 1010b and compare them with each other you should always get an equality because regardless of base, they have the same internal representation.

##### Share on other sites

In config debugger you have 3 big buttons for hexadecimal, decimal and binary display. The hexadecimal one is completely useless because there is no case in runescape history where information is stored on nibbles but quite often on bits (hence we sometimes use binary values for example when I wrote Demon Slayer the incantation is written in the quest config). The internal representation of numbers is binary in 2's complement but if you write Ah, 10 or 1010b and compare them with each other you should always get an equality because regardless of base, they have the same internal representation.

Thanks for the detailled information! I've never messed to much with it, how would I go about to apply this to my case? Your help is highly appreciated
##### Share on other sites

Thanks for the detailled information! I've never messed to much with it, how would I go about to apply this to my case? Your help is highly appreciated

Click on decimal display. Get the config values

Format:  [CONFIG] : [VALUE] is displayed as you play.

```if (script.configs.get(CONFIG) == VALUE1) {
// in dream
} else if (scripts.config.get(CONFIG) == VALUE2) {
// not in dream
}
```
##### Share on other sites

Click on decimal display. Get the config values

Format: [CONFIG] : [VALUE] is displayed as you play.

`if (script.configs.get(CONFIG) == VALUE1) {    // in dream} else if (scripts.config.get(CONFIG) == VALUE2) {    // not in dream}`
I tried this, but the problem is, as I mentioned above, that those two values always change when you get out of a dream and buy one again
##### Share on other sites

When you enter the lobby, there is an interface that appears. I used this to detect if you are in a dream or not. I found that the setting was too unreliable because would increment after each game or something like that. So it wasn't as simple as just doing if(setting == 12345)

Edited by Diclonius
##### Share on other sites

When you enter the lobby, there is an interface that appears. I used this to detect if you are in a dream or not.

The "Rumble Party" one? I tried that, but sometimes it returned true even if the interface was null. And you'd always have to enter the lobby to see that
##### Share on other sites

You should use bit shifting and bitwise operators.

##### Share on other sites

doesn't matetr if you use a hex, decimal or binary ... the value still stays the same.

It's just another way of representing a number.

bit shifting and bit wise operators are the way to go if you wanna use configs

Khaleesi

##### Share on other sites

doesn't matetr if you use a hex, decimal or binary ... the value still stays the same.

It's just another way of representing a number.

bit shifting and bit wise operators are the way to go if you wanna use configs

Khaleesi

I found a solution thanks

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.