Jump to content

Fire Runecrafter


Recommended Posts

Posted (edited)

Feedback appreciated :) 

 

Thing's to add:  Better walking method to bank and to ruins ( always walks the same path using webwalking ) it's a shame this don't randomize it self better :(

Better control over when bot toggles run ( toggles run when it only has 15% for example ) I plan on adding energy pot support since this is a F2P based script which might counter act this a bit if energy pots are being used.

Completely stop the loop cycle and have mouse move off screen for a bit at random intervals or after so many random loops ( if possible ) as some sort of "anti-ban" feature or "human-like" feature if you will. Might not matter much but seems logical.

 

Code

 

public class Firecrafter extends Script {


    private Area PortalArea = new Area(2578, 4844, 2569, 4854);
    private Area RuinsArea = new Area(3312, 3250, 3307, 3253);


    private void bank() throws InterruptedException {
        Entity portal = getObjects().closest(PortalArea, "Portal");

        if(getInventory().contains("Fire rune") && !myPlayer().isAnimating() && !myPlayer().isMoving() && portal != null) {
            log("Teleporting out..");
            portal.interact("Use");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return myPlayer().isAnimating() && RuinsArea.contains(myPlayer());
                }
            }.sleep();
        }
        if(getInventory().contains("Fire rune") && !myPlayer().isMoving()) {
            log("Walking to bank..");
            getWalking().webWalk(Banks.AL_KHARID);
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return Banks.AL_KHARID.contains(myPlayer());
                }
            }.sleep();
        }
        if(Banks.AL_KHARID.contains(myPlayer()) && getInventory().contains("Fire rune")) {
            log("Banking..");
            getBank().open();
            sleep(random(800,1200));
            getBank().depositAll();
            sleep(random(825,1125));
            getBank().withdrawAll("Pure essence");
            sleep(random(700,900));
            getBank().close();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return getInventory().contains("Pure essence");
                }
            }.sleep();
        }else if(Banks.AL_KHARID.contains(myPlayer()) && !getInventory().contains("Pure essence")) {
            getBank().open();
            sleep(random(800,1200));
            getBank().withdrawAll("Pure essence");
            sleep(random(825,1125));
            getBank().close();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return getInventory().contains("Pure essence");
                }
            }.sleep();
        }
    }



    private void craft() {

        Entity ruins = getObjects().closest("Mysterious ruins");
        Entity altar = getObjects().closest("Altar");

        if (!RuinsArea.contains(myPlayer()) && !PortalArea.contains(myPlayer()) && !myPlayer().isAnimating() && !myPlayer().isMoving()) {
            log("Walking to ruins..");
            getWalking().webWalk(RuinsArea);
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return RuinsArea.contains(myPlayer());
                }
            }.sleep();
        }
        if (RuinsArea.contains(myPlayer()) && ruins != null) {
            log("Entering");
            ruins.interact("Enter");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return PortalArea.contains(myPlayer()) && myPlayer().isVisible();
                }
            }.sleep();
        }
        if (PortalArea.contains(myPlayer()) && altar != null) {
            log("Crafting runes..");
            altar.interact("Craft-rune");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return myPlayer().isAnimating() && getInventory().contains("Fire rune");
                }
            }.sleep();
        }
    }


    private void lvlUp() {
        if(getDialogues().isPendingContinuation()) {
            getDialogues().clickContinue();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return !getDialogues().isPendingContinuation();
                }
            }.sleep();
        }
    }



    @Override
    public int onLoop() throws InterruptedException {
        if(getInventory().contains("Pure essence")) {
            craft();
        }else{
            bank();
            lvlUp();
        }

        return 500;
    }
}
Edited by Imthabawse

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...