Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.runedream.api.methods;
- import java.awt.Color;
- import java.awt.Rectangle;
- import java.lang.Integer;
- import org.runedream.api.methods.OCR.FontType;
- import org.runedream.api.methods.Timing.Condition;
- import org.runedream.api.util.Random;
- /**
- * Combat class for interactions with the combat tab.
- * @author TheBat
- *
- */
- public class Combat {
- public enum Style{
- ACCURATE("Accurate"),
- AGGRESSIVE("Aggressive"),
- CONTROLLED("Controlled"),
- DEFENSIVE("Defensive"),
- RAPID("Rapid"),
- LONGRANGED("Longranged");
- private final String name;
- private Style(final String name) {
- this.name = name;
- }
- private String getname() {
- return name;
- }
- }
- public enum Type{
- SLASH("Slash"),
- STAB("Stab"),
- CRUSH("Crush"),
- DEFENSIVE("Defensive"),
- RANGED("Ranged"),
- DEFENSIVE_RANGED("Defensive Ranged"),
- MAGIC("Magic"),
- DEFENSIVE_MAGIC("Defensive Magic");
- private final String name;
- private Type(final String name) {
- this.name = name;
- }
- private String getname() {
- return name;
- }
- }
- private enum Weapons {
- WEAPON_0("Unarmed", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_1("chinchompa", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_2("Anger sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_3("Bluerite sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_4("Darklight", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_5("Excalibur", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_6("Korasai's sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_7("Fremennik blade", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_8("Silverlight", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_9("Keris", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_10("TokTz-Xil-Ek", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_11("Toktz-xil-ak", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_12("Inferno adze", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_13("Dwarven army axe", new String [] {"Controlled","Controlled","Controlled"}, new String [] {"Slash","Stab","Crush"}),
- WEAPON_14("Abyssal whip", new String [] {"Accurate","Controlled","Defensive"}, new String [] {"Slash","Slash","Slash"}),
- WEAPON_15("Saradomin sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_16("Shadow sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_17("Granite maul", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_18("Tzhaar-ket-om", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_19("Barrelchest anchor", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
- WEAPON_20("Gadderhammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_21("Golden hammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_22("Chaotic maul", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_23("Tzhaar-ket-em", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_24("Verac's flail", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
- WEAPON_25("Torag's hammers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_26("Brine sabre", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_27("Brackish blade", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_28("Dharok's greataxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_29("Wolfbane", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_30("Lucky cutlass", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_31("Harry's cutlass", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_32("Ivandis flail", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Slash","Crush","Slash"}),
- WEAPON_33("Holy water", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_34("Balmung", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_35("Blisterwood polearm", new String [] {"Controlled","Aggressive","Defensive"}, new String [] {"Stab","Slash","Stab"}),
- WEAPON_36("Rod of ivandis", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_37("blackjack", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_38("Flowers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_39("Rubber chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_40("Undead chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_41("Bouquet", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_42("Easter carrot", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_43("Mouse Toy", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_44("Flagstaff of festivities", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_45("Ornate katana", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_46("Candy cane", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Stab","Slash"}),
- WEAPON_47("Lily of the Valley", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_48("Magnifying glass", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_49("Snowball", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_50("Wooden spoon", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_51("Egg whisk", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_52("Spork", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_53("Spatula", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_54("Frying pan", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_55("Skewer", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_56("Rolling pin", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_57("Kitchen knife", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_58("Meat tenderiser", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_59("Cleaver", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_60("Skull sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_61("Staff of light", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_62("Armadyl battlestaff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_63("Ahrim's staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_64("Zuriels's staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_65("Toktz-mej-tal", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_66("Pharaoh's sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_67("Void knight mace", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_68("olypore staff", new String [] {"Accurate","Longranged"}, new String [] {"Magic", "Defensive Magic"}),
- WEAPON_69("Polypore stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_70("Chaotic staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_71("sling", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_72("Hand cannon", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_73("bolas", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_74("Toktz-xil-ul", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_75("salamander", new String [] {"Aggressive","Accurate","Defensive"}, new String [] {"Slash","Ranged","Magic"}),
- WEAPON_76("Swamp lizard", new String [] {"Aggressive","Accurate","Defensive"}, new String [] {"Slash","Ranged","Magic"}),
- WEAPON_77("harpoon", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_78("cattle prod", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_79("seercull", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_80("Giant's hand", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_81("butterfly net", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_82("Fixed device", new String [] {"Other","Aggressive"}, new String [] {"Other","Crush"}),
- WEAPON_83("Abyssal vine whip", new String [] {"Accurate","Controlled","Defensive"}, new String [] {"Slash","Slash","Slash"}),
- WEAPON_84("Blisterwood stake", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_85("bone club", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_86("Boxing gloves", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_87("Broomstick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_88("Bubble maker", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_89("Burning log", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_90("throwing axe", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_91("chicken", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_92("fox", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_93("grain", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_94("vexillum", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_95("decorative sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_96("dominion sword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_97("Eek", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_98("Falconer's glove", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_99("Gnomeball", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_100("locator", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_101("greegree", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_102("Icefiend net", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_103("Keenblade", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_104("Magic secateurs", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_105("Mega-phonus", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_106("Mindspike", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_107("Mud pie", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_108("Noose wand", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_109("Orb of oculus", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_110("Rat pole", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_111("Royal sceptre", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_112("Sagaie", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_113("Sceptre of the gods", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_114("Stone of power", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_115("Tambourine", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_116("Thok's sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_117("Toy kite", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_118("Trollweiss", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_119("Walking stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_120("Yaktwee stick", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_121("longsword", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_122("2h sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_123("godsword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_124("dagger", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_125("sword", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_126("spear", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_127("pickaxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Crush","Stab"}),
- WEAPON_128("scimitar", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_129("battleaxe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_130("hatchet", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Slash","Crush","Slash"}),
- WEAPON_131("halberd", new String [] {"Controlled","Aggressive","Defensive"}, new String [] {"Stab","Slash","Stab"}),
- WEAPON_132("warhammer", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_133("mace", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Crush","Crush","Stab","Crush"}),
- WEAPON_134("mjolnir", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_135("sickle", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_136("machete", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_137("rapier", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Stab","Stab","Slash","Stab"}),
- WEAPON_138("wand", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- //WEAPON_139("Golden scythe", new String [] {"Accurate","Aggressive","Aggressive","Defensive"}, new String [] {"Slash","Stab","Crush","Slash"}),
- WEAPON_140("Scythe", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_141("staff", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_142("trident", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Stab","Slash","Crush"}),
- WEAPON_143("bow", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_144("dart", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_145("knife", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_146("thrownaxe", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_147("javelin", new String [] {"Accurate","Rapid","Longranged"}, new String [] {"Ranged","Ranged","Defensive Ranged"}),
- WEAPON_148("hasta", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_149("claws", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_150("croziers", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"}),
- WEAPON_151("flag", new String [] {"Controlled","Controlled","Controlled","Defensive"}, new String [] {"Stab","Slash","Crush","Stab"}),
- WEAPON_152("ceremonial sword ", new String [] {"Accurate","Aggressive","Controlled","Defensive"}, new String [] {"Slash","Slash","Stab","Slash"}),
- WEAPON_153("cane", new String [] {"Accurate","Aggressive","Defensive"}, new String [] {"Crush","Crush","Crush"});
- private final String name;
- private final String [] styles;
- private final String [] types;
- private Weapons(final String name, final String [] styles, final String [] types) {
- this.name = name;
- this.styles = styles.clone();
- this.types = types.clone();
- }
- public static Weapons getWeapon(final String name) {
- for (final Weapons wep : Weapons.values()) {
- if (name.toLowerCase().contains(wep.getName().toLowerCase())) {
- return wep;
- }
- }
- return null;
- }
- public String getName() {
- return name;
- }
- public String[] getStyles() {
- return styles;
- }
- public String[] getTypes() {
- return types;
- }
- }
- /**
- * Opens the Combat tab
- * @return boolean
- */
- public static boolean open() {
- if (isOpen()) {
- return true;
- } else {
- Game.openTab(Game.Tab.COMBAT);
- Timing.waitFor(1000, new Condition() {
- public boolean isMet() {
- return isOpen();
- }
- });
- return true;
- }
- }
- /**
- * Returns whether on not the combat tab is open.
- * @return boolean
- */
- public static boolean isOpen(){
- if (Game.getOpenTab() != null) {
- if (Game.getOpenTab().equals(Game.Tab.COMBAT)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Returns the name of the currently equipped weapon.
- * @return String
- */
- public static String getEquipedWeapon(){
- if(!isOpen()){
- open();
- }
- String out = OCR.findString(null, new Rectangle(585,209,151,22), FontType.UP_CHARS);
- if(out.equals("")) out = OCR.findString(null, new Rectangle(585,209,151,22), FontType.STAT_CHARS);
- if(out.equals("olypore staff degraded"))out = "P" + out;
- return out;
- }
- /**
- * Returns the player's combat level.
- * @return int
- */
- public static int getCombatLevel(){
- if(!isOpen()){
- open();
- }
- String out = OCR.findString(null, new Rectangle(682,220,30,26), FontType.UP_CHARS);
- if(out.equals("")) out = OCR.findString(null, new Rectangle(682,220,30,26), FontType.STAT_CHARS);
- return Integer.parseInt(out);
- }
- /**
- * Returns the styles of combat that the equipped weapon is capable of.
- * @return String []
- */
- public static String [] getCombatStyles(){
- if(!isOpen()){
- open();
- }
- return Weapons.getWeapon(getEquipedWeapon()).getStyles();
- }
- /**
- * Returns the types of attacks that the equipped weapon is capable of.
- * @return
- */
- public static String [] getCombatTypes(){
- if(!isOpen()){
- open();
- }
- return Weapons.getWeapon(getEquipedWeapon()).getTypes();
- }
- /**
- * Sets the attack style to that of the given value.
- * @param Style
- */
- public static void setStyle(Style st){
- if(!isOpen()){
- open();
- }
- String[] style = Weapons.getWeapon(getEquipedWeapon()).getStyles();
- boolean hasIt = false;
- int i = 0;
- for(; i < style.length; i++){
- if(style [i].equals(st.getname())){
- hasIt = true;
- break;
- }
- }
- if(hasIt){
- switch (i) {
- case 0: Mouse.click(Random.random(574,628),Random.random(255,290));
- break;
- case 1: Mouse.click(Random.random(656,714),Random.random(255,290));
- break;
- case 2: Mouse.click(Random.random(574,628),Random.random(308,340));
- break;
- case 3: Mouse.click(Random.random(656,714),Random.random(308,340));
- break;
- }
- }
- }
- /**
- * Sets the attack type to that of the given value.
- * @param Type
- */
- public static void setType(Type tp){
- if(!isOpen()){
- open();
- }
- String[] type = Weapons.getWeapon(getEquipedWeapon()).getTypes();
- boolean hasIt = false;
- int i = 0;
- for(; i < type.length; i++){
- if(type [i].equalsIgnoreCase(tp.getname())){
- hasIt = true;
- break;
- }
- }
- if(hasIt){
- switch (i) {
- case 0: Mouse.click(Random.random(574,628),Random.random(255,290));
- break;
- case 1: Mouse.click(Random.random(656,714),Random.random(255,290));
- break;
- case 2: Mouse.click(Random.random(574,628),Random.random(308,340));
- break;
- case 3: Mouse.click(Random.random(656,714),Random.random(308,340));
- break;
- }
- }
- }
- /**
- * Gives the amount of special left.
- * @return int
- * - The amount of special attack energy remaining.
- * - Returns -1 if there is no special bar.
- */
- public static int getSpecial(){
- String outS = OCR.findString(new Rectangle(670,414,35,20), null);
- outS = outS.toUpperCase();
- outS = outS.replaceAll("O", "0");
- if(outS.equals("8")){
- int start = 589;
- for(int i = 0; i <= 9; i++){
- if(i == 2 || i == 5 || i== 7)start++;
- if(Game.getColorAt(start+i,417).equals(new Color(27,47,21)))outS = outS + i;
- }
- }
- if(outS.equals("2")){
- int start = 589;
- for(int i = 0; i <= 9; i++){
- if(i == 2 || i == 4 || i== 7 || i == 9)start++;
- if(Game.getColorAt(start+i,417).equals(new Color(27,47,21)))outS = outS + i;
- }
- }
- int out = 0;
- if(outS.equals(""))outS = "-1";
- try{
- out = Integer.parseInt(outS);
- }catch(NullPointerException e){
- out = -1;
- }
- return out;
- }
- /**
- * Turns the special attack on or off.
- * @param onOff
- * True - On.
- * False - Off.
- */
- public static void toggleSpecial(boolean onOff){
- if(onOff){
- if(!isSpecialOn()){
- Mouse.click(Random.random(575,710),Random.random(416,431));
- }
- }else{
- if(isSpecialOn()){
- Mouse.click(Random.random(575,710),Random.random(416,431));
- }
- }
- }
- /**
- * Returns whether or not the special is activated.
- * @return boolean
- */
- public static boolean isSpecialOn() {
- return !(Game.getColorAt(579,420).equals(new Color(213,217,211))
- || Game.getColorAt(584,420).equals(new Color(213,217,211))); }
- /**
- * Returns whether or not auto retaliate is enabled.
- * @return boolean
- */
- public static boolean isAutoRetaliatOn(){
- return Game.getColorAt(683,387).equals(new Color(89,43,17));
- }
- /**
- * Turns auto retaliate on or off.
- * @param onOff
- * True - On.
- * False - Off.
- */
- public static void toggleAutoRetaliate(boolean onOff){
- if(onOff){
- if(!isAutoRetaliatOn()){
- Mouse.click(Random.random(580,710),Random.random(362,395));
- }
- }else{
- if(isAutoRetaliatOn()){
- Mouse.click(Random.random(580,710),Random.random(362,395));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement