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
  • Easy to use GE thingy?


    ProBotterIamN

    Recommended Posts

    With every successful interaction, increment your "total number of cabbages picked", and display that number times whatever the price of cabbages are to get your profit earned. You can simply create a ratio of current time ran per time in an hour to get your average profit per hour.

    In other words:

     

    1. Let the script verify the cabbage it wants to pick;
    2. Pick the cabbage;
    3. Do a double check that the object was picked (e.g. that the ground object no longer exists);
    4. Simply add 1 to the counter. In your field set: int cabbageCounter = 0; and then in your script after step 3 do: cabbageCounter++;
    5. You can grab the pricing from the GE by using Vlads GE price grabber, found somewhere in the script tutorials, or you can simply use a static number (i think cabbages have been like the same price for over 3 years), and after each loop from step 1 to 4 you update the cabbages counted times the price. This way it will keep you updated after every pick.

    I know this is kinda hard to understand especially if you have little experience with programming, but read it 5 times and you'll understand what i try to explain xD

    Link to comment
    Share on other sites

    @@ProBotterIamN

     

     

     

    GroundItem g = getGroundItems().closest(g1 -> g1 != null && list.contains(g1.getName())); // Gets the item to loot / "pick"
    String name = g.getName();                    // Gets the name so you can look up the price via name if you really want to.
    if (g != null && g.interact("Take")) {
        log("Looting " + name + " x" + g.getAmount());
        int price = priceCheck.getPrice(g.getID());   // implements a pricechecker to calculate the price on the fly.
        if (price == 0) {
            price = priceCheck.getPrice(g.getID()-1); // if the price returned 0, it's likely that the item code
                                                      // was wrong (for stackables)
        }
        profit += price * g.getAmount(); // For looting stackables
        int count = getInventory().count(name);       // gets your current item count in your inventory
        sleepUntil(() -> count < getInventory().count(name) || !g.exists(), 6500); // Sleeps until you've successfully 
                                                                                   // picked the item.
    }
    

     

     

    Link to comment
    Share on other sites

    @@ProBotterIamN

     

     

     

    GroundItem g = getGroundItems().closest(g1 -> g1 != null && list.contains(g1.getName())); // Gets the item to loot / "pick"
    String name = g.getName();                    // Gets the name so you can look up the price via name if you really want to.
    if (g != null && g.interact("Take")) {
        log("Looting " + name + " x" + g.getAmount());
        int price = priceCheck.getPrice(g.getID());   // implements a pricechecker to calculate the price on the fly.
        if (price == 0) {
            price = priceCheck.getPrice(g.getID()-1); // if the price returned 0, it's likely that the item code
                                                      // was wrong (for stackables)
        }
        profit += price * g.getAmount(); // For looting stackables
        int count = getInventory().count(name);       // gets your current item count in your inventory
        sleepUntil(() -> count < getInventory().count(name) || !g.exists(), 6500); // Sleeps until you've successfully 
                                                                                   // picked the item.
    }
    

     

     

    ty but got it working :D waiting for my topic to be accepted then moving to the SDN :)

    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.