paradoxed

Untitled

Mar 10th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.98 KB | None | 0 0
  1. package bot.constants;
  2.  
  3. import bot.Main;
  4. import org.dreambot.api.methods.Calculations;
  5. import org.dreambot.api.methods.container.impl.bank.BankLocation;
  6. import org.dreambot.api.methods.interactive.GameObjects;
  7. import org.dreambot.api.methods.map.Area;
  8. import org.dreambot.api.methods.map.Tile;
  9. import org.dreambot.api.methods.skills.Skill;
  10. import org.dreambot.api.methods.world.World;
  11. import org.dreambot.api.methods.world.WorldGrabber;
  12. import org.dreambot.api.wrappers.interactive.GameObject;
  13. import org.dreambot.api.wrappers.interactive.NPC;
  14. import org.dreambot.api.wrappers.items.GroundItem;
  15.  
  16.  
  17. import java.text.NumberFormat;
  18. import java.util.List;
  19.  
  20. /**
  21. * Created by 7804364 on 3/1/2016.
  22. */
  23. public class Methods extends Main {
  24. //Walker
  25. public static int walkerX, walkerY, walkerZ;
  26. public static String walkerLocation;
  27. public static boolean atDestination = false;
  28. public static BankLocation walkerBank;
  29. public static boolean fuckoff = false;
  30. //Walker
  31.  
  32. //Fighter
  33. public static double fighterExpStart, fighterStartLevel, fighterTnl, fighterCurrLevel, fighterExpGained, fighterCurrExp;
  34. public static String fighterMethod;
  35. public static String fighterSelection;
  36. public static double fighterProgBar;
  37. public static boolean powerkill;
  38. public static int fighterKills;
  39. public static boolean fighterBank;
  40. public static boolean fighterEat;
  41. public static int fighterItemsLooted;
  42. public static boolean fighterLoot;
  43. public static String fighterLootItem;
  44. public static int fighterFoodAmount;
  45. public static String fighterFoodType;
  46. public static int fighterEatPercent;
  47. public static String fighterSkill;
  48. //Fighter
  49.  
  50. //Woodcutter
  51. public static double woodcuttingExpStart, woodcuttingStartLevel, woodcuttingTnl, woodcuttingCurrLevel, woodcuttingExpGained, woodcuttingCurrExp;
  52. public static String woodcutterMethod;
  53. public static String woodcutterLogs;
  54. public static double woodcutterProgBar;
  55. public static boolean powerchop;
  56. public static int logsChopped;
  57. public static boolean woodcutterBank;
  58. //Woodcutter
  59.  
  60. public static Main ctx;
  61. public static boolean canDropOre() {
  62. return powermine && ctx.getInventory().contains(miningOre);
  63. }
  64. public static boolean canDropLogs() {
  65. return powerchop && ctx.getInventory().contains(logs);
  66. }
  67. public static boolean canDropGems() {
  68. return dropgems && ctx.getInventory().contains(GEMS);
  69. }
  70. public static boolean atBank() {
  71. if (getClosestBank().contains(ctx.getLocalPlayer())) {
  72. return true;
  73. }
  74. return false;
  75. }
  76. public static boolean atBank1() {
  77. GameObject bank = ctx.getGameObjects().closest("Bank chest");
  78. if (bank != null) {
  79. if (bank.distance(ctx.getLocalPlayer().getTile()) <= 20) {
  80. return true;
  81. }
  82. }
  83. return false;
  84. }
  85. public static Area getClosestBank() {
  86. return ctx.getBank().getClosestBankLocation().getArea(3);
  87. }
  88. public static boolean isBusy() {
  89. return ctx.getPlayers().localPlayer().isMoving() || ctx.getPlayers().localPlayer().getAnimation() != -1;
  90. }
  91. public static boolean gotOre() {
  92. return ctx.getInventory().contains(Methods.miningOre);
  93. }
  94. public static boolean gotGems() {
  95. return ctx.getInventory().contains(GEMS);
  96. }
  97. public static boolean gotLogs() {
  98. return ctx.getInventory().contains(logs);
  99. }
  100. public static int getHourly(final int amount, final long elapsed) {
  101. return (int) (amount * 3600000.0D / elapsed);
  102. }
  103. public static String formatNumber(int i) {
  104. return NumberFormat.getIntegerInstance().format(i);
  105. }
  106. public static String Status = "Loading...";
  107. public static String Version = "1.5.2";
  108. public static double miningExpStart, miningStartLevel, miningTnl, miningCurrLevel, miningExpGained, miningCurrExp;
  109. public static String miningMethod;
  110. public static String miningOre;
  111. public static double minerProgBar;
  112. public static final String[] GEMS = {"Uncut sapphire", "Uncut emerald", "Uncut ruby", "Uncut diamond"};
  113. 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)"};
  114. 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)"};
  115. public static String logs;
  116. public static int[] oreObjectIds;
  117. public static boolean deathWalk;
  118. public static boolean canDeathWalk;
  119. public static boolean powermine;
  120. public static boolean needsEq;
  121. public static boolean lootReturn = false;
  122. public static boolean lavaPass = false;
  123. public static boolean walk = true;
  124. public static boolean dropgems;
  125. public static int oresMined;
  126. public static boolean killCounter;
  127. public static boolean minebank;
  128. public static boolean wcStaged;
  129. public static String bot;
  130. public static Tile playerLoc;
  131. public static boolean showGraph = true;
  132. public static int reflexSeed = 200;
  133.  
  134. public static int getReflexSeed() {
  135. return reflexSeed;
  136. }
  137. public static boolean pickerHasSupplies () {
  138. if (ctx.getEquipment().contains(Methods.RINGS) && ctx.getEquipment().contains(Methods.AMULETS)) {
  139. return true;
  140. }
  141. return false;
  142. }
  143.  
  144. public static void walkToBank() {
  145. Status = "Walking to bank";
  146. if (!atBank()) {
  147. ctx.getBank().openClosest();
  148. }
  149. }
  150. public static void worldHop() {
  151. if (ctx.getPlayers().all().size() >= 5) {
  152. }
  153. }
  154. public static void walkToLastLoc() {
  155. Status = "Walking back";
  156. if (playerLoc != null) {
  157. ctx.getWalking().walk(playerLoc);
  158. }
  159. }
  160. public static void setRun () {
  161. if (ctx.getWalking().getRunEnergy() >= 20 && !ctx.getWalking().isRunEnabled()) {
  162. Status = "Toggleing run";
  163. ctx.getWalking().toggleRun();
  164. }
  165. }
  166. public static boolean atMine() {
  167. GameObject rock = ctx.getGameObjects().closest("Rocks");
  168. List<GameObject> rocks = ctx.getGameObjects().all("Rocks");
  169. if(rocks != null) {
  170. if (oreObjectIds != null) {
  171. if (rock != null) {
  172. if (rock.distance(ctx.getLocalPlayer()) >= 10) {
  173. return false;
  174. }
  175. } else {
  176. return false;
  177. }
  178. for (GameObject r : rocks) {
  179. int id = r.getID();
  180. for (Integer i : oreObjectIds) {
  181. if (i == id) {
  182. return true;
  183. }
  184. }
  185. }
  186. } else {
  187. return false;
  188. }
  189. }
  190. log("atMine: false");
  191. return false;
  192. }
  193. public static boolean canChop (){
  194. GameObject tree = ctx.getGameObjects().closest(Methods.woodcutterLogs);
  195. if (tree != null) {
  196. if (tree.exists()) {
  197. if (tree.distance(ctx.getLocalPlayer()) >= 10) {
  198. return false;
  199. }
  200. return true;
  201. }
  202. }
  203. return false;
  204. }
  205. public static boolean gotFood() {
  206. return ctx.getInventory().contains(fighterFoodType);
  207. }
  208.  
  209. /**
  210. * Check if the player has all food.
  211. */
  212. public static boolean gotAllFood() {
  213. return ctx.getInventory().count(fighterFoodType) == fighterFoodAmount;
  214. }
  215.  
  216. /**
  217. * Check if player can fight.
  218. */
  219. public static boolean canFight() {
  220. NPC target = ctx.getNpcs().closest(fighterSelection);
  221. return ctx.getLocalPlayer().getInteractingCharacter() == null && ctx.getLocalPlayer().getHealthPercent() >= fighterEatPercent && target != null;
  222. }
  223. public static boolean canLoot() {
  224. GroundItem loot = ctx.getGroundItems().closest(fighterLootItem);
  225. if (loot != null) {
  226. if (loot.distance(ctx.getLocalPlayer()) <= 10) {
  227. if (fighterLoot) {
  228. return true;
  229. }
  230. }
  231. }
  232. if (ctx.getInventory().isFull()) {
  233. return false;
  234. }
  235. return false;
  236. }
  237. public static boolean gotLoot() {
  238. return ctx.getInventory().contains(fighterLootItem);
  239. }
  240. public static boolean canHeal() {
  241. return ctx.getLocalPlayer().getHealthPercent() <= fighterEatPercent && gotFood();
  242. }
  243. public static boolean atClanWars () {
  244. Tile tile = new Tile(3369,3170,0);
  245. if (tile.distance(ctx.getLocalPlayer().getTile()) <= 80) {
  246. return true;
  247. }
  248. return false;
  249. }
  250. public static boolean atCaveExit () {
  251. Tile tile = new Tile(2948,4384,2);
  252. if (tile.distance(ctx.getLocalPlayer().getTile()) <= 40) {
  253. return true;
  254. }
  255. return false;
  256. }
  257. public static boolean atCave () {
  258. Tile tile = new Tile(3206,3681,0);
  259. if (tile.distance(ctx.getLocalPlayer().getTile()) <= 3) {
  260. return true;
  261. }
  262. return false;
  263. }
  264. public static boolean inPortal () {
  265. Tile tile = new Tile(3327,4753,0);
  266. if (tile.distance(ctx.getLocalPlayer().getTile()) <= 6) {
  267. return true;
  268. }
  269. return false;
  270. }
  271. public static boolean atBerries () {
  272. Tile tile = new Tile(3218,3814,0);
  273. Tile myTile = ctx.getLocalPlayer().getTile();
  274. if (tile.equals(myTile)) {
  275. return true;
  276. }
  277. return false;
  278. }
  279. public static boolean atLava () {
  280. Tile tile = new Tile(3246,3835,0);
  281. if (tile.distance(ctx.getLocalPlayer().getTile()) <= 6) {
  282. return true;
  283. }
  284. return false;
  285. }
  286. public static int getCurrentLevel (Skill skill) {
  287. return ctx.getSkills().getRealLevel(skill);
  288. }
  289. public static int getExpTnl (Skill skill) {
  290. return ctx.getSkills().getExperienceToLevel(skill);
  291. }
  292. public static int getCurrentExp (Skill skill) {
  293. ctx.log("getCurrentExp: " +getCurrentExp(Skill.MINING));
  294. return ctx.getSkills().getExperience(skill);
  295. }
  296. public static int getStartExp (Skill skill) {
  297. return ctx.getSkillTracker().getStartExperience(skill);
  298. }
  299. public static int getStartLevel (Skill skill) {
  300. return ctx.getSkillTracker().getStartLevel(skill);
  301. }
  302. public static double getExpGained (Skill skill) {
  303. return getCurrentExp(skill) - ctx.getSkillTracker().getStartExperience(skill);
  304. }
  305. public static double getPercent (Skill skill) {
  306. return (getCurrentExp(skill)/(getExpTnl(skill)+getCurrentExp(skill)));
  307. }
  308. }
Advertisement
Add Comment
Please, Sign In to add comment