Ace Posted March 4, 2016 Posted March 4, 2016 (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 March 4, 2016 by _Ace_
Ace Posted March 4, 2016 Author Posted March 4, 2016 Why aren't you working with the decimal value?What do you mean?
Token Posted March 4, 2016 Posted March 4, 2016 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.
Ace Posted March 4, 2016 Author Posted March 4, 2016 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
Token Posted March 4, 2016 Posted March 4, 2016 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 } 1
Ace Posted March 4, 2016 Author Posted March 4, 2016 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
Diclonius Posted March 4, 2016 Posted March 4, 2016 (edited) 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 March 4, 2016 by Diclonius
Ace Posted March 4, 2016 Author Posted March 4, 2016 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
Xerion Posted March 4, 2016 Posted March 4, 2016 You should use bit shifting and bitwise operators. 2
Khaleesi Posted March 4, 2016 Posted March 4, 2016 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 1
Ace Posted March 4, 2016 Author Posted March 4, 2016 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 1