Jump to content

Welcome to DreamBot!

Download for Free

Supercharge Your Bots

Run unlimited bots today using DreamBot's Covert Mode and
stay more protected.

Upgrade Now
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java 8 installed
  • 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 gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox

Interested in advertising your business? Reach out today!

Download the DreamBot client today!
Sign in to follow this  
Pandemic

DreamBot v2.9.9.4

Recommended Posts

Hello everyone!

A new version of DreamBot is now live!

Changes:

  • Added Ferox Enclave bank location
  • Deprecated Clan Wars bank location
  • Various bug fixes

Always remember, to be on the latest version of our client you must run the DBLauncher.jar the client does NOT update itself!

Thanks,

The Dream Team

Share this post


Link to post
Share on other sites
1 hour ago, Mancubus said:

Think I found a bug in DEATHS_DOOR solver, my bot kept clicking the portal while it still needed to to the dialogue with death and got stuck that way.

That does seem to be common among scripts since they updated RS with that death update. Is it skipping one or two of the options?

Share this post


Link to post
Share on other sites
14 hours ago, tjet said:

That does seem to be common among scripts since they updated RS with that death update. Is it skipping one or two of the options?

Its not doing any of the options and just keeps spamming the portal.

Share this post


Link to post
Share on other sites

@Mancubus @tjet

 

Disable deaths door:

getRandomManager().disableSolver(RandomEvent.DEATHS_DOOR);

 

use the snippet below to get around the death bug (will need slight modification to work):

 

package org.cloakd.common.util;

import org.cloakd.common.Constants;
import org.cloakd.common.walking.Location;
import org.cloakd.common.walking.Walking;
import org.cloakd.core.NodeScript;
import org.cloakd.core.nodes.AbstractSubScriptNode;
import org.dreambot.api.methods.Calculations;
import org.dreambot.api.methods.magic.Normal;
import org.dreambot.api.randoms.RandomEvent;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.wrappers.interactive.GameObject;
import org.dreambot.api.wrappers.interactive.NPC;

import java.util.Arrays;
import java.util.List;

public class GetLootOnDeath extends AbstractSubScriptNode {
  	//Variables pulled in from external class
  	final int PS_TOMBSTONE_TIMER = 1697;
    final Area DEATHS_DOMAIN_ENTRANCE_AREA = new Area(3238, 3195, 3240, 3191); //Lumby only supported for now
    final int DEATHS_DOMAIN_ENTRANCE = 38426;
    final int DEATHS_DOMAIN_EXIT = 39549;
    final int DEATHS_COFFER = 39550;


	//Walking.walkTo is just a wrapper around getWalking.walk with a few extra checks

	//Check in domain via object as the area teleports about
    public static boolean inDeathsDomain(AbstractScript ctx) {
        return ctx.getGameObjects().closest(Constants.DEATHS_COFFER) != null;
    }

	//Main script below

    public String name() {
        return "Get loot on death";
    }

    private boolean firstDeath = false;


    private final List<String> deathOptions = Arrays.asList("Can I collect the items from that gravestone now?", "Bring my items here now; I'll pay your fee.");

    @Override
    public boolean validate(NodeScript ctx) {
        return ctx.getPlayerSettings().getConfig(Constants.PS_TOMBSTONE_TIMER) > 0 || ctx.getWidgets().getWidget(669) != null;
    }


    @Override
    public int execute(NodeScript ctx) {
        //Death domain hops about so we need to use objects
        if (!Location.inDeathsDomain(ctx)) {
            return this.enterDeathsDomain(ctx);
        }

        if (!ctx.getDialogues().inDialogue() && firstDeath) {
            return this.exitDeathsDomain(ctx); //First death we need to dip out first before claiming our loot
        }

        //Take items
        if (ctx.getWidgets().getWidget(669) != null && ctx.getWidgets().getWidget(669).isVisible()) {
            ctx.getWidgets().getWidget(669).getChild(10).interact("Take-All");
            ctx.sleep(600, 1200); //Vibe for a bit
            ctx.getWidgets().getWidget(669).getChild(1).getChild(11).interact("Close");
            ctx.sleep(800, 2600); //Vibe for a bit

            return this.exitDeathsDomain(ctx); //Exit deaths domain
        }

        if (ctx.getDialogues().inDialogue()) {
            return this.talkToDeath(ctx);
        }

        NPC death = ctx.getNpcs().closest("Death");
        if (death == null) {
            ctx.log("Unable to escape death!");
            ctx.getTabs().logout();
            ctx.sleepUntil(() -> !ctx.getClient().isLoggedIn(), 5000);
            return 0;
        }

        if (ctx.getPlayerSettings().getConfig(Constants.PS_TOMBSTONE_TIMER) > 0) {
            death.interact("Talk-to");
            ctx.sleepUntil(() -> ctx.getDialogues().inDialogue(), 3000);
            return 0;
        }

        death.interact("Collect");

        ctx.sleepUntil(() -> ctx.getDialogues().inDialogue(), 5000);
        return 0;

    }

    @Override
    public int priority() {
        return 12;
    }

    /**
     * Navigates to deaths domain and enters
     *
     * @param ctx
     * @return
     */
    private int enterDeathsDomain(AbstractScript ctx) {
        if (!Constants.LUMBRIDGE.contains(ctx.getLocalPlayer().getTile())) {
            if (!ctx.getMagic().canCast(Normal.HOME_TELEPORT)) {
                ctx.log("Cant reclaim loot, logging off");
                ctx.getTabs().logout();
                ctx.sleepUntil(() -> !ctx.getClient().isLoggedIn(), 5000);
                return 0;
            }

            ctx.log("Casting home teleport");
            ctx.getMagic().castSpell(Normal.HOME_TELEPORT);
            ctx.sleepUntil(() -> Constants.LUMBRIDGE.contains(ctx.getLocalPlayer().getTile()), 20000);
            return 0;
        }

        GameObject deathsEntrance = ctx.getGameObjects().closest(Constants.DEATHS_DOMAIN_ENTRANCE);

        if (deathsEntrance == null || !deathsEntrance.isOnScreen()) {
            ctx.log("Walking to deaths domain entrance");
            return Walking.walkTo(ctx, Constants.DEATHS_DOMAIN_ENTRANCE_AREA.getRandomTile());
        }


        ctx.log("Entering deaths domain");
        deathsEntrance.interact();
        ctx.sleepUntil(() -> Location.inDeathsDomain(ctx), 5000);
        return 0;
    }

    /**
     * Exits deaths domain
     *
     * @param ctx
     * @return
     */
    private int exitDeathsDomain(AbstractScript ctx) {
        GameObject deathsExit = ctx.getGameObjects().closest(Constants.DEATHS_DOMAIN_EXIT);
        if (deathsExit == null) {
            ctx.log("Cant find death exit, logging out & disabling login random");
            ctx.getRandomManager().disableSolver(RandomEvent.LOGIN);
            ctx.getTabs().logout();
            ctx.sleepUntil(() -> !ctx.getClient().isLoggedIn(), 6000);
            return 0;
        }

        if (!deathsExit.isOnScreen()) {
            ctx.getWalking().walk(deathsExit);
            ctx.sleepUntil(deathsExit::isOnScreen, 4000);
        }


        ctx.log("Exiting domain");
        deathsExit.interact();
        ctx.sleepUntil(() -> !Location.inDeathsDomain(ctx), 5000);

        firstDeath = false; //Will now be reset
        return 0;
    }

    /**
     * Talk to our boi Death and clear gravestone to collect here
     *
     * @param ctx
     * @return
     */
    private int talkToDeath(NodeScript ctx) {
        if (ctx.getDialogues().canContinue()) {
            ctx.getDialogues().continueDialogue();
            ctx.sleep(125, 300);
            return 0;
        }

        String[] options = ctx.getDialogues().getOptions();
        if (options != null && options.length > 0) {
            for (String option : options) {
                if (deathOptions.contains(option)) {
                    ctx.getDialogues().chooseOption(option);
                    return (int) Calculations.nextGaussianRandom(250, 125);  //Vibe just a lil
                }

                if (option.contains("<str>")) {
                    firstDeath = true; //Mark for next time we enter the loop
                }

                //Should handle the first death issue
                if (!option.contains("<str>")) {
                    ctx.getDialogues().chooseOption(option);
                    return (int) Calculations.nextGaussianRandom(250, 125);  //Vibe just a lil
                }
            }
        }
        return 0;
    }
}

 

Share this post


Link to post
Share on other sites

@thecloakdone Jezus thats alot of code just to handle Death . Wrote my own handler for first death and all other deaths in like 15 lines lol back when it just got added to the game. But I would like to use the clients handler. Thank you anyways for the disable snippet tho :)

Edited by Mancubus

Share this post


Link to post
Share on other sites
3 minutes ago, Mancubus said:

Jezus thats alot of code to handle Death. Wrote my own handler for first death and all other deaths in like 15 lines lol Thanks for the disable snippet tho cause I couldnt find that myself earlier.

Yup, this handles all aspects of the death mechanic not just escaping the room.

@Mancubus mind posting your code so i can see how you did it? 15 lines is a lot less.

Edited by thecloakdone

Share this post


Link to post
Share on other sites
7 hours ago, thecloakdone said:

Yup, this handles all aspects of the death mechanic not just escaping the room.

@Mancubus mind posting your code so i can see how you did it? 15 lines is a lot less.

Cant really show it to you Im afraid since it is kind of custom made for my method.

 

Edited by Mancubus

Share this post


Link to post
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.

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.

Sign in to follow this  

×
×
  • Create New...