Advertisement
TheBat

combat

Mar 31st, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.01 KB | None | 0 0
  1. package org.runedream.api.methods;
  2.  
  3.  
  4. import java.awt.Color;
  5. import java.awt.Rectangle;
  6. import java.lang.Integer;
  7.  
  8. import org.runedream.api.methods.OCR.FontType;
  9. import org.runedream.api.methods.Timing.Condition;
  10. import org.runedream.api.util.Random;
  11.  
  12.  
  13. /**
  14. * Combat class for interactions with the combat tab.
  15. * @author TheBat
  16. *
  17. */
  18.  
  19. public class Combat {
  20. public enum Style{
  21. ACCURATE("Accurate"),
  22. AGGRESSIVE("Aggressive"),
  23. CONTROLLED("Controlled"),
  24. DEFENSIVE("Defensive"),
  25. RAPID("Rapid"),
  26. LONGRANGED("Longranged");
  27.  
  28. private final String name;
  29. private Style(final String name) {
  30. this.name = name;
  31. }
  32. private String getname() {
  33. return name;
  34. }
  35. }
  36. public enum Type{
  37. SLASH("Slash"),
  38. STAB("Stab"),
  39. CRUSH("Crush"),
  40. DEFENSIVE("Defensive"),
  41. RANGED("Ranged"),
  42. DEFENSIVE_RANGED("Defensive Ranged"),
  43. MAGIC("Magic"),
  44. DEFENSIVE_MAGIC("Defensive Magic");
  45.  
  46. private final String name;
  47. private Type(final String name) {
  48. this.name = name;
  49. }
  50. private String getname() {
  51. return name;
  52. }
  53. }
  54.  
  55. private enum Weapons {
  56. WEAPON_0("Unarmed", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  57. WEAPON_1("chinchompa", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  58. WEAPON_2("Anger sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  59. WEAPON_3("Bluerite sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  60. WEAPON_4("Darklight", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  61. WEAPON_5("Excalibur", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  62. WEAPON_6("Korasai's sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  63. WEAPON_7("Fremennik blade", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  64. WEAPON_8("Silverlight", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  65. WEAPON_9("Keris", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  66. WEAPON_10("TokTz-Xil-Ek", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  67. WEAPON_11("Toktz-xil-ak", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  68. WEAPON_12("Inferno adze", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  69. WEAPON_13("Dwarven army axe", new String [] {"Controlled","Controlled","Controlled"}, new String [] {"Slash","Stab","Crush"}),
  70. WEAPON_14("Abyssal whip", new String [] {"Accurate","Controlled","Defensive"}, new String [] {"Slash","Slash","Slash"}),
  71. WEAPON_15("Saradomin sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  72. WEAPON_16("Shadow sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  73. WEAPON_17("Granite maul", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  74. WEAPON_18("Tzhaar-ket-om", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  75. WEAPON_19("Barrelchest anchor", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
  76. WEAPON_20("Gadderhammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  77. WEAPON_21("Golden hammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  78. WEAPON_22("Chaotic maul", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  79. WEAPON_23("Tzhaar-ket-em", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  80. WEAPON_24("Verac's flail", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
  81. WEAPON_25("Torag's hammers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  82. WEAPON_26("Brine sabre", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  83. WEAPON_27("Brackish blade", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  84. WEAPON_28("Dharok's greataxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  85. WEAPON_29("Wolfbane", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  86. WEAPON_30("Lucky cutlass", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  87. WEAPON_31("Harry's cutlass", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  88. WEAPON_32("Ivandis flail", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Slash","Crush","Slash"}),
  89. WEAPON_33("Holy water", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  90. WEAPON_34("Balmung", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  91. WEAPON_35("Blisterwood polearm", new String [] {"Controlled","Aggressive","Defensive"}, new String [] {"Stab","Slash","Stab"}),
  92. WEAPON_36("Rod of ivandis", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  93. WEAPON_37("blackjack", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  94. WEAPON_38("Flowers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  95. WEAPON_39("Rubber chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  96. WEAPON_40("Undead chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  97. WEAPON_41("Bouquet", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  98. WEAPON_42("Easter carrot", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  99. WEAPON_43("Mouse Toy", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  100. WEAPON_44("Flagstaff of festivities", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  101. WEAPON_45("Ornate katana", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  102. WEAPON_46("Candy cane", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Stab","Slash"}),
  103. WEAPON_47("Lily of the Valley", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  104. WEAPON_48("Magnifying glass", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  105. WEAPON_49("Snowball", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  106. WEAPON_50("Wooden spoon", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  107. WEAPON_51("Egg whisk", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  108. WEAPON_52("Spork", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  109. WEAPON_53("Spatula", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  110. WEAPON_54("Frying pan", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  111. WEAPON_55("Skewer", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  112. WEAPON_56("Rolling pin", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  113. WEAPON_57("Kitchen knife", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  114. WEAPON_58("Meat tenderiser", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  115. WEAPON_59("Cleaver", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  116. WEAPON_60("Skull sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  117. WEAPON_61("Staff of light", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  118. WEAPON_62("Armadyl battlestaff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  119. WEAPON_63("Ahrim's staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  120. WEAPON_64("Zuriels's staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  121. WEAPON_65("Toktz-mej-tal", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  122. WEAPON_66("Pharaoh's sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  123. WEAPON_67("Void knight mace", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  124. WEAPON_68("olypore staff", new String [] {"Accurate","Longranged"}, new String [] {"Magic", "Defensive Magic"}),
  125. WEAPON_69("Polypore stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  126. WEAPON_70("Chaotic staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  127. WEAPON_71("sling", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  128. WEAPON_72("Hand cannon", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  129. WEAPON_73("bolas", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  130. WEAPON_74("Toktz-xil-ul", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  131. WEAPON_75("salamander", new String [] {"Aggressive","Accurate","Defensive"}, new String [] {"Slash","Ranged","Magic"}),
  132. WEAPON_76("Swamp lizard", new String [] {"Aggressive","Accurate","Defensive"}, new String [] {"Slash","Ranged","Magic"}),
  133. WEAPON_77("harpoon", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  134. WEAPON_78("cattle prod", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  135. WEAPON_79("seercull", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  136. WEAPON_80("Giant's hand", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  137. WEAPON_81("butterfly net", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  138. WEAPON_82("Fixed device", new String [] {"Other","Aggressive"}, new String [] {"Other","Crush"}),
  139. WEAPON_83("Abyssal vine whip", new String [] {"Accurate","Controlled","Defensive"}, new String [] {"Slash","Slash","Slash"}),
  140. WEAPON_84("Blisterwood stake", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  141. WEAPON_85("bone club", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  142. WEAPON_86("Boxing gloves", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  143. WEAPON_87("Broomstick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  144. WEAPON_88("Bubble maker", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  145. WEAPON_89("Burning log", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  146. WEAPON_90("throwing axe", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  147. WEAPON_91("chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  148. WEAPON_92("fox", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  149. WEAPON_93("grain", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  150. WEAPON_94("vexillum", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  151. WEAPON_95("decorative sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  152. WEAPON_96("dominion sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  153. WEAPON_97("Eek", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  154. WEAPON_98("Falconer's glove", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  155. WEAPON_99("Gnomeball", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  156. WEAPON_100("locator", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  157. WEAPON_101("greegree", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  158. WEAPON_102("Icefiend net", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  159. WEAPON_103("Keenblade", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  160. WEAPON_104("Magic secateurs", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  161. WEAPON_105("Mega-phonus", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  162. WEAPON_106("Mindspike", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  163. WEAPON_107("Mud pie", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  164. WEAPON_108("Noose wand", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  165. WEAPON_109("Orb of oculus", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  166. WEAPON_110("Rat pole", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  167. WEAPON_111("Royal sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  168. WEAPON_112("Sagaie", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  169. WEAPON_113("Sceptre of the gods", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  170. WEAPON_114("Stone of power", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  171. WEAPON_115("Tambourine", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  172. WEAPON_116("Thok's sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  173. WEAPON_117("Toy kite", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  174. WEAPON_118("Trollweiss", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  175. WEAPON_119("Walking stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  176. WEAPON_120("Yaktwee stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  177. WEAPON_121("longsword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  178. WEAPON_122("2h sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  179. WEAPON_123("godsword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  180. WEAPON_124("dagger", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  181. WEAPON_125("sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  182. WEAPON_126("spear", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  183. WEAPON_127("pickaxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Crush","Stab"}),
  184. WEAPON_128("scimitar", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  185. WEAPON_129("battleaxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  186. WEAPON_130("hatchet", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
  187. WEAPON_131("halberd", new String [] {"Controlled","Aggressive","Defensive"}, new String [] {"Stab","Slash","Stab"}),
  188. WEAPON_132("warhammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  189. WEAPON_133("mace", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
  190. WEAPON_134("mjolnir", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  191. WEAPON_135("sickle", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  192. WEAPON_136("machete", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  193. WEAPON_137("rapier", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
  194. WEAPON_138("wand", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  195. //WEAPON_139("Golden scythe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Stab","Crush","Slash"}),
  196. WEAPON_140("Scythe", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  197. WEAPON_141("staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  198. WEAPON_142("trident", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
  199. WEAPON_143("bow", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  200. WEAPON_144("dart", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  201. WEAPON_145("knife", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  202. WEAPON_146("thrownaxe", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  203. WEAPON_147("javelin", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
  204. WEAPON_148("hasta", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  205. WEAPON_149("claws", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  206. WEAPON_150("croziers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
  207. WEAPON_151("flag", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
  208. WEAPON_152("ceremonial sword ", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
  209. WEAPON_153("cane", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"});
  210.  
  211.  
  212. private final String name;
  213. private final String [] styles;
  214. private final String [] types;
  215.  
  216. private Weapons(final String name, final String [] styles, final String [] types) {
  217. this.name = name;
  218. this.styles = styles.clone();
  219. this.types = types.clone();
  220. }
  221.  
  222. public static Weapons getWeapon(final String name) {
  223. for (final Weapons wep : Weapons.values()) {
  224. if (name.toLowerCase().contains(wep.getName().toLowerCase())) {
  225. return wep;
  226. }
  227. }
  228. return null;
  229. }
  230.  
  231. public String getName() {
  232. return name;
  233. }
  234.  
  235. public String[] getStyles() {
  236. return styles;
  237. }
  238. public String[] getTypes() {
  239. return types;
  240. }
  241. }
  242.  
  243. /**
  244. * Opens the Combat tab
  245. * @return boolean
  246. */
  247. public static boolean open() {
  248. if (isOpen()) {
  249. return true;
  250. } else {
  251. Game.openTab(Game.Tab.COMBAT);
  252. Timing.waitFor(1000, new Condition() {
  253. public boolean isMet() {
  254. return isOpen();
  255. }
  256. });
  257. return true;
  258. }
  259. }
  260. /**
  261. * Returns whether on not the combat tab is open.
  262. * @return boolean
  263. */
  264. public static boolean isOpen(){
  265. if (Game.getOpenTab() != null) {
  266. if (Game.getOpenTab().equals(Game.Tab.COMBAT)) {
  267. return true;
  268. }
  269. }
  270. return false;
  271. }
  272. /**
  273. * Returns the name of the currently equipped weapon.
  274. * @return String
  275. */
  276. public static String getEquipedWeapon(){
  277. if(!isOpen()){
  278. open();
  279. }
  280. String out = OCR.findString(null, new Rectangle(585,209,151,22), FontType.UP_CHARS);
  281. if(out.equals("")) out = OCR.findString(null, new Rectangle(585,209,151,22), FontType.STAT_CHARS);
  282. if(out.equals("olypore staff degraded"))out = "P" + out;
  283. return out;
  284.  
  285. }
  286. /**
  287. * Returns the player's combat level.
  288. * @return int
  289. */
  290. public static int getCombatLevel(){
  291. if(!isOpen()){
  292. open();
  293. }
  294. String out = OCR.findString(null, new Rectangle(682,220,30,26), FontType.UP_CHARS);
  295. if(out.equals("")) out = OCR.findString(null, new Rectangle(682,220,30,26), FontType.STAT_CHARS);
  296. return Integer.parseInt(out);
  297. }
  298. /**
  299. * Returns the styles of combat that the equipped weapon is capable of.
  300. * @return String []
  301. */
  302. public static String [] getCombatStyles(){
  303. if(!isOpen()){
  304. open();
  305. }
  306. return Weapons.getWeapon(getEquipedWeapon()).getStyles();
  307. }
  308. /**
  309. * Returns the types of attacks that the equipped weapon is capable of.
  310. * @return
  311. */
  312. public static String [] getCombatTypes(){
  313. if(!isOpen()){
  314. open();
  315. }
  316. return Weapons.getWeapon(getEquipedWeapon()).getTypes();
  317. }
  318. /**
  319. * Sets the attack style to that of the given value.
  320. * @param Style
  321. */
  322. public static void setStyle(Style st){
  323. if(!isOpen()){
  324. open();
  325. }
  326. String[] style = Weapons.getWeapon(getEquipedWeapon()).getStyles();
  327. boolean hasIt = false;
  328. int i = 0;
  329. for(; i < style.length; i++){
  330. if(style [i].equals(st.getname())){
  331. hasIt = true;
  332. break;
  333. }
  334. }
  335. if(hasIt){
  336. switch (i) {
  337. case 0: Mouse.click(Random.random(574,628),Random.random(255,290));
  338. break;
  339. case 1: Mouse.click(Random.random(656,714),Random.random(255,290));
  340. break;
  341. case 2: Mouse.click(Random.random(574,628),Random.random(308,340));
  342. break;
  343. case 3: Mouse.click(Random.random(656,714),Random.random(308,340));
  344. break;
  345. }
  346. }
  347. }
  348. /**
  349. * Sets the attack type to that of the given value.
  350. * @param Type
  351. */
  352. public static void setType(Type tp){
  353. if(!isOpen()){
  354. open();
  355. }
  356. String[] type = Weapons.getWeapon(getEquipedWeapon()).getTypes();
  357. boolean hasIt = false;
  358. int i = 0;
  359. for(; i < type.length; i++){
  360. if(type [i].equalsIgnoreCase(tp.getname())){
  361. hasIt = true;
  362. break;
  363. }
  364. }
  365. if(hasIt){
  366. switch (i) {
  367. case 0: Mouse.click(Random.random(574,628),Random.random(255,290));
  368. break;
  369. case 1: Mouse.click(Random.random(656,714),Random.random(255,290));
  370. break;
  371. case 2: Mouse.click(Random.random(574,628),Random.random(308,340));
  372. break;
  373. case 3: Mouse.click(Random.random(656,714),Random.random(308,340));
  374. break;
  375. }
  376. }
  377. }
  378.  
  379. /**
  380. * Gives the amount of special left.
  381. * @return int
  382. * - The amount of special attack energy remaining.
  383. * - Returns -1 if there is no special bar.
  384. */
  385. public static int getSpecial(){
  386. String outS = OCR.findString(new Rectangle(670,414,35,20), null);
  387. outS = outS.toUpperCase();
  388. outS = outS.replaceAll("O", "0");
  389. if(outS.equals("8")){
  390. int start = 589;
  391. for(int i = 0; i <= 9; i++){
  392. if(i == 2 || i == 5 || i== 7)start++;
  393. if(Game.getColorAt(start+i,417).equals(new Color(27,47,21)))outS = outS + i;
  394. }
  395. }
  396. if(outS.equals("2")){
  397. int start = 589;
  398. for(int i = 0; i <= 9; i++){
  399. if(i == 2 || i == 4 || i== 7 || i == 9)start++;
  400. if(Game.getColorAt(start+i,417).equals(new Color(27,47,21)))outS = outS + i;
  401. }
  402. }
  403. int out = 0;
  404. if(outS.equals(""))outS = "-1";
  405. try{
  406. out = Integer.parseInt(outS);
  407. }catch(NullPointerException e){
  408. out = -1;
  409. }
  410. return out;
  411. }
  412. /**
  413. * Turns the special attack on or off.
  414. * @param onOff
  415. * True - On.
  416. * False - Off.
  417. */
  418. public static void toggleSpecial(boolean onOff){
  419. if(onOff){
  420. if(!isSpecialOn()){
  421. Mouse.click(Random.random(575,710),Random.random(416,431));
  422. }
  423. }else{
  424. if(isSpecialOn()){
  425. Mouse.click(Random.random(575,710),Random.random(416,431));
  426. }
  427. }
  428. }
  429. /**
  430. * Returns whether or not the special is activated.
  431. * @return boolean
  432. */
  433. public static boolean isSpecialOn() {
  434. return !(Game.getColorAt(579,420).equals(new Color(213,217,211))
  435. || Game.getColorAt(584,420).equals(new Color(213,217,211))); }
  436.  
  437. /**
  438. * Returns whether or not auto retaliate is enabled.
  439. * @return boolean
  440. */
  441. public static boolean isAutoRetaliatOn(){
  442. return Game.getColorAt(683,387).equals(new Color(89,43,17));
  443. }
  444. /**
  445. * Turns auto retaliate on or off.
  446. * @param onOff
  447. * True - On.
  448. * False - Off.
  449. */
  450. public static void toggleAutoRetaliate(boolean onOff){
  451. if(onOff){
  452. if(!isAutoRetaliatOn()){
  453. Mouse.click(Random.random(580,710),Random.random(362,395));
  454. }
  455. }else{
  456. if(isAutoRetaliatOn()){
  457. Mouse.click(Random.random(580,710),Random.random(362,395));
  458. }
  459. }
  460. }
  461. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement