Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 int getPrice(String name) throws IOException {
- if (name.contains("arrow"))
- name = name + "s";
- if (name.equals("Herb"))
- name = "Unidentified herb";
- if (name.length() <= 3)
- return 0;
- URL url = new URL(
- "http://forums.zybez.net/runescape-2007-prices/api/item/"
- + name.replace("+", "%2B").replace(' ', '+')
- .replace("'", "%27"));
- URLConnection con = url.openConnection();
- con.addRequestProperty("User-Agent", "Mozilla/5.0");
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null)
- line += inputLine;
- in.close();
- if (!line.contains("average\":"))
- return 0;
- System.out.println(line);
- line = line.substring(line.indexOf("average\":")
- + "average\":".length());
- line = line.substring(0, line.indexOf(","));
- return (int) Math.round(Double.parseDouble(line));
- }
- 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