Jump to content

Get hexadecimal value of a config


Ace

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?

Hexadecimal values:

https://gyazo.com/9d690c6998f935b08d672f0adc42a167

Thanks a lot for your time! :)

Edited by _Ace_
Link to comment
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.

Link to comment
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 :)
Link to comment
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 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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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