Jump to content

Fire Runecrafter


Imthabawse

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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