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
  • Open source saltpetre script


    Hashtag

    Recommended Posts

    I have made a small change in the script. It now checks for Energy Potion(4) in the bank. If they are there, it takes one out and drink it.

    Just tested and it is working. I hope it will make a great change in the digs per hour. Getting about 750ish atm which is not good.

     

     

     

    @Override

    public int onLoop () {

    if (!getWalking ().isRunEnabled () && getWalking ().getRunEnergy () >= getWalking ().getRunThreshold ())

    getWalking ().setRunThreshold (10 + Calculations.random (15));

    if (getInventory ().contains ("Energy potion(4)")){

    getInventory ().interact ("Energy potion(4)", "Drink");

    }

    if (getInventory().contains ("Energy potion(3)")){

    getInventory ().interact ("Energy potion(3)", "Drink");}

    if (getInventory ().contains ("Energy potion(2)")){

    getInventory ().interact ("Energy potion(2)", "Drink");}

    if (getInventory ().contains ("Energy potion(1)")){

    getInventory ().interact ("Energy potion(1)", "Drink");}

    if (getInventory ().contains ("Vial")){

    getInventory ().interact ("Vial", "Drop");}

    if (getInventory ().isFull ()) {

    if (getBank ().isOpen ()) {

    if (getBank ().depositAllExcept ("Spade")) {

    netflixNow = Calculations.random (2) == 1;

    sleepUntil ( () -> getInventory ().onlyContains ("Spade"), 2000);

    if (getBank ().contains ("Energy Potion(4)") && getWalking ().getRunEnergy () <= 55){

    sleepUntil ( () -> getBank ().withdraw ("Energy Potion(4)", 1), 2000);

    sleepUntil ( () -> getBank ().close (), 2000);

    sleepUntil ( () -> getBank ().close (), 2000);

    }

     

     

     

     

    }

    } else {

    if (BankLocation.HOSIDIUS.getCenter ().distance (getLocalPlayer ()) < 8) {

    if (getBank ().open ()) {

    sleepUntil ( () -> getLocalPlayer ().isMoving () || getBank ().isOpen (), 2000);

    }

    } else {

    if (isWalking (bankTile))

    return 200;

    if (getWalking ().walk (bankTile)) {

    sleepUntil ( () -> getLocalPlayer ().isMoving (), 2000);

    }

    }

    }

    } else {

    if (nextDig < timer.elapsed ()) {

    saltpetre = getGameObjects ().closest ("Saltpetre");

    if (saltpetre != null) {

    whichArea ();

    if (saltpetre.distance (getLocalPlayer ()) < 10) {

    if (!getLocalPlayer ().isAnimating () && saltpetre.interact ("Dig")) {

    nextDig = timer.elapsed () + 3000;

    sleepUntil ( () -> getLocalPlayer ().isMoving () || getLocalPlayer ().isAnimating (), 2000);

    }

    } else {

    if (!getLocalPlayer ().isMoving () && getWalking ().walk (saltpetre)) {

    sleepUntil ( () -> getLocalPlayer ().isMoving () || saltpetre.distance (getLocalPlayer ()) < 10, 2000);

    }

    }

    } else {

    goToSaltpetre ();

    }

    } else {

    if (netflixNow) {

    if (getMouse ().isMouseInScreen ()) {

    if (nextCameraMovement > timer.elapsed ()) {

    if (getCamera ().rotateTo (Calculations.random (0, 300), Calculations.random (0, 2000))) {

    nextCameraMovement = timer.elapsed () + Calculations.random (4500, 20000);

    }

    }

    if (getMouse ().moveMouseOutsideScreen ())

    sleep (2000, 4000);

    }

    } else {

    if (nextCameraMovement < timer.elapsed ()) {

    if (getCamera ().rotateTo (Calculations.random (0, 2000), Calculations.random (0, 300))) {

    nextCameraMovement = timer.elapsed () + Calculations.random (4500, 20000);

    }

    }

    if (nextHover < timer.elapsed ()) {

    List go = getGameObjects ().all (g -> g != null && g.isOnScreen ());

    int i = Calculations.random (go.size ());

    if (go.get (i) != null) {

    if (getMouse ().move (go.get (i))) {

    nextHover = timer.elapsed () + Calculations.random (4500, 15000);

    }

    }

    }

    }

    }

    }

    return 200;

    }

     

     

     

    Replace the loop function with the code above. Thanks for the amazing scrip Hashtag!

     

    edit: Realized this script makes saltpeter digging authentic as it moves to each area and inspect for the saltpile! cheers.

    Link to comment
    Share on other sites

    I have made a small change in the script. It now checks for Energy Potion(4) in the bank. If they are there, it takes one out and drink it.

    Just tested and it is working. I hope it will make a great change in the digs per hour. Getting about 750ish atm which is not good.

     

     

     

    @Override

    public int onLoop () {

    if (!getWalking ().isRunEnabled () && getWalking ().getRunEnergy () >= getWalking ().getRunThreshold ())

    getWalking ().setRunThreshold (10 + Calculations.random (15));

    if (getInventory ().contains ("Energy potion(4)")){

    getInventory ().interact ("Energy potion(4)", "Drink");

    }

    if (getInventory().contains ("Energy potion(3)")){

    getInventory ().interact ("Energy potion(3)", "Drink");}

    if (getInventory ().contains ("Energy potion(2)")){

    getInventory ().interact ("Energy potion(2)", "Drink");}

    if (getInventory ().contains ("Energy potion(1)")){

    getInventory ().interact ("Energy potion(1)", "Drink");}

    if (getInventory ().contains ("Vial")){

    getInventory ().interact ("Vial", "Drop");}

    if (getInventory ().isFull ()) {

    if (getBank ().isOpen ()) {

    if (getBank ().depositAllExcept ("Spade")) {

    netflixNow = Calculations.random (2) == 1;

    sleepUntil ( () -> getInventory ().onlyContains ("Spade"), 2000);

    if (getBank ().contains ("Energy Potion(4)") && getWalking ().getRunEnergy () <= 55){

    sleepUntil ( () -> getBank ().withdraw ("Energy Potion(4)", 1), 2000);

    sleepUntil ( () -> getBank ().close (), 2000);

    sleepUntil ( () -> getBank ().close (), 2000);

    }

     

     

     

     

    }

    } else {

    if (BankLocation.HOSIDIUS.getCenter ().distance (getLocalPlayer ()) < 8) {

    if (getBank ().open ()) {

    sleepUntil ( () -> getLocalPlayer ().isMoving () || getBank ().isOpen (), 2000);

    }

    } else {

    if (isWalking (bankTile))

    return 200;

    if (getWalking ().walk (bankTile)) {

    sleepUntil ( () -> getLocalPlayer ().isMoving (), 2000);

    }

    }

    }

    } else {

    if (nextDig < timer.elapsed ()) {

    saltpetre = getGameObjects ().closest ("Saltpetre");

    if (saltpetre != null) {

    whichArea ();

    if (saltpetre.distance (getLocalPlayer ()) < 10) {

    if (!getLocalPlayer ().isAnimating () && saltpetre.interact ("Dig")) {

    nextDig = timer.elapsed () + 3000;

    sleepUntil ( () -> getLocalPlayer ().isMoving () || getLocalPlayer ().isAnimating (), 2000);

    }

    } else {

    if (!getLocalPlayer ().isMoving () && getWalking ().walk (saltpetre)) {

    sleepUntil ( () -> getLocalPlayer ().isMoving () || saltpetre.distance (getLocalPlayer ()) < 10, 2000);

    }

    }

    } else {

    goToSaltpetre ();

    }

    } else {

    if (netflixNow) {

    if (getMouse ().isMouseInScreen ()) {

    if (nextCameraMovement > timer.elapsed ()) {

    if (getCamera ().rotateTo (Calculations.random (0, 300), Calculations.random (0, 2000))) {

    nextCameraMovement = timer.elapsed () + Calculations.random (4500, 20000);

    }

    }

    if (getMouse ().moveMouseOutsideScreen ())

    sleep (2000, 4000);

    }

    } else {

    if (nextCameraMovement < timer.elapsed ()) {

    if (getCamera ().rotateTo (Calculations.random (0, 2000), Calculations.random (0, 300))) {

    nextCameraMovement = timer.elapsed () + Calculations.random (4500, 20000);

    }

    }

    if (nextHover < timer.elapsed ()) {

    List go = getGameObjects ().all (g -> g != null && g.isOnScreen ());

    int i = Calculations.random (go.size ());

    if (go.get (i) != null) {

    if (getMouse ().move (go.get (i))) {

    nextHover = timer.elapsed () + Calculations.random (4500, 15000);

    }

    }

    }

    }

    }

    }

    return 200;

    }

     

     

     

    Replace the loop function with the code above. Thanks for the amazing scrip Hashtag!

     

    edit: Realized this script makes saltpeter digging authentic as it moves to each area and inspect for the saltpile! cheers.

    if (getInventory ().contains ("Energy potion(4)")){
    getInventory ().interact ("Energy potion(4)", "Drink");
    }
    if (getInventory().contains ("Energy potion(3)")){
    getInventory ().interact ("Energy potion(3)", "Drink");}
    if (getInventory ().contains ("Energy potion(2)")){
    getInventory ().interact ("Energy potion(2)", "Drink");}
    if (getInventory ().contains ("Energy potion(1)")){
    getInventory ().interact ("Energy potion(1)", "Drink");}
    

    you could literally make this 1 line lol

    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.