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
  • Try asking for help in the chatbox
  • SourB Cow Hide Looter [Open Source] V1.2


    SourBear
     Share

    Recommended Posts

    SourB Cow Hide Looter

    Hello! This is my first script so go easy I guess? I decided to make a cow hide looter, simply because the cow hide looters available aren't quite up to scratch and I don't think I can handle to many more tutorials. So, I've come to ask for some help from you guys! If you's could help me with a few things I would be SO thankful.

    Current features

    ✔️ Collects cowhides  

    ✔️ Banks

    ✔️ Returns to cow pen and repeats

    To do list :

    To add :

      - Add a 'Information Panel' with things such as

                                                                                                   * Cowhides collected, time running, estimated GP value, cowhides per hour and GP per hour.

     - Add anti-ban of some kind                                   

                      -Add stop after certain time option (not important)           

    To fix :

                                                                   - Fix speed (make the script pick up more cowhides per hour by smoothing code)

    Current progress :

    package org.dreambot.sourb;
    
    import org.dreambot.api.methods.container.impl.bank.BankLocation;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.items.GroundItem;
    
    @ScriptManifest(author = "SourB", category = Category.MONEYMAKING, description = "Collects cow hides from the cow pen northeast of Lumbridge, collects till full inventory then goes and banks. It'll return and repeat. Check forum post for more details!", name = "SourB Cow Hide Collector v1.2", version = 1.0)
    
    public class Main3 extends AbstractScript {
    
        public static final String Cowhide = "Cowhide";
    
        private final Area collectingArea = new Area(3265, 3255, 3249, 3298);
    
        @Override
        public int onLoop() {
            if (collectingArea.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()) {
                if (!getInventory().isFull()) {
                    //Picks up cowhides if in 'collectingArea' and doesn't have a full inventory
                    GroundItem Cowhide = getGroundItems().closest("Cowhide");
                    if (Cowhide != null) {
                        Cowhide.interact("Take");
                    }
                }
            } else if (!collectingArea.contains(getLocalPlayer()) && !getInventory().isFull()) {
                //If player is not in the collecting area and does not have a full inventory go to collecting area
                getWalking().walk(collectingArea.getRandomTile());
            }
            if (getInventory().isFull()) {
                //Is the bank open?
                if (getBank().isOpen()) {
                    //If the bank is open deposit all cowhides
                    getBank().depositAll(Cowhide);
                    //Waits a bit
                    sleep(250);
                    //Closes bank and continues
                    getBank().close();
                }  else {
                    //If the bank is not open, go open it
                    getBank().open(BankLocation.LUMBRIDGE);
                }
            }
            return 1000;
        }
    }

    Download link :

    SourB Cow Hide Looter.jar

    Notes :

    The purpose of this script is for the entire community to use and to contribute to. My idea behind this is to not only get better at coding but to help all the people who need a script for quick starting money in F2P. I know the amount of times I thought how the cow hide collecting scripts could be done better. Currently, most of the 'To fix' list is complete and I believe I can start on some of the . If you would like to contribute please comment below, whether with code to paste in or helping me to understand anything to do with the code needed. Links to tutorials are also very helpful, thank you for reading and especially thank you for contributing if you do.

    I also plan to update this as I fix/work on it. I eventually I will call it done and either hand it on or just let it float around the forums. But, I'll decide when that day comes.

    -SourBear

     

    Patch Notes :

    V1.1 - 19/10/2018 Fixed the way the script picks up cowhides

    V1.1 - 19/10/2018 Fixed banking, now closes bank before trying to return to cow pen

    v1.0 - 18/10/2018 Initial release onto forums

     

            

    Edited by SourBear
    Update v1.2
    Link to comment
    Share on other sites

    20 minutes ago, BigDamnHero said:

    You could write a sleepUntil() method after the depositAll() method and then the getBank().close(). this shoud work

    Oh, yeah. Honestly didn't remember the sleepUntil command, I remembered the sleep command which wasn't going to be any help. Thank you, I'll update this tomorrow after school with my new modifications. Have a good one!

    -SourBear

    Link to comment
    Share on other sites

    16 hours ago, BigDamnHero said:

    You could write a sleepUntil() method after the depositAll() method and then the getBank().close(). this shoud work

    So I managed to do it without the sleepUntil command. I pondered what you said and ended up getting confused so I tried making the script do more than one thing after the getBank().isOpen() method which I didn't know I could do. Thank you for contributing though!

    -SourBear

    Link to comment
    Share on other sites

    I just wrote a cow hide collector myself. It's far from optimized or anything perfect. But here you can see an example how I use the sleepUntil methods. Maybe you can do something with this. 

     

    Edited by BigDamnHero
    Link to comment
    Share on other sites

      if (getLocalPlayer().isMoving()) {
                //Does nothing, stops player trying to collect other cowhides while collecting one. (Couldn't figure out how to make the other method to do this work)
            } else if (collectingArea.contains(getLocalPlayer())) {

    You could remove the first if statement checking if hes moving and add a condition on the second if checking if hes NOT moving to start collecting.

     if (collectingArea.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()) {

    Link to comment
    Share on other sites

    4 hours ago, chinguina said:

    Can you help me use your script please?

     

    Sure thing, first you need to download the .jar file in the post. Next, go ahead and navigate to C:\Users\*your computers name*\DreamBot\Scripts. This is where you need to put the .jar file. Now you can load up Dreambot and click on the 'Tools' tab at the top and then the 'Script Panel' option. Once in the script menu, click on 'Local Scripts' and you should see it there. If you can't, clicking the 'Refresh All' option should fix it. If it doesn't just double check the file is in the scripts folder. If it still doesn't show up the best advice I can offer  is try and troubleshoot the problem and if you notice any bugs while running the script let me know straight away! The faster I know about em the faster I can fix em! Hope you enjoy the script and any feedback is very appreciated. Have a good one!

    -SourBear

    Link to comment
    Share on other sites

    2 minutes ago, GGWP said:
      if (getLocalPlayer().isMoving()) {
                //Does nothing, stops player trying to collect other cowhides while collecting one. (Couldn't figure out how to make the other method to do this work)
            } else if (collectingArea.contains(getLocalPlayer())) {

    You could remove the first if statement checking if hes moving and add a condition on the second if checking if hes NOT moving to start collecting.

     if (collectingArea.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()) {

    Ah, I see. I'll try implement that now and let you know how it goes. If it works I'll update the post with the new changes. Thanks for the help, have a good one!

    -SourBear

    Link to comment
    Share on other sites

    40 minutes ago, GGWP said:
      if (getLocalPlayer().isMoving()) {
                //Does nothing, stops player trying to collect other cowhides while collecting one. (Couldn't figure out how to make the other method to do this work)
            } else if (collectingArea.contains(getLocalPlayer())) {

    You could remove the first if statement checking if hes moving and add a condition on the second if checking if hes NOT moving to start collecting.

     if (collectingArea.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()) {

    Hey thanks! It works perfect and makes the coding look smaller. Cheers for the help, have a good one!

    -SourBear

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.