paradoxed

Untitled

Mar 2nd, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. package bot.constants;
  2.  
  3. import bot.Main;
  4. import org.dreambot.api.methods.container.impl.bank.BankLocation;
  5. import org.dreambot.api.methods.map.Tile;
  6. import org.dreambot.api.wrappers.interactive.GameObject;
  7. import org.dreambot.api.wrappers.interactive.NPC;
  8.  
  9.  
  10. import java.text.NumberFormat;
  11. import java.util.List;
  12.  
  13. /**
  14. * Created by 7804364 on 3/1/2016.
  15. */
  16. public class Methods extends Main{
  17.  
  18. public static Main ctx;
  19. public static boolean canDropOre() {
  20. return powermine && ctx.getInventory().contains(miningOre);
  21. }
  22. public static boolean canDropGems() {
  23. return dropgems && ctx.getInventory().contains(GEMS);
  24. }
  25. public static boolean atBank() {
  26. NPC banker = ctx.getNpcs().closest("Banker");
  27. if (banker == null) return false;
  28. return banker.isOnScreen() && banker.exists();
  29. }
  30. public static boolean isBusy() {//thats it try it
  31. return ctx.getPlayers().localPlayer().isMoving() || ctx.getPlayers().localPlayer().getAnimation() != -1;
  32. }
  33. public static boolean gotOre() {
  34. return ctx.getInventory().contains(Methods.miningOre);
  35. }
  36. public static boolean gotGems() {
  37. return ctx.getInventory().contains(GEMS);
  38. }
  39. public static boolean atMine() {
  40. List<GameObject> rocks = ctx.getGameObjects().all("Rocks");
  41. if(rocks != null) {
  42. for (GameObject r : rocks) {
  43. int id = r.getID();
  44. for (Integer i : oreObjectIds) {
  45. if (i == id) {
  46. return true;
  47. }
  48. }
  49. }
  50. }
  51. return false;
  52. }
  53. public static int getHourly(final int amount, final long elapsed) {
  54. return (int) (amount * 3600000.0D / elapsed);
  55. }
  56. public static String formatNumber(int i) {
  57. return NumberFormat.getIntegerInstance().format(i);
  58. }
  59. public static String Status = "Loading...";
  60. public static String Version = "0.0.1";
  61. public static double miningExpStart, miningStartLevel, miningTnl, miningCurrLevel, miningExpGained, miningCurrExp;
  62. public static String miningMethod;
  63. public static String miningOre;
  64. public static double minerProgBar;
  65. public static final String[] GEMS = {"Uncut sapphire", "Uncut emerald", "Uncut ruby", "Uncut diamond"};
  66. public static int[] oreObjectIds;
  67. public static boolean powermine;
  68. public static boolean dropgems;
  69. public static int oresMined;
  70. public static boolean minebank;
  71. public static String bot;
  72. public static Tile playerLoc;
  73.  
  74. public static void walkToBank() {
  75. Status = "Walking to bank";
  76. ctx.getWalking().walk(BankLocation.getNearest(ctx.getPlayers().localPlayer()).getCenter());
  77. }
  78. public static void walkToLastLoc() {
  79. Status = "Walking back";
  80. ctx.getWalking().walk(playerLoc);
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment