Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Player settings


    Miami 369

    Recommended Posts

    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.

     

     

    Link to comment
    Share on other sites

    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;

     

    Link to comment
    Share on other sites

    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.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.