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
  • DNC Farmer Pro: Script progress updates


    Computor

    Recommended Posts

    Hey guys, welcome to my AIO Farming updates post. This will be a frequently-updated post regarding the process of my AIO Farming script. It will mostly involve lots of information regarding computer science, but I’ll also post pictures to be a little more noob-friendly. A little explanation of bits and bitwise operators:

     

    CLICK BUTTON TO VIEW!

     

    There are 2000 “player settings†in Runescape. They are how Runescape stores information on your account temporarily. Everything from the amount of items in the G.E. to if your run is enabled or not is stored in your player settings. It is unlikely many people will ever need to know this, but just realize that it’s a great source of information for scripters. These settings can be checked from ANYWHERE in Runescape, which means that if it’s loaded (they are loaded when you log in), you can get the information on it. So, I would be able to see what plants are growing in any plot, from anywhere in Runescape.

     

    The nice thing about them is that you’re also able to see farming values, i.e. the crops growing in your plots, if they’re watered or not, what state they’re in, and much more. That makes it handy for me to write a script like this, but also annoying. So, here’s what a player setting looks like (in binary):

                0000 0000 0000 0000 0000 0000 0000 0000

    I know, confusing right? Each player setting (all 2000 of them) look like that. All of those 0s could represent a 1 as well. Each 1 or 0 represents something in the game, for example, the bit that represents if your character’s running is turned off or not is stored in player setting 173. When you turn it on it looks like this:

                [173] 0000 0000 0000 0000 0000 0000 0000 0001

    And when you turn your run off, it looks like this:

                [173] 0000 0000 0000 0000 0000 0000 0000 0000

    That single bit at the end of the list represents if your running is enabled or not, pretty crazy right? All of those other 0s (bits) are currently being unused, but they could hold information too.

     

    Now, how do I check if the run is enabled or not, now that I know that single bit represents running enablement? I use BITWISE OPERATORS!

     

    They’re pretty difficult to grasp, so I’m not going to go into too much detail, but to find that single bit I “and†that single bit, so I end up with:

                0000 0000 0000 0000 0000 0000 0000 0000   <-- bit state of [173] (running not enabled)

             & 0000 0000 0000 0000 0000 0000 0000 0001   <-- “& 0x01†also written as “& 1â€.

                0000 0000 0000 0000 0000 0000 0000 0000   <-- equals 0, because our bit wasn’t a 1.

     

    This can be written as (bitValue & 0x01). That means, I ignore all other bits except the bit at position 0 (the first 0 on the right). So if I want to check if running is enabled, I can write a method like this:

    public boolean isRunEnabled(){
                return (getPlayerSettings().getConfig(173) & 0x01) == 1;
    } 

    This checks the player setting at configuration 173 (that’s where the running configuration is stored), and check to see if the bit at position 0 is equal to 1. If it is, then our running is enabled, else it’s not enabled (because it’s a 0).

     

    You can check player settings in the Game Debugger option in DreamBot like this:

    c5l24JP.gif

     

     

     

     

     

    10/7/2015

     

     

    I created a GUI to debug all of the crops/compost/tool leprechaun, for easier visuals of the bits in game. It's just like having a paint display all of the information, but instead of crowding my screen with information, I made a GUI to store all of it. It was fairly simple, but definitely needed to be done for testing purposes.

     

    GUI:

    2015-10-07_23-28-49.gif

     

    2015-10-07_23-44-41.gif

     

     

     

     

     

    10/6/2015

     

     

    Today I created my "AbstractPlant" class, which I can now use to start building my plant classes. I'm planning on every plant class contain an inner class, for example:

    public class Trees{       
        public class Tree{
        }
    }
    

    "Trees" will contain getter-methods of all of the tree locations, and all of their settings. "Tree" will contain all of the tree-specific methods, i.e. "isGrowing()" or "isDead()":

    RYUO96e.png

     

     

     

     

     

    10/5/2015

     

     

    Today was a challenging day. I finished my process on the bitwise operations for the compost bins, which was fairly difficult, but now done. For those wondering, the bits for the compost bin are:

    • Falador – bits 0-7 of 511

    • Catherby – bits 8-15 of 511

    • Port Phasmatys – bits 16-24 of 511

    • Ardougne – bits 25-32 of 511

    Format: (TTTT AAAA)

    T = Type

    A = Amount

    (Details on the bitwise operator will not be shared, but I will say that it was pretty confusing (some compost states shared the same T-bits, and the A-bits relied on the T-bit states)

     

     

    Final product (simple paint, demonstrating that the bits are being accessed/processed):

    2015-10-06_14-36-15.gif

     

    Final methods:

    FLENmjw.png

     

     

     

     

    9/30/2015

     

     

    Finished the Tool Leprechaun class, which was pretty damn fun. The bits were easy to read, and only the buckets gave me trouble. Everything else was very straight forward. For those wondering, the bits for the Tool Leprechaun are:

    • Bits 0-29 of 615

    • Bits 9-12 of 439 (ONLY used to tell the count of the buckets)

    Every function ever needed for them was created:

    9exM2mA.png

     

    Demo video showing a simple paint, demonstrating that the bits are being accessed/processed:

    https://dl.dropboxusercontent.com/s/4qkkpuy76g3rm49/2015-09-30_17-00-34.mp4?dl=0

     

     

     

     

     

    9/5/2015

     

     

    Finished my GUI, and basic script set-up. I reworked my node framework, so that I only have a single line of code in onLoop() controlling all node classes:

    oZYOYSB.png

    This (in my opinion) make the main driver class look a lot nicer.

     

     

    The GUI went terribly wrong though, when I realized that ONLY allotments, flowers, and hops could be watered. Currently the GUI has a “Water patch†for all patches, however it won’t be needed on half of them:

    x1vU8Fo.png
    This is a little disappointing, as I will have to remove all of these options.

     

    Link to comment
    Share on other sites

    This looks great Computor. I wasn't familiar with how the player settings were stored and modified so this is a great resource.

     

    Best of luck with completion of the script :)

    They're pretty neat, but also really annoying XD

    Link to comment
    Share on other sites

    They're pretty neat, but also really annoying XD

     

    varp bits are wonderful.

     

    Minigame info (Barrows) is also stored in these bits.

    Link to comment
    Share on other sites

    varp bits are wonderful.

     

    Minigame info (Barrows) is also stored in these bits.

    Apparently (according to Nezz) they've become unreadable, following no pattern at all, which is why they're annoying  :(

     

    Edit: at barrows***

    Link to comment
    Share on other sites

    Hopefully you finish this script this time, it has been so long since you've started lol

     

    It's coming along nicely.

    Link to comment
    Share on other sites

    Hopefully you finish this script this time, it has been so long since you've started lol

     

    It's coming along nicely.

    Lol, gotta update previous scripts, and do school work. Going to take time....

    Also: I never didn't finish it...? Just takes a while.

    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.