Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Methods extends Main{
- private 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");
- return banker.isOnScreen() && banker.exists();
- }
- public static boolean isBusy() {
- return ctx.getPlayers().localPlayer().isMoving() || ctx.getPlayers().localPlayer().getAnimation() != -1;
- }
- public static boolean atMine() {
- for (int i = 0; i < oreObjectIds.length; i++) {
- GameObject rocks = ctx.getGameObjects().closest("Rocks");
- if (rocks.getID() == oreObjectIds[i]) {
- if (rocks.isOnScreen()) {
- 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 boolean minebank;
- public static String bot;
- 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));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment