Miami 369 7 Posted August 17, 2018 Whats the best way of dealing with player settings? im working on a quest script, im looking for and easiest way of finding the configs value.
jarred788 9 Posted August 17, 2018 https://github.com/Nezzima/DreamBot/tree/master/DreambotTutIsland/src/nezz/dreambot check this example by nezz.
Articron 746 Posted August 18, 2018 I've made two tutorials on bitwise operations and player settings. You'd have to go to the tutorial section to find them though
Pengu 23 Posted August 18, 2018 You could use a simple switch statement with the varps int config = getPlayerSettings().getConfig(29); switch (config) { case 0: getBank.open; break; case 20: getBank.close; break;
Nuclear Nezz 2107 Posted August 19, 2018 On 8/18/2018 at 2:55 AM, Pengu said: You could use a simple switch statement with the varps int config = getPlayerSettings().getConfig(29); switch (config) { case 0: getBank.open; break; case 20: getBank.close; break; This isn't really what you should do, since not all configs are used for a single purpose. Most configs are used in several different aspects of the game, which is why you need to know bitwise operations. For example, say config 29 is used for 4 different parts of the game, each using 8 bits of the config. If what you're trying to do uses the 2nd 8 bits, you'd need to do: int config = getPlayerSettings().getConfig(29); say the binary value of this is like: 1001 1111 0000 0000 1110 0111 1111 0000 (separated every 4 bits for readability) config = config>>8; // shifts it to the right by 8, leaving you with 1001 1111 0000 0000 1110 0111 config = config&255; // 1111 1111 is binary for 255 This will clear out any of the bits to the left of your 8, leaving you with 1110 0111 *now* the variable config will hold just the information you're looking for, and you can base your script on that. The only tricky part is finding what bits are relevant to you. In quests they're generally single bit changes as you progress through the quest, per each "stage" of actions. There are a few quests that don't follow this (cooks assistant only updates on start and on finish) and some that change much more than a single bit per action change. But generally for other things, like say attack style, you can just swap back and forth and watch what changes and you'll find the bit pretty fast.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.