Jump to content

Get hexadecimal value of a config


Recommended Posts

Posted (edited)

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?

Hexadecimal values:

https://gyazo.com/9d690c6998f935b08d672f0adc42a167

Thanks a lot for your time! :)

Edited by _Ace_
Posted

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.

Posted

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 :)
Posted

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 smile.png

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
}
  • Like 1
Posted

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
Posted

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 :/
Posted

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 :)
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...