Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bot.constants;
- import bot.Main;
- import org.dreambot.api.methods.container.impl.bank.BankLocation;
- import org.dreambot.api.methods.map.Tile;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.interactive.NPC;
- import java.text.NumberFormat;
- import java.util.List;
- /**
- * Created by 7804364 on 3/1/2016.
- */
- public class Methods extends Main{
- public static Main ctx;
- public static boolean canDropOre() {
- return powermine && ctx.getInventory().contains(miningOre);
- }
- public static boolean canDropGems() {
- return dropgems && ctx.getInventory().contains(GEMS);
- }
- public static boolean atBank() {
- NPC banker = ctx.getNpcs().closest("Banker");
- if (banker == null) return false;
- return banker.isOnScreen() && banker.exists();
- }
- public static boolean isBusy() {//thats it try it
- return ctx.getPlayers().localPlayer().isMoving() || ctx.getPlayers().localPlayer().getAnimation() != -1;
- }
- public static boolean gotOre() {
- return ctx.getInventory().contains(Methods.miningOre);
- }
- public static boolean gotGems() {
- return ctx.getInventory().contains(GEMS);
- }
- public static boolean atMine() {
- List<GameObject> rocks = ctx.getGameObjects().all("Rocks");
- if(rocks != null) {
- for (GameObject r : rocks) {
- int id = r.getID();
- for (Integer i : oreObjectIds) {
- if (i == id) {
- return true;
- }
- }
- }
- }
- return false;
- }
- public static int getHourly(final int amount, final long elapsed) {
- return (int) (amount * 3600000.0D / elapsed);
- }
- public static String formatNumber(int i) {
- return NumberFormat.getIntegerInstance().format(i);
- }
- public static String Status = "Loading...";
- public static String Version = "0.0.1";
- public static double miningExpStart, miningStartLevel, miningTnl, miningCurrLevel, miningExpGained, miningCurrExp;
- public static String miningMethod;
- public static String miningOre;
- public static double minerProgBar;
- public static final String[] GEMS = {"Uncut sapphire", "Uncut emerald", "Uncut ruby", "Uncut diamond"};
- public static int[] oreObjectIds;
- public static boolean powermine;
- public static boolean dropgems;
- public static int oresMined;
- public static boolean minebank;
- public static String bot;
- public static Tile playerLoc;
- public static void walkToBank() {
- Status = "Walking to bank";
- ctx.getWalking().walk(BankLocation.getNearest(ctx.getPlayers().localPlayer()).getCenter());
- }
- public static void walkToLastLoc() {
- Status = "Walking back";
- ctx.getWalking().walk(playerLoc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment