Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bot.constants;
- import bot.Main;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.container.impl.bank.BankLocation;
- import org.dreambot.api.methods.interactive.GameObjects;
- import org.dreambot.api.methods.map.Area;
- import org.dreambot.api.methods.map.Tile;
- import org.dreambot.api.methods.skills.Skill;
- import org.dreambot.api.methods.world.World;
- import org.dreambot.api.methods.world.WorldGrabber;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.interactive.NPC;
- import org.dreambot.api.wrappers.items.GroundItem;
- import java.text.NumberFormat;
- import java.util.List;
- /**
- * Created by 7804364 on 3/1/2016.
- */
- public class Methods extends Main {
- //Walker
- public static int walkerX, walkerY, walkerZ;
- public static String walkerLocation;
- public static boolean atDestination = false;
- public static BankLocation walkerBank;
- public static boolean fuckoff = false;
- //Walker
- //Fighter
- public static double fighterExpStart, fighterStartLevel, fighterTnl, fighterCurrLevel, fighterExpGained, fighterCurrExp;
- public static String fighterMethod;
- public static String fighterSelection;
- public static double fighterProgBar;
- public static boolean powerkill;
- public static int fighterKills;
- public static boolean fighterBank;
- public static boolean fighterEat;
- public static int fighterItemsLooted;
- public static boolean fighterLoot;
- public static String fighterLootItem;
- public static int fighterFoodAmount;
- public static String fighterFoodType;
- public static int fighterEatPercent;
- public static String fighterSkill;
- //Fighter
- //Woodcutter
- public static double woodcuttingExpStart, woodcuttingStartLevel, woodcuttingTnl, woodcuttingCurrLevel, woodcuttingExpGained, woodcuttingCurrExp;
- public static String woodcutterMethod;
- public static String woodcutterLogs;
- public static double woodcutterProgBar;
- public static boolean powerchop;
- public static int logsChopped;
- public static boolean woodcutterBank;
- //Woodcutter
- public static Main ctx;
- public static boolean canDropOre() {
- return powermine && ctx.getInventory().contains(miningOre);
- }
- public static boolean canDropLogs() {
- return powerchop && ctx.getInventory().contains(logs);
- }
- public static boolean canDropGems() {
- return dropgems && ctx.getInventory().contains(GEMS);
- }
- public static boolean atBank() {
- if (getClosestBank().contains(ctx.getLocalPlayer())) {
- return true;
- }
- return false;
- }
- public static boolean atBank1() {
- GameObject bank = ctx.getGameObjects().closest("Bank chest");
- if (bank != null) {
- if (bank.distance(ctx.getLocalPlayer().getTile()) <= 20) {
- return true;
- }
- }
- return false;
- }
- public static Area getClosestBank() {
- return ctx.getBank().getClosestBankLocation().getArea(3);
- }
- public static boolean isBusy() {
- 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 gotLogs() {
- return ctx.getInventory().contains(logs);
- }
- 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 = "1.5.2";
- 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 final String[] RINGS = {"Ring of dueling(8)", "Ring of dueling(7)", "Ring of dueling(6)", "Ring of dueling(5)", "Ring of dueling(4)", "Ring of dueling(3)", "Ring of dueling(2)"};
- public static final String[] AMULETS = {"Games necklace(8)", "Games necklace(7)", "Games necklace(6)", "Games necklace(5)", "Games necklace(4)", "Games necklace(3)", "Games necklace(2)"};
- public static String logs;
- public static int[] oreObjectIds;
- public static boolean deathWalk;
- public static boolean canDeathWalk;
- public static boolean powermine;
- public static boolean needsEq;
- public static boolean lootReturn = false;
- public static boolean lavaPass = false;
- public static boolean walk = true;
- public static boolean dropgems;
- public static int oresMined;
- public static boolean killCounter;
- public static boolean minebank;
- public static boolean wcStaged;
- public static String bot;
- public static Tile playerLoc;
- public static boolean showGraph = true;
- public static int reflexSeed = 200;
- public static int getReflexSeed() {
- return reflexSeed;
- }
- public static boolean pickerHasSupplies () {
- if (ctx.getEquipment().contains(Methods.RINGS) && ctx.getEquipment().contains(Methods.AMULETS)) {
- return true;
- }
- return false;
- }
- public static void walkToBank() {
- Status = "Walking to bank";
- if (!atBank()) {
- ctx.getBank().openClosest();
- }
- }
- public static void worldHop() {
- if (ctx.getPlayers().all().size() >= 5) {
- }
- }
- public static void walkToLastLoc() {
- Status = "Walking back";
- if (playerLoc != null) {
- ctx.getWalking().walk(playerLoc);
- }
- }
- public static void setRun () {
- if (ctx.getWalking().getRunEnergy() >= 20 && !ctx.getWalking().isRunEnabled()) {
- Status = "Toggleing run";
- ctx.getWalking().toggleRun();
- }
- }
- public static boolean atMine() {
- GameObject rock = ctx.getGameObjects().closest("Rocks");
- List<GameObject> rocks = ctx.getGameObjects().all("Rocks");
- if(rocks != null) {
- if (oreObjectIds != null) {
- if (rock != null) {
- if (rock.distance(ctx.getLocalPlayer()) >= 10) {
- return false;
- }
- } else {
- return false;
- }
- for (GameObject r : rocks) {
- int id = r.getID();
- for (Integer i : oreObjectIds) {
- if (i == id) {
- return true;
- }
- }
- }
- } else {
- return false;
- }
- }
- log("atMine: false");
- return false;
- }
- public static boolean canChop (){
- GameObject tree = ctx.getGameObjects().closest(Methods.woodcutterLogs);
- if (tree != null) {
- if (tree.exists()) {
- if (tree.distance(ctx.getLocalPlayer()) >= 10) {
- return false;
- }
- return true;
- }
- }
- return false;
- }
- public static boolean gotFood() {
- return ctx.getInventory().contains(fighterFoodType);
- }
- /**
- * Check if the player has all food.
- */
- public static boolean gotAllFood() {
- return ctx.getInventory().count(fighterFoodType) == fighterFoodAmount;
- }
- /**
- * Check if player can fight.
- */
- public static boolean canFight() {
- NPC target = ctx.getNpcs().closest(fighterSelection);
- return ctx.getLocalPlayer().getInteractingCharacter() == null && ctx.getLocalPlayer().getHealthPercent() >= fighterEatPercent && target != null;
- }
- public static boolean canLoot() {
- GroundItem loot = ctx.getGroundItems().closest(fighterLootItem);
- if (loot != null) {
- if (loot.distance(ctx.getLocalPlayer()) <= 10) {
- if (fighterLoot) {
- return true;
- }
- }
- }
- if (ctx.getInventory().isFull()) {
- return false;
- }
- return false;
- }
- public static boolean gotLoot() {
- return ctx.getInventory().contains(fighterLootItem);
- }
- public static boolean canHeal() {
- return ctx.getLocalPlayer().getHealthPercent() <= fighterEatPercent && gotFood();
- }
- public static boolean atClanWars () {
- Tile tile = new Tile(3369,3170,0);
- if (tile.distance(ctx.getLocalPlayer().getTile()) <= 80) {
- return true;
- }
- return false;
- }
- public static boolean atCaveExit () {
- Tile tile = new Tile(2948,4384,2);
- if (tile.distance(ctx.getLocalPlayer().getTile()) <= 40) {
- return true;
- }
- return false;
- }
- public static boolean atCave () {
- Tile tile = new Tile(3206,3681,0);
- if (tile.distance(ctx.getLocalPlayer().getTile()) <= 3) {
- return true;
- }
- return false;
- }
- public static boolean inPortal () {
- Tile tile = new Tile(3327,4753,0);
- if (tile.distance(ctx.getLocalPlayer().getTile()) <= 6) {
- return true;
- }
- return false;
- }
- public static boolean atBerries () {
- Tile tile = new Tile(3218,3814,0);
- Tile myTile = ctx.getLocalPlayer().getTile();
- if (tile.equals(myTile)) {
- return true;
- }
- return false;
- }
- public static boolean atLava () {
- Tile tile = new Tile(3246,3835,0);
- if (tile.distance(ctx.getLocalPlayer().getTile()) <= 6) {
- return true;
- }
- return false;
- }
- public static int getCurrentLevel (Skill skill) {
- return ctx.getSkills().getRealLevel(skill);
- }
- public static int getExpTnl (Skill skill) {
- return ctx.getSkills().getExperienceToLevel(skill);
- }
- public static int getCurrentExp (Skill skill) {
- ctx.log("getCurrentExp: " +getCurrentExp(Skill.MINING));
- return ctx.getSkills().getExperience(skill);
- }
- public static int getStartExp (Skill skill) {
- return ctx.getSkillTracker().getStartExperience(skill);
- }
- public static int getStartLevel (Skill skill) {
- return ctx.getSkillTracker().getStartLevel(skill);
- }
- public static double getExpGained (Skill skill) {
- return getCurrentExp(skill) - ctx.getSkillTracker().getStartExperience(skill);
- }
- public static double getPercent (Skill skill) {
- return (getCurrentExp(skill)/(getExpTnl(skill)+getCurrentExp(skill)));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment