import com.speljohan.rsbot.script.*; import com.speljohan.rsbot.script.wrappers.*; import com.speljohan.rsbot.bot.Bot; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.Map; import com.speljohan.rsbot.script.Script; import com.speljohan.rsbot.event.listeners.PaintListener; import com.speljohan.rsbot.plugin.NonPluginClass;//implemented import rsbot.bash.Compiler; import java.awt.event.*; import javax.swing.*; import java.awt.Graphics; import java.io.IOException; import java.lang.reflect.Method; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import java.net.*;//for page Read import java.io.*;//File write import com.speljohan.rsbot.accessors.NPC; public class Stronghold extends Script implements PaintListener,ActionListener { JFrame frame5 = new JFrame("Script Auto Updater by Nader"); Compiler C = new Compiler(); File F = new File("Scripts//"); public javax.swing.JLabel jLabel1; public javax.swing.JScrollPane jScrollPane1; public javax.swing.JTextArea jTextArea1; public double version = 2.2; private final int MINOTAUR27_ID = 4406; private final int MINOTAUR12_ID = 4404; private final int GOBLIN5_ID = 4407; private final int GOBLIN11_ID = 4409; private final int GOBLIN13_ID = 4408; private final int GOBLIN161_ID = 4412; private final int GOBLIN162_ID = 4410; private final int[] GOBLIN16_ID =new int[] { 4412, 4410}; private final int GOBLIN25_ID = 4411; private final int[] GOBLIN5to13_ID = new int[] { 4408, 4407, 4409}; private final int[] GOBLIN16to25_ID = new int[] { 4412, 4411}; private final int[] MINO12andWOLF_ID = new int[] { 4413, 4404}; private final int[] ALL_ID = new int[] { 4414, 4413, 4408, 4412, 4411, 4410, 4407, 4409, 4404, 4406}; private final int WOLF1_ID = 4413; private final int WOLF2_ID = 4414; private final int[] WOLF_ID = new int[] { 4413, 4414}; private final int GRAT1_ID = 4395; private final int GRAT2_ID = 4944; private final int ZOMBIE31_ID = 4392; private final int ZOMBIE32_ID = 5375; private final int ZOMBIE33_ID = 5376; private final int ZOMBIE44_ID = 4393; private final int FLESH28_ID = 4389; private final int FLESH35_ID = 4390; private final int GSPIDER_ID = 4400; private final int SPIDER_ID = 4401; private final int MINOTAUR27_HP = 22; private final int MINOTAUR12_HP = 10; private final int GOBLIN5_HP = 5; private final int GOBLIN11_HP = 7; private final int GOBLIN13_HP = 17; private final int GOBLIN16_HP = 22; private final int GOBLIN25_HP = 26; private final int WOLF1_HP = 16; private final int WOLF2_HP = 10; private final int GRAT_HP = 25; private final int ZOMBIE_HP = 30; private final int ZOMBIE44_HP = 40; private final int FLESH28_HP = 35; private final int FLESH35_HP = 25; private final int GSPIDER_HP = 50; private final int SPIDER_HP = 22; public int[] monsterIDS = new int[] {MINOTAUR27_ID, MINOTAUR12_ID, GOBLIN5_ID, GOBLIN11_ID , GOBLIN13_ID, GOBLIN161_ID, GOBLIN162_ID, GOBLIN25_ID, WOLF1_ID, WOLF2_ID, GRAT1_ID,GRAT2_ID,ZOMBIE31_ID, ZOMBIE32_ID, ZOMBIE33_ID,ZOMBIE44_ID, FLESH28_ID,FLESH35_ID, GSPIDER_ID, SPIDER_ID }; public int[] monsterHPS = new int[] {MINOTAUR27_HP, MINOTAUR12_HP, GOBLIN5_HP, GOBLIN11_HP , GOBLIN13_HP, GOBLIN16_HP, GOBLIN16_HP, GOBLIN25_HP, WOLF1_HP, WOLF2_HP, GRAT_HP,GRAT_HP,ZOMBIE_HP,ZOMBIE_HP,ZOMBIE_HP,ZOMBIE44_HP,FLESH28_HP,FLESH35_HP, GSPIDER_HP, SPIDER_HP }; public int MONSTER_ID[] = {0,0,0,0,0,0}; public final int[] FOOD_ID = { 1895,1893,1891, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229 }; //Has almost every food cookable in runescape, members and non! public final int[] FOOD_HEAL = { 4,4,4,3, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 10, 8, 10, 10, 15, 14, 3, 1, 3, 3, 1, 18, 5, 6, 7, 7, 8, 9, 8, 10, 11, 9, 12, 13, 14, 16, 20, 21, 22, 6, 7, 8, 5, 5, 5, 6, 6, 7, 7, 6, 6, 6, 6, 8, 8, 11, 11, 11, 11, 11, 19, 7, 7, 8, 8, 9, 9, 11, 11, 4, 4, 4, 5, 5, 5, 2, 5, 5, 8, 5, 5, 11, 13, 1, 4, 14, 14, 16, 16, 22, 1, 2, 11, 11, 3, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 8, 7, 8, 7, 5, 5, 5, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 5, 5, 5, 5, 12, 12, 7, 7, 15, 15, 15, }; private final int[] ARROWS_ID = new int[] { 638, 640, 882, 884, 886, 888, 863}; public final int[] CHARMS_ID = new int[] { 12158, 12159, 12160, 12163 }; public final int[] HERBS_ID = new int[] { 207, 213 }; public final int[] RUNES_ID = new int[] { 554, 561, 4696 }; public final int[] STACKABLES_ID = new int[] {}; public final int[] UNSTACKABLES_ID = new int[] {}; public final int[] rubbish = new int[] {}; private int health = 10; private int anti = 0; private int check = 0; private int run = 0; private int monsterHealth = 22; public int startHealthXP = 99999999; public int state = 1; public int refill = 0; public int BANKFOOD_ID = 0; public String BANKFOOD = "food"; public int BANK = 0; public int DIE = 0; public int cave = 10; public int arrows = 0; public int charms = 0; public int herbs = 0; public int runes = 0; public int equipedarrows = 0; public boolean pot = false; public boolean bones = false; public boolean bury = false; public RSTile oldPosition = new RSTile(0,0); public int standingCount = 0; public boolean logout = false; public int[] caves = {2,3,5,8,10,16,17,18,25,28,35}; public final int ENTRANCE_ID = 16154; private final int[] DOOR = new int[]{16124, 16123, 16065, 16066,16089,16090}; public static final int[] bankWindows = new int[] { 11758, 11402 }; public static final int[] ladders = new int[] { 16148 }; public int DEFENCE = 1; public int ATTACK = 0; public int STRENGTH = 2; public int RANGE = 4; public int style = 0; public String style2 = "Attack"; public String Text; public int selectStyle = 0; public boolean quickAttack = true; public int checkCount = 0; public int startLevel = 0; public int startXP = 0; public long startTime = System.currentTimeMillis(); public long time = System.currentTimeMillis(); private final RSTile[] GATE1A = {new RSTile(1858, 5238), new RSTile(1859, 5238) } ; private final RSTile[] GATE1B = {new RSTile(1858, 5235), new RSTile(1859, 5235) } ; private final RSTile[] GATE2A = {new RSTile(1865, 5227), new RSTile(1865, 5226) } ; private final RSTile[] GATE2B = {new RSTile(1868, 5227), new RSTile(1868, 5226) } ; private final RSTile[] GATE3A = {new RSTile(1867, 5218), new RSTile(1867, 5217) } ; private final RSTile[] GATE3B = {new RSTile(1870, 5218), new RSTile(1870, 5217) } ; private final RSTile[] GATE4A = {new RSTile(1865, 5227), new RSTile(1865, 5226) } ; private final RSTile[] GATE4B = {new RSTile(1868, 5227), new RSTile(1868, 5226) } ; private final RSTile[] GATE5A = {new RSTile(1876, 5240), new RSTile(1876, 5239) } ; private final RSTile[] GATE5B = {new RSTile(1879, 5240), new RSTile(1879, 5239) } ; private final RSTile[] GATE6A = {new RSTile(1878, 5223), new RSTile(1879, 5223) } ; private final RSTile[] GATE6B = {new RSTile(1878, 5226), new RSTile(1879, 5226) } ; private final RSTile[] GATE7A = {new RSTile(1874, 5207), new RSTile(1875, 5207) } ; private final RSTile[] GATE7B = {new RSTile(1874, 5204), new RSTile(1875, 5204) } ; private final RSTile[] GATE8A = {new RSTile(1876, 5240), new RSTile(1876, 5239) } ; private final RSTile[] GATE8B = {new RSTile(1879, 5240), new RSTile(1879, 5239) } ; private final RSTile[] GATE9A = {new RSTile(1884, 5244), new RSTile(1884, 5243) } ; private final RSTile[] GATE9B = {new RSTile(1887, 5244), new RSTile(1887, 5243) } ; private final RSTile[] GATE10A = {new RSTile(1886, 5236), new RSTile(1886, 5235) } ; private final RSTile[] GATE10B = {new RSTile(1889, 5236), new RSTile(1889, 5235) } ; private final RSTile[] GATE19A = {new RSTile(2039, 5245), new RSTile(2039, 5246) } ; private final RSTile[] GATE19B = {new RSTile(2037, 5245), new RSTile(2037, 5246) } ; private final RSTile[] GATE20A = {new RSTile(2044, 5239), new RSTile(2045, 5239) } ; private final RSTile[] GATE20B = {new RSTile(2044, 5237), new RSTile(2045, 5237) } ; private final RSTile[] GATE23A = {new RSTile(2037, 5203), new RSTile(2036, 5203) } ; private final RSTile[] GATE23B = {new RSTile(2037, 5201), new RSTile(2036, 5201) } ; private final RSTile[] GATE26A = {new RSTile(2045, 5197), new RSTile(2046, 5197) } ; private final RSTile[] GATE26B = {new RSTile(2045, 5195), new RSTile(2046, 5195) } ; private final RSTile[] GATE30A = {new RSTile(2016,5227), new RSTile(2016,5228) } ; private final RSTile[] GATE30B = {new RSTile(2018,5227), new RSTile(2018,5228) } ; private final RSTile[] GATE34A = {new RSTile(2005, 5237), new RSTile(2006, 5237) } ; private final RSTile[] GATE34B = {new RSTile(2005, 5235), new RSTile(2006, 5235) } ; private final RSTile[] GATE38A = {new RSTile(2133, 5257), new RSTile(2132, 5257) } ; private final RSTile[] GATE38B = {new RSTile(2133, 5260), new RSTile(2132, 5260) } ; private final RSTile[] GATE40A = {new RSTile(2133, 5278), new RSTile(2132, 5278) } ; private final RSTile[] GATE40B = {new RSTile(2133, 5281), new RSTile(2132, 5281) } ; private final RSTile[] GATE43A = {new RSTile(2138, 5294), new RSTile(2138, 5295) } ; private final RSTile[] GATE43B = {new RSTile(2141, 5294), new RSTile(2141, 5295) } ; private final RSTile[] GATE44A = {new RSTile(2149, 5299), new RSTile(2148, 5299) } ; private final RSTile[] GATE44B = {new RSTile(2149, 5302), new RSTile(2148, 5302) } ; private int[] portals = {16150,16082}; private final RSTile[] strongholdTObank = { new RSTile (3081, 3421), new RSTile (3095, 3419), new RSTile (3108, 3420), new RSTile (3122, 3415), new RSTile (3134, 3416), new RSTile (3146, 3416), new RSTile (3158, 3419), new RSTile (3169, 3427), new RSTile (3180, 3428), new RSTile (3187, 3437) }; public final RSTilePath toBankPath = new RSTilePath(strongholdTObank, this); private final RSTile[] DeathWalk = { new RSTile (3222, 3220), new RSTile (3235, 3221), new RSTile (3246, 3226), new RSTile (3257, 3232), new RSTile (3258, 3246), new RSTile (3252, 3257), new RSTile (3248, 3269), new RSTile (3241, 3280), new RSTile (3239, 3292), new RSTile (3239, 3304), new RSTile (3239, 3316), new RSTile (3250, 3321), new RSTile (3263, 3324), new RSTile (3253, 3331), new RSTile (3241, 3335), new RSTile (3229, 3337), new RSTile (3226, 3350), new RSTile (3216, 3358), new RSTile (3203, 3361), new RSTile (3196, 3371), new RSTile (3185, 3377), new RSTile (3173, 3385), new RSTile (3168, 3397), new RSTile (3161, 3407), new RSTile (3151, 3415), new RSTile (3138, 3416), new RSTile (3126, 3416), new RSTile (3113, 3419), new RSTile (3101, 3420), new RSTile (3089, 3420), new RSTile (3081, 3423) }; public final RSTilePath DeathPath = new RSTilePath(DeathWalk, this); public RSCharacter old; public int NPCChange=0; public String getName() { return "Stronghold"; } public String getScriptCategory() { return "Combat"; } public String getAuthor() { return "Bug5532"; } public double getVersion() { return 2.20; } public boolean caveCheck(){ if(BANK==1){ for(int i=0;i args) { try{ ShowUpdaterGui(); CheckAndUpdate(); }catch(Exception v){System.err.print(v);} startup(); for (int i=0; i<4; i++){ MONSTER_ID[i] = 0; } //BANKFOOD_ID = Integer.parseInt(args.get("food")); if (!args.get("food").equals("")){ BANKFOOD = args.get("food"); } if (!args.get("cave").equals("")){ cave = Integer.parseInt(args.get("cave")); } if (args.get("des").equals("paint")){ gui = false; } if (args.get("style").equals("attack")){ style2 = "Attack"; style = ATTACK; } if (args.get("style").equals("defence")) { style2 = "Defence"; style = DEFENCE; } if (args.get("style").equals("strength")) { style2 = "Strength"; style = STRENGTH; } if (args.get("style").equals("range")) { style2 = "Range"; style = RANGE; } if (args.get("bones") != null) bones = true; if (args.get("burybones") != null) bury = true; if (args.get("potion") != null) pot = true; if (args.get("special") != null) sOn = true; if (args.get("bank") != null) BANK = 1; if (args.get("die") != null) DIE = 1; if (args.get("quickattack") == null) quickAttack=false; if (args.get("arrows") != null) arrows = 1; if (args.get("runes") != null) runes = 1; if (args.get("charms") != null) charms = 1; if (args.get("herbs") != null) herbs = 1; if (!caveCheck()){ log("Banking does not work in cave "+cave+". Please read the forum and try again."); log("Do not post this in the forum, or I will ban you ;) ."); return false; } if (args.get("monster").equals("Goblins_Low_Lvl")) { MONSTER_ID = GOBLIN5to13_ID; monsterHealth = GOBLIN13_HP ; } if (args.get("monster").equals("Goblins_High_Lvl")) { MONSTER_ID = GOBLIN16to25_ID; monsterHealth = GOBLIN25_HP ; } if (args.get("monster").equals("Minotaur_Lvl_12_and_Wolf")) { MONSTER_ID = MINO12andWOLF_ID; monsterHealth = WOLF1_HP ; } if (args.get("monster").equals("All")) { MONSTER_ID = monsterIDS; monsterHealth = WOLF1_HP ; } if (args.get("monster").equals("Giant_Spiders")) { MONSTER_ID[0] = GSPIDER_ID; monsterHealth = GSPIDER_HP ; } if (args.get("monster").equals("Goblin_Lvl_5")) { MONSTER_ID[0] = GOBLIN5_ID; monsterHealth = GOBLIN5_HP ; } if (args.get("monster").equals("Goblin_Lvl_11")) { MONSTER_ID[0] = GOBLIN11_ID; monsterHealth = GOBLIN11_HP ; } if (args.get("monster").equals("Goblin_Lvl_13")) { MONSTER_ID[0] = GOBLIN13_ID; monsterHealth = GOBLIN13_HP ; } if (args.get("monster").equals("Goblin_Lvl_16")) { MONSTER_ID = GOBLIN16_ID; monsterHealth = GOBLIN16_HP ; } if (args.get("monster").equals("Goblin_Lvl_25")) { MONSTER_ID[0] = GOBLIN25_ID; monsterHealth = GOBLIN25_HP ; } if (args.get("monster").equals("Minotaur_Lvl_12")){ MONSTER_ID[0] = MINOTAUR12_ID; monsterHealth = MINOTAUR12_HP ; } if (args.get("monster").equals("Minotaur_Lvl_27")) { MONSTER_ID[0] = MINOTAUR27_ID; monsterHealth = MINOTAUR27_HP ; } if (args.get("monster").equals("Wolf")) { MONSTER_ID = WOLF_ID; monsterHealth = WOLF1_HP ; } log("Training: " + args.get("style")+ "." ); log("Fighting: " + args.get("monster")+ "." ); if(MONSTER_ID[1] == 0){ log("Monsters ID: " + MONSTER_ID + ". Monster Health: " + monsterHealth + "."); } //log("Food ID: "+BANKFOOD_ID+"."); //FOOD_ID[0] = BANKFOOD_ID; if (!args.get("food").equals("")){ log("Food: "+BANKFOOD+"."); } if (BANK==1) log("Banking is activated."); startLevel = 0; startTime = System.currentTimeMillis(); if (isLoggedIn()) { startLevel = skills.getCurrentSkillLevel(style); startXP = skills.getCurrentSkillExp(style); } Bot.getEventManager().addListener(PaintListener.class, this); if(gui)createAndShowGUI(); return true; } @Override public void onFinish() { Bot.getEventManager().removeListener(PaintListener.class, this); Thread1.run=false; } public void zeroLabels(){ for (int i=0; i 0 || hours > 0 || seconds > 0) && XPChange > 0) { XPperSec = ((float) XPChange)/(float)(seconds + (minutes*60) + (hours*60*60)); } float XPperMin = XPperSec*60; float XPperHour = XPperMin*60; float timeTillLvl = 9999; float secsTillLvl = (int) timeTillLvl; float minsTillLvl = (int) timeTillLvl; float hoursTillLvl = (int) timeTillLvl; if (XPperSec > 0) { secsTillLvl = skills.getXPToNextLevel(style)/XPperSec ; } if (XPperMin > 0) { minsTillLvl = skills.getXPToNextLevel(style)/XPperMin ; } if (XPperHour > 0) { hoursTillLvl = skills.getXPToNextLevel(style)/XPperHour ; } secsTillLvl -= (int) minsTillLvl*60; minsTillLvl -= (int) hoursTillLvl*60; if (minsTillLvl < 0) minsTillLvl = 0; if (gui){ labelUpdate[0].setText(""+getName()+" v"+getVersion()); labelUpdate[1].setText("Killed: " + MinoKills + " Monsters, " + MinoKillsTill + " till next level."); labelUpdate[2].setText("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds."); labelUpdate[3].setText("Current: " + skills.getCurrentSkillLevel(style) + " levels and " + skills.getCurrentSkillExp(style) + " exp."); labelUpdate[4].setText("Gained: " + LevelChange + " levels and " + XPChange + " exp."); labelUpdate[5].setText(skills.getXPToNextLevel(style) + " XP to level " + nextLvl + ", only " + perNextLvl + "% left to next level."); labelUpdate[6].setText((int)XPperHour + " exp per Hour."); labelUpdate[7].setText("Approximately " + (int)hoursTillLvl + " hours and " + (int)minsTillLvl + " minutes till next level!"); labelUpdate[8].setText(""); } if (!gui){ g.setColor(Color.red); g.drawRoundRect(Xbox, Ybox, 290 - 1, 110 - 1,20,20); g.setColor(new Color(255, 255, 255, 140)); //g.setColor(Color.white); g.fillRoundRect(Xbox + 1, Ybox + 1, 290 - 2, 110 - 2,20,20); g.setColor(Color.black); g.drawString("Killed: " + MinoKills + " Monsters, " + MinoKillsTill + " till next level." , Xprint, Yprint); g.drawString("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", Xprint, Yprint+15); g.drawString("Current: " + skills.getCurrentSkillLevel(style) + " levels and " + skills.getCurrentSkillExp(style) + " exp.", Xprint, Yprint+30); g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " exp.", Xprint, Yprint+45); g.drawString(skills.getXPToNextLevel(style) + " XP to level " + nextLvl + ", only " + perNextLvl + "% left to next level.", Xprint, Yprint+60); g.drawString((int)XPperHour + " exp per Hour." , Xprint, Yprint+75); g.drawString("Approximately " + (int)hoursTillLvl + " hours and " + (int)minsTillLvl + " minutes till next level!", Xprint, Yprint+90); // g.drawString("Int:"+(getMyPlayer().getInteracting() != null), Xprint,Yprint+105); } } } public void getNPCsID(){ int[] validNPCs = Bot.getClient().getNPCIndexArray(); NPC[] npcs = Bot.getClient().getNPCArray(); RSCharacter npcChar = getMyPlayer().getInteracting(); for (int element : validNPCs) { if (npcs[element] == null) continue; RSNPC npc = new RSNPC(npcs[element]); if(npc.equals(npcChar)) NPCID = npc.getID(); break; } } public void pickUpArrows() { for (int i = 0 ; i<10; i++) { RSItemTile arrow = getNearestGroundItemByID(10, ARROWS_ID); if (arrow != null) { log("Found Arrow " + (i+1) +"."); if(!isInventoryFull() || checkIfGroundItemIsInInventory(arrow,ARROWS_ID)){ if(atTile(arrow, "arrow")){ wait(random(200,500)); } } }else{ break; } } } public void equipArrows() { if (inventoryContains(equipedarrows)){ if (getInventoryItemByID(equipedarrows).getStackSize() > random(100,150)){ atInventoryItem(equipedarrows, "Wield"); } } } public int escape() { if (BANK == 1){ refill = 1; return random(100,200); } RSPlayer myPlayer = getMyPlayer(); if (myPlayer.getAnimation() == 4282 || myPlayer.getAnimation() == 4283) { beep(); return -1; } RSObject door = findObject(DOOR); if (door != null){ atObject(door, "Open"); }else{ beep(); return -1; } if (myPlayer.getAnimation() == 4282 || myPlayer.getAnimation() == 4283) { beep(); return -1; } return random(100,200); } public boolean atNPC2(RSNPC npc, String action) { if (npc == null) return false; RSTile tile = npc.getLocation(); if (!tile.isValid()) return false; if (distanceTo(tile) > 4) { walkTileMM(tile); wait(random(500,1000)); } return clickCharacter2(npc, action); } public boolean clickCharacter2(RSCharacter c, String action) { Point screenLoc = null; for (int i = 0; i < 20; i++) { screenLoc = c.getScreenLocation(); if (!c.isValid() || !pointOnScreen(screenLoc)) { System.out.println("Not on screen " + action); return false; } if (getMouseLocation().equals(screenLoc)) break; moveMouse(screenLoc); } screenLoc = c.getScreenLocation(); if (!getMouseLocation().equals(screenLoc)|| getMyPlayer().getInteracting() != null) return false; if (getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) { clickMouse(screenLoc, true); return true; } else { clickMouse(screenLoc, false); return atMenu(action); } } public int[] equipedarray; public void getEquipedItems(){ equipedarray = getEquipmentArray(); log("Equipment checked"); } public void equipEquipedItems(){ for (int i = 0; i= 36 && anti <= 41 ){ if(random(0,1)==1) { myOpenTab(random(0,12)); }else{ openTab(random(0,12)); } } if (anti >= 42 && anti <= 52){ if(random(0,1)==1) myOpenTab(TAB_STATS); openTab(TAB_STATS); wait( random(250,700)); moveMouse(random(556,707),random(230,442)); wait( random(750,1500)); } if (anti >= 53 && anti <= 63){ if (!isRunning()){ setRun(true); }else { if(random(0,1)==1) myOpenTab(TAB_STATS); openTab(TAB_STATS); wait( random(350,800)); moveMouse(random(556,648),random(230,281)); wait( random(550,1300)); } } if (anti >= 64 && anti <= 90){ rotate(); } } public void rotate() { int button = random(37,40); Bot.getInputManager().pressKey((char) button); wait(random(500, 1500)); Bot.getInputManager().releaseKey((char) button); } public RSNPC getNextNPCByID(int... ids) { int Dist = 20; RSNPC closest = null; int[] validNPCs = Bot.getClient().getNPCIndexArray(); NPC[] npcs = Bot.getClient().getNPCArray(); for (int element : validNPCs) { if (npcs[element] == null) { continue; } RSNPC Monster = new RSNPC(npcs[element]); try { for (int id : ids) { if (id != Monster.getID()) { continue; } int distance = distanceTo(Monster); if (distance < Dist && (Monster.getInteracting() == null || Monster.getInteracting() == getMyPlayer() || Monster.getInteracting().getInteracting() != Monster) && !Monster.isInCombat()) { Dist = distance; closest = Monster; } } } catch (Exception e) {} } return closest; } public RSNPC getBusyNPCByID(int... ids) { int Dist = 20; RSNPC closest = null; int[] validNPCs = Bot.getClient().getNPCIndexArray(); NPC[] npcs = Bot.getClient().getNPCArray(); for (int element : validNPCs) { if (npcs[element] == null) { continue; } RSNPC Monster = new RSNPC(npcs[element]); try { for (int id : ids) { if (id != Monster.getID()) { continue; } int distance = distanceTo(Monster); if (distance < Dist && canReach(Monster,true)) { Dist = distance; closest = Monster; } } } catch (Exception e) {} } return closest; } public void styleSelecter() { for(int j=70; j<101 ; j++) { for(int i=27; i<37 ; i++) { if (RSInterface.getChildInterface(j, i).containsText(style2)) { openTab(TAB_ATTACK); wait(random(500,1000)); atInterface(j,i); log("Style Set, Training "+ style2); selectStyle = 1; } } } if (selectStyle == 0) { log("Setting Style Failed."); selectStyle = 1; } } public void changeMonsterHealth(RSNPC monster) { int id; id = monster.getID(); for (int i= 0 ; i < monsterIDS.length; i++ ) { if (id == monsterIDS[i] ){ monsterHealth = monsterHPS[i]; } } } public boolean playerInBox(int n,int s,int e,int w) { int x = getMyPlayer().getLocation().getX(); int y = getMyPlayer().getLocation().getY(); if (n >= y && s <= y && x <= e && x >= w){ return true; } return false; } public int whichCave() { int c= 0; if (canReach(getObjectAt(1865,5242), true)) c=1; if (canReach(getObjectAt(1863,5225), true)) c=2; if (canReach(getObjectAt(1870,5228), true)) c=3; if (canReach(getObjectAt(1872,5215), true)) c=5; if (canReach(getObjectAt(1881,5244), true)) c=6; if (canReach(getObjectAt(1886,5232), true)) c=7; if (canReach(getObjectAt(1873,5200), true)) c=8; if (canReach(getObjectAt(1901,5239), true)) c=10; if (canReach(getObjectAt(1908,5224), true)) c=14; if (canReach(getObjectAt(2043,5245), true)) c=15; if (canReach(getObjectAt(2025,5235), true)) c=16; if (canReach(getObjectAt(2037,5215), true)) c=17; if (canReach(getObjectAt(2043,5207), true)) c=171; if (canReach(getObjectAt(2043,5193), true)) c=18; if (canReach(getObjectAt(2022,5215), true)) c=26; if (canReach(getObjectAt(2005,5233), true)) c=22; if (canReach(getObjectAt(2005, 5240), true)) c=25; if (canReach(getObjectAt(2124,5258), true)) c=27; if (canReach(getObjectAt(2119,5273), true)) c=28; if (canReach(getObjectAt(2135,5288), true)) c=36; if (canReach(getObjectAt(2149,5296), true)) c=34; if (canReach(getObjectAt(2145,5307), true)) c=35; return c; } public static int max(int[] t) { int maximum = t[0]; // start with the first value for (int i=1; i maximum) { maximum = t[i]; // new maximum } } return maximum; }//end method max public static int min(int[] t) { int minimum = t[0]; // start with the first value for (int i=1; i0 && isInventoryFull()){ for (int i=0; i0) xp = 1; if ( Dy>0 ) yp = 1; int steps = random(9,11); int xsteps = steps *xp; int ysteps = steps *yp; //log("DistanceTo:"+distanceTo(t) + " Xsteps:" + xsteps + " Ysteps:" + ysteps + " Grad:"+grad); // log("grad:"+grad); if (distanceTo(t) > 15){ if(grad>5 || grad<-5){ //log("big"); doWalk(new RSTile( myX, myY+ysteps ) ); } if ((grad<=5 && grad > 3)||(grad>=-5 && grad < -3)) { //log("5-3"); doWalk(new RSTile( myX + xsteps/3, myY+ysteps ) ); } if ((grad<=3 && grad > 2)||(grad>=-3 && grad < -2)) { //log("3-2"); doWalk(new RSTile( myX + xsteps/2, myY+ysteps ) ); } if ((grad<=2 && grad > 0.5)||(grad>=-2 && grad < -0.5)) { //log("2-0.5"); doWalk(new RSTile( myX + xsteps, myY+ysteps ) ); } if (grad<=0.5 && grad >= -0.5) { // log("0"); doWalk(new RSTile( myX + xsteps, myY ) ); } /* if (grad <= 0){ if (grad < -1){ doWalk(new RSTile( myX+(xsteps), (int)(myY+(ysteps*grad)) ) ); } if (grad >= -1){ doWalk(new RSTile( (int)(myX+(xsteps/grad)), myY+(ysteps) ) ); } } if (grad > 0){ if (grad < 1){ doWalk(new RSTile( myX+(xsteps), (int)(myY+(ysteps*grad)) ) ); } if (grad >= 1){ doWalk(new RSTile( (int)(myX+(xsteps/grad)), myY+(ysteps) ) ); } }*/ wait(random(1000,2000)); return false; } if (distanceTo(t) <= 15 && distanceTo(t) > 3){ walkTileMM(t); wait(random(1000,2000)); return false; } return true; } public void goThroughGate(RSTile g[]) { RSObject gate = getObjectAt(g[random(0,1)]); if (gate != null){ if (distanceTo(gate.getLocation()) > 30) { travelTo(gate.getLocation()); wait(random(1500, 3000)); } if (distanceTo(gate.getLocation()) > 10) { walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 ) ); wait(random(1500, 3000)); } if (distanceTo(gate.getLocation()) > 3) { walkTileMM(gate.getLocation()); wait(random(1500, 3000)); } if (atObject(gate, "Open") == false) rotate(); wait(random(500,1000)); } else { log("There is no gate.....FAIL!"); } } public void stuckInGate(){ if (canReach(getObjectAt(2034, 5185), true)) { if(!atObject(getObjectAt(2036, 5185), "Open")) rotate(); } } public void goThroughPortal(int g) { RSObject gate = findObject(g); if (gate != null){ if (distanceTo(gate.getLocation()) > 10) { walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 ) ); wait(random(1500, 3000)); } if (distanceTo(gate.getLocation()) > 3) { walkTileMM(gate.getLocation()); wait(random(1500, 3000)); } atObject(gate, "Use"); wait(random(500,1000)); } else { log("There is no portal.....FAIL!"); } } public void goDownLadder(int g) { RSObject gate = findObject(g); if (gate != null){ if (distanceTo(gate.getLocation()) > 10) { walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 ) ); wait(random(1500, 3000)); } if (distanceTo(gate.getLocation()) > 3) { walkTileMM(gate.getLocation()); wait(random(1500, 3000)); } atObject(gate, "Climb-down"); wait(random(1500,2000)); atInterface(579,17); wait(random(1000,1500)); } else { log("There is no ladder.....FAIL!"); } } public void goUpLadder(int g) { RSObject gate = findObject(g); if (gate != null){ if (distanceTo(gate.getLocation()) > 10) { walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 ) ); wait(random(1500, 3000)); } if (distanceTo(gate.getLocation()) > 3) { walkTileMM(gate.getLocation()); wait(random(1500, 3000)); } atObject(gate, "Climb-up"); wait(random(500,1000)); } else { log("There is no ladder.....FAIL!"); } } public void stateSelecter() { if (distanceTo(strongholdTObank[0]) <= 6 && (getInventoryCount(FOOD_ID) > 0 || DIE==1) ) { state = 2; } if (distanceTo(strongholdTObank[0]) <= 6 && getInventoryCount(FOOD_ID) == 0 && DIE==0 ) { state = 3; } if (distanceTo(strongholdTObank[strongholdTObank.length-1]) <= 10) { state = 4; } if (distanceTo(new RSTile (1887,5220)) < 1000) { if (refill == 0) state = 1; if (refill == 1) state = 5; } if (distanceTo(DeathWalk[0]) < 15){ state = 6; } //log("Cave = " + whichCave()); } public void standingStill() { //log("working????"); if ((oldPosition.getX() == getMyPlayer().getLocation().getX()) && (oldPosition.getY() == getMyPlayer().getLocation().getY()) ){ standingCount++; //log("ADDING TO COUNT!!!"); } if ( (oldPosition.getX() != getMyPlayer().getLocation().getX()) || (oldPosition.getY() != getMyPlayer().getLocation().getY()) ){ // log("old POS!!!"); oldPosition = new RSTile(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY() ) ; standingCount = 0; } if (getMyPlayer().getInteracting() != null){ // log("stand count 0!!!"); standingCount = 0; } if (standingCount > 5 && standingCount < 20) { log("I'm not doing anything... Probably stuck, SPIN AROUND!"); rotate(); } if (standingCount > 15) beep(); if (standingCount > 20) { log("I'm stuck, so will logout before the BANHAMMER."); log("Please post where you got stuck on the forums :)"); logout = true; } // log("X:"+oldPosition.getX() + " Y:" + oldPosition.getY() ); } public boolean dropAllRubbish() { outer: for (int item : getInventoryArray()) { for (int nodrop : rubbish) { if (item == nodrop) { continue outer; } } for (int i = 0; i < getInventoryCount(item); i++ ) { atInventoryItem(item, "Drop"); wait(random(500, 750)); } } return true; } public long sOld = 0; public int sRandom = 0; public int specialValue = 0; public boolean sOn = false; public void special() { if (sOn){ if (getSetting(301) == 0 && specialValue == 1){ specialValue = 1000 - getSetting(300); } if (getSetting(300) >= specialValue){ if (getSetting(301) == 0){ if (specialValue == 0 && getSetting(300) == 1000){ specialValue = 1; myOpenTab(TAB_ATTACK); wait(random(1000,2000)); clickMouse(random(575,705),random(414,426), true); wait(random(1000,2000)); sRandom = 0; } if (sRandom == 0){ sOld = System.currentTimeMillis(); sRandom=random(3000,40000); } if (System.currentTimeMillis() > (sOld+sRandom) && specialValue > 1){ myOpenTab(TAB_ATTACK); wait(random(1000,2000)); clickMouse(random(575,705),random(414,426), true); wait(random(1000,2000)); sRandom = 0; } } } } } public void myOpenTab(int tab) { // Credit goes to nebule for this! if (tab == getCurrentTab()) { return; } switch(tab) { case TAB_ATTACK: input.holdKey((char) KeyEvent.VK_F1, random(300, 700)); break; case TAB_STATS: input.holdKey((char) KeyEvent.VK_F2, random(300, 700)); break; case TAB_QUESTS: input.holdKey((char) KeyEvent.VK_F3, random(300, 700)); break; case TAB_INVENTORY: input.holdKey((char) KeyEvent.VK_F4, random(300, 700)); break; case TAB_EQUIPMENT: input.holdKey((char) KeyEvent.VK_F5, random(300, 700)); break; case TAB_PRAYER: input.holdKey((char) KeyEvent.VK_F6, random(300, 700)); break; case TAB_MAGIC: input.holdKey((char) KeyEvent.VK_F7, random(300, 700)); break; case TAB_FRIENDS: input.holdKey((char) KeyEvent.VK_F8, random(300, 700)); break; default: openTab(tab); break; } } public long pOld = 0; public int pRandom = 0; public void potUp(){ // int[] strength = {119,117,115,113}; // int[] attack = {125,123,121,2428}; int[] combat = {9745,9743,9741,9739}; if (getInventoryCount(combat) > 0){ if (skills.getCurrentSkillLevel(STAT_STRENGTH) <= skills.getRealSkillLevel(STAT_STRENGTH) + 3){ if (pRandom == 0){ pOld = System.currentTimeMillis(); pRandom=random(10000,120000); } if (System.currentTimeMillis() > (pOld+pRandom)){ openTab(TAB_INVENTORY); wait(random(1000,2000)); for (int i = 0; i =2)break; wait(random(750,1500)); } } } } public boolean getAnswer(){ for(int i = 0; i < answers.length; i++) { for(int j = 2; j < 5; j++) { if (RSInterface.getChildInterface(230, j).containsText(answers[i])){ atInterface(230,j); return true; } else if (RSInterface.getChildInterface(228, j).containsText(answers[i])){ atInterface(228,j); return true; } } } return false; } public int loop() { try { checkCount++; getNPCsID(); if (canContinue()) clickContinue(); if (logout){ beep(); return -1; } gateOFwar(); stateSelecter(); standingStill(); if (isLoggedIn() && startLevel == 0) { startLevel = skills.getCurrentSkillLevel(style); startXP = skills.getCurrentSkillExp(style); } if (isLoggedIn() && selectStyle == 0 ){ wait(random(1000,2000)); styleSelecter(); getEquipedItems(); health = (random(skills.getLvlByExp(skills.getCurrentSkillExp(3))*3,skills.getLvlByExp(skills.getCurrentSkillExp(3))*7))/10; log("Eat when health is under "+ health +"."); if (getInventoryCount(FOOD_ID) == 0) { log("You have no food!"); log("If you do have food please post the ID's in the forum and I will add support for it!"); } if (arrows == 1) { equipedarrows = getEquipmentArray()[13]; if (equipedarrows == -1){ log("No arrows equiped, set to Steel!"); equipedarrows = 886; } } } RSPlayer myPlayer = getMyPlayer(); switch(state) { // Fight case 1: stuckInGate(); special(); if(pot) potUp(); if(bury)buryBones(); equipEquipedItems(); if (BANK == 1 || DIE == 1){ if (cave != whichCave()) { refill = 1; state = 5; return random(800, 1400); } //log("cave:" + cave); //log("actual cave:" + whichCave()); } if (random(0,50) == random(0,50)) { log("Food heals "+getFoodHeal()); health = (random(skills.getLvlByExp(skills.getCurrentSkillExp(3))*3,skills.getLvlByExp(skills.getCurrentSkillExp(3))*6))/10; } //if (skills.getCurrentSkillLevel(3) <= 100 ) { //log("test escape"); //return escape(); //} if (myPlayer.getInteracting() != null && !myPlayer.isMoving() ) { antiban(); } // Health if (skills.getCurrentSkillLevel(3) <= health && DIE == 0 ) { if (getInventoryCount(FOOD_ID) == 0) { log ("Time to stop, I have noooo food!"); return escape(); } for(int i = 0; i= 1) { log("Eating."); atInventoryItem(FOOD_ID[i], "Eat"); wait(2000,3000); return random(800, 1400); } } } /* if(!quickAttack){ if (old!=myPlayer.getInteracting() || NPCChange==0){ NPCChange++; old=myPlayer.getInteracting(); monsterHealth = 2000; } }*/ if(!quickAttack && ((myPlayer.getInteracting() == null && checkCount >=10)||checkCount >=25)){ log("Checking for Items."); if (runes == 1) grabRunes(); if (charms == 1)grabCharms(); if (herbs == 1)grabHerbs(); if (arrows == 1){ log("Picking up Arrows."); pickUpArrows(); equipArrows(); } if (bones) grabBones(); checkCount=0; } //log("check4?"); if (quickAttack) { if (skills.getCurrentSkillExp(3)*3 >= (monsterHealth*4+startHealthXP*3)-2) { log("Dead Monster!"); if (runes == 1) grabRunes(); if (charms == 1)grabCharms(); if (herbs == 1)grabHerbs(); // grabStackables(); // grabUnstackables(); if (arrows == 1){ log("Picking up Arrows."); pickUpArrows(); equipArrows(); } if (bones) grabBones(); RSNPC mino2 = getNextNPCByID(MONSTER_ID); startHealthXP = skills.getCurrentSkillExp(3); if (mino2 != null && canReach(mino2,true)) { log("QuickAttack!") ; startHealthXP = skills.getCurrentSkillExp(3); changeMonsterHealth(mino2); atNPC2(mino2,"Attack"); return random(500, 1000); } } } //log("check1?"); if ((myPlayer.getInteracting() == null && !myPlayer.isMoving())) { RSNPC mino = getNextNPCByID(MONSTER_ID); if (mino != null && canReach(mino,true)) { if (mino.isInCombat()) { return random(500,1500); } log("Attack!") ; startHealthXP = skills.getCurrentSkillExp(3); changeMonsterHealth(mino); atNPC2(mino,"Attack"); check=1; return random(500, 1000); } RSNPC monst = getBusyNPCByID(MONSTER_ID); if (monst != null){ log("All Monsters are in combat!"); return random(500, 1000); } if (check >= 11) { log("No monsters :( bye bye"); beep(); return -1; } log("Cant find any monsters. Check: "+ check); check++; } return random(1000, 3000); //Climb down ladder case 2: log("Going down hole..."); setRun(true); RSObject entrance = findObject(ENTRANCE_ID); if (entrance != null){ if (distanceTo(entrance.getLocation()) > 4) { walkTileMM(entrance.getLocation()); return random(500, 750); } atObject(entrance, "Climb-down"); return random(3000,4000); } else { log("Cant find Entrance.. FAIL"); beep(); return -1; } //Walk to Bank case 3: log("Walking to Bank."); setRun(true); //if (distanceTo(strongholdTObank[0]) <= 6){ //toBankPath.walkToEnd(); travelTo(strongholdTObank[strongholdTObank.length-1]); //} return random(500,1500); //At the bank case 4: if (pot){ if (getInventoryCount(FOOD_ID) < 20 || getInventoryCount(9741) <2 ) { log("Need to get some food"); RSObject bankWindow = findObject(bankWindows); if (distanceTo(bankWindow.getLocation()) > 5) { walkTileMM(bankWindow.getLocation()); return random(500, 750); } if (!RSInterface.getInterface(762).isValid()) { atObject(bankWindow, "Use-quickly"); return random(1500, 1750); } // int[] dontDeposit = FOOD_ID; // dontDeposit[0]=9741; bank.depositAllExcept(FOOD_ID); log("Withdrawing Food!"); //if (bank.getCount(BANKFOOD_ID) > 0){ if (getInventoryCount(FOOD_ID) < 20){ bank.searchItem(BANKFOOD); wait(random(700,1200)); clickMouse(random(40,70),random(95,120), false); wait(random(700,1200)); if (atMenu("X") == false){ log("Out of " + BANKFOOD +"."); beep(); return -1; } wait(random(2000,3000)); Bot.getInputManager().sendKeys("25", true); bank.searchItem(""); return random(1500, 1750); } if (getInventoryCount(9741) < 2){ bank.searchItem("combat potion"); wait(random(700,1200)); clickMouse(random(40,70),random(95,120), false); wait(random(700,1200)); atMenu("X"); wait(random(700,1200)); Bot.getInputManager().sendKeys("3", true); } bank.close(); // bank.withdraw(BANKFOOD_ID, random(21 , 27)); //}else{ // log("No food in bank.... FAIL"); // return -1; //} return random(3000,4500); } } if (getInventoryCount(FOOD_ID) < 20 && !pot) { log("Need to get some food"); RSObject bankWindow = findObject(bankWindows); if (distanceTo(bankWindow.getLocation()) > 5) { walkTileMM(bankWindow.getLocation()); return random(500, 750); } if (!RSInterface.getInterface(762).isValid()) { atObject(bankWindow, "Use-quickly"); return random(1500, 1750); } bank.depositAllExcept(FOOD_ID); log("Withdrawing Food!"); //if (bank.getCount(BANKFOOD_ID) > 0){ bank.searchItem(BANKFOOD); wait(random(700,1200)); clickMouse(random(40,70),random(95,120), false); wait(random(700,1200)); if (atMenu("All") == false){ log("Out of " + BANKFOOD +"."); beep(); return -1; } wait(random(700,1200)); bank.close(); // bank.withdraw(BANKFOOD_ID, random(21 , 27)); //}else{ // log("No food in bank.... FAIL"); // return -1; //} return random(3000,4500); } if (bank.getInterface().isValid()) { bank.close(); wait(random(300,500)); } setRun(true); toBankPath.walkToStart(); return random(500,1500); case 5: if (getInventoryCount(FOOD_ID) == 0 && DIE==0) { stuckInGate(); if (whichCave() == 1) { goUpLadder(ladders[0]); return random(1500,3000); } if (whichCave() == 7) { goUpLadder(16146); return random(1500,3000); } if (whichCave() == 14) { goUpLadder(16080); return random(1500,3000); } if (whichCave() == 15) { goUpLadder(16080); return random(1500,3000); } if (whichCave() == 171) { goUpLadder(16078); return random(1500,3000); } if (whichCave() == 27) { goUpLadder(16114); return random(1500,3000); } if (whichCave() == 35){ goThroughGate(GATE44B); return random(1000,1500); } if(betweenGates2(GATE44A,GATE44B)){ goThroughGate(GATE44A); return random(1000,1500); } if (whichCave() == 34){ goThroughGate(GATE43B); return random(1000,1500); } if(betweenGates2(GATE43A,GATE43B)){ goThroughGate(GATE43A); return random(1000,1500); } if (whichCave() == 36){ goThroughGate(GATE40B); return random(1000,1500); } if(betweenGates2(GATE40A,GATE40B)){ goThroughGate(GATE40A); return random(1000,1500); } if (whichCave() == 28){ goThroughGate(GATE38B); return random(1000,1500); } if(betweenGates2(GATE38A,GATE38B)){ goThroughGate(GATE38A); return random(1000,1500); } if (whichCave() == 25){ goThroughGate(GATE30A); return random(1000,1500); } if(betweenGates2(GATE30A,GATE30B)){ goThroughGate(GATE30B); return random(1000,1500); } if (whichCave() == 22){ goThroughGate(GATE34A); return random(1000,1500); } if(betweenGates2(GATE34A,GATE34B)){ goThroughGate(GATE34B); return random(1000,1500); } if (whichCave() == 18){ goThroughGate(GATE26B); return random(1000,1500); } if(betweenGates2(GATE26A,GATE26B)){ goThroughGate(GATE26A); return random(1000,1500); } if (whichCave() == 17){ goThroughGate(GATE23A); return random(1000,1500); } if(betweenGates2(GATE23A,GATE23B)){ goThroughGate(GATE23B); return random(1000,1500); } if (whichCave() == 16){ goThroughGate(GATE19B); return random(1000,1500); } if(betweenGates2(GATE19A,GATE19B)){ goThroughGate(GATE19A); return random(1000,1500); } if (whichCave() == 10){ goThroughGate(GATE10B); return random(1000,1500); } if(betweenGates2(GATE10A,GATE10B)){ goThroughGate(GATE10A); return random(1000,1500); } if (whichCave() == 8){ goThroughGate(GATE7B); return random(1000,1500); } if(betweenGates2(GATE7A,GATE7B)){ goThroughGate(GATE7A); return random(1000,1500); } if (whichCave() == 5){ goThroughGate(GATE6A); return random(1000,1500); } if(betweenGates2(GATE6A,GATE6B)){ goThroughGate(GATE6B); return random(1000,1500); } if (whichCave() == 3){ goThroughGate(GATE2B); return random(1000,1500); } if(betweenGates2(GATE2A,GATE2B)){ goThroughGate(GATE2A); return random(1000,1500); } if (whichCave() == 2){ goThroughGate(GATE1B); return random(1000,1500); } if(betweenGates2(GATE1A,GATE1B)){ goThroughGate(GATE1A); return random(1000,1500); } log("Not in escape Cave"); return random(1500,3000); }else{ if(whichCave() == cave) { refill = 0; state = 1; return random(100,500); } if (cave == 10 || cave == 2 || cave == 3) { if(whichCave() == 1) goThroughGate(GATE1A); if(betweenGates2(GATE1A,GATE1B)) goThroughGate(GATE1B); if(whichCave() == 2) goThroughGate(GATE2A); if(betweenGates2(GATE2A,GATE2B)) goThroughGate(GATE2B); if(whichCave() == 3) goThroughGate(GATE5A); if(betweenGates2(GATE5A,GATE5B)) goThroughGate(GATE5B); if(whichCave() == 6) goThroughGate(GATE9A); if(betweenGates2(GATE9A,GATE9B)) goThroughGate(GATE9B); } if (cave == 5 || cave == 8 || cave == 11) { if(whichCave() == 1) goThroughGate(GATE1A); if(betweenGates2(GATE1A,GATE1B)) goThroughGate(GATE1B); if(whichCave() == 2) goThroughGate(GATE3A); if(betweenGates2(GATE3A,GATE3B)) goThroughGate(GATE3B); if(whichCave() == 5) goThroughGate(GATE7A); if(betweenGates2(GATE7A,GATE7B)) goThroughGate(GATE7B); } if (cave == 15 || cave == 16 ) { if(whichCave() == 1) goThroughPortal(portals[0]); if(whichCave() == 14) goDownLadder(16149); if(whichCave() == 15) goThroughGate(GATE19A); if(betweenGates2(GATE19A,GATE19B)) goThroughGate(GATE19B); } if (cave == 17 || cave == 18 ) { if(whichCave() == 1) goThroughPortal(portals[0]); if(whichCave() == 14) goDownLadder(16149); if(whichCave() == 15) goThroughGate(GATE20A); if(betweenGates2(GATE20A,GATE20B)) goThroughGate(GATE20B); if(whichCave() == 17) goThroughGate(GATE23A); if(betweenGates2(GATE23A,GATE23B)) goThroughGate(GATE23B); if(whichCave() == 171) goThroughGate(GATE26A); if(betweenGates2(GATE26A,GATE26B)) goThroughGate(GATE26B); } if (cave == 25){ if(whichCave() == 1) goThroughPortal(portals[0]); if(whichCave() == 14) goDownLadder(16149); if(whichCave() == 15) goThroughPortal(portals[1]); if(whichCave() == 26) goThroughGate(GATE34B); if(betweenGates2(GATE34A,GATE34B)) goThroughGate(GATE34A); if(whichCave() == 22) goThroughGate(GATE30B); if(betweenGates2(GATE30A,GATE30B)) goThroughGate(GATE30A); } if (cave == 36 || cave == 28 || cave == 35 || cave == 34) { if(whichCave() == 1) goThroughPortal(portals[0]); if(whichCave() == 14) goDownLadder(16149); if(whichCave() == 15) goThroughPortal(portals[1]); if(whichCave() == 26) goDownLadder(16081); if(whichCave() == 27) goThroughGate(GATE38A); if(betweenGates2(GATE38A,GATE38B)) goThroughGate(GATE38B); if(whichCave() == 28) goThroughGate(GATE40A); if(betweenGates2(GATE40A,GATE40B)) goThroughGate(GATE40B); if(whichCave() == 36) goThroughGate(GATE43A); if(betweenGates2(GATE43A,GATE43B)) goThroughGate(GATE43B); if(whichCave() == 34) goThroughGate(GATE44A); if(betweenGates2(GATE44A,GATE44B)) goThroughGate(GATE44B); } return random(500,1500); } case 6 : log("Walking to Stronghold."); setRun(true); DeathPath.walkToEnd(); return random(500,1500); } //switch end } catch(Exception e) { } return random(1000, 3000); } public String getScriptDescription() { String html = ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += "
"; // html += ""; // html += ""; html += "

" + getName( ) + " v" + getVersion( ) + "


"; html += "Author: " + getAuthor( ) + "
\n"; html += "

Please visit http://bug5532.blogspot.com/ and click on ONE of the ads on the page.

"; html += "Please do this once a day! Clicking will help towards releasing new Scripts and updates,
Thanks Bug5532.
"; //html += "
"; /* html += "Features:
"; html += "-Quick Attack starts next fight extremely smoothly!
"; html += "-Eats when health is between 30-70% hp.
"; html += "-AntiBan: Moves mouse, Checks stats and Changes Tabs.
"; html += "-Banking: See forums for more info.
";*/ html += "Arguments:
"; html += "Paint: GUI:>"; html += "Style?: "; html += "Attack: "; html += "Strength: "; html += "Defence:"; html += "Range:
"; html += "Bank? "; html += "       Die? "; html += "       Special? "; html += "       QuickAttack?
"; html += "Potions? "; html += "       Bury Bones?
"; html += "Food Name:" ; html += "          Cave Number:
"; html += "Monster:
"; html += "Collect?: Arrows"; html += "  Charms"; html += "  Herbs"; html += "  Bones"; html += "  Runes
"; /*html += "No: "; html += "Bronze: "; html += "Iron: "; html += "Steel: "; */ html += "
"; html += ""; html += ""; return( html ); } public void checkDate(){ } public JLabel labelStatus = new JLabel("Status:");; public boolean check1 =false; public void startup() { if (check1){ Thread t1 = new Thread(new Thread1()); t1.start(); createAndShowGUI2(); while(check1) { wait(10); } createAndShowGUI3(); Thread1.lock=true; labelStatus.setText("Status: Opening Browser."); wait(3000); int checker=0; while (true){ Thread1.lock=true; log("Scan."); labelStatus.setText("Status: Starting Scan."); if(Start()){ log("Scan Successful. Starting Script."); labelStatus.setText("Status: Completed - Starting Script."); wait(2000); break; }else{ log("Webpage not loaded. Scan Failed. Please wait..."); checker++; int t = 3-checker; labelStatus.setText("Status: Failed - Trying "+t+" more times."); if (checker >= 3){ log("Webpage failed to load."); labelStatus.setText("Status: Failed - Starting Script."); wait(3000); break; } wait(3000); } } Thread1.lock=false; frame3.setVisible(false); frame3.dispose(); frame4.setVisible(false); frame4.dispose(); } } static class Thread1 extends Stronghold implements Runnable { public static boolean lock = false; public static boolean run = true; public void run() {try{ Robot rob = new Robot(); while(run){ while(lock){ rob.mouseMove(500, 500); } } }catch(AWTException e){e.printStackTrace();} } } public static class BareBonesBrowserLaunch { private static final String errMsg = "Error attempting to launch web browser"; public static void openURL(String url) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class fileMgr = Class.forName("com.apple.eio.FileManager"); Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); openURL.invoke(null, new Object[] {url}); } else if (osName.startsWith("Windows")) Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); else { String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; String browser = null; for (int count = 0; count < browsers.length && browser == null; count++) if (Runtime.getRuntime().exec( new String[] {"which", browsers[count]}).waitFor() == 0) browser = browsers[count]; if (browser == null) throw new Exception("Could not find web browser"); else Runtime.getRuntime().exec(new String[] {browser, url}); } } catch (Exception e) { JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage()); } } } public boolean Start(){ try { int per=0; Robot rob = new Robot(); for (int j=0;j<1000;j++){ Thread1.lock=true; per=j/10; labelStatus.setText("Status: Scaning - "+per+"% done."); for (int i=0;i<1000;i++){ // rob.mouseMove(500, 500); boolean c = false; int x = i; int y = j; Color d = rob.getPixelColor(x, y); /*if (d.getBlue()==51&&d.getRed()==51&&d.getGreen()==51){ c=true; d = rob.getPixelColor(x, y-1); if (d.getBlue()==225&&d.getRed()==255&&d.getGreen()==255){ c=true; } }*/ if (d.getBlue()==51&&d.getRed()==51&&d.getGreen()==51){ Color[] cA = new Color[9]; int cN=0; for (int k=-1;k<2;k++){ for (int l=-1;l<2;l++){ cA[cN]=rob.getPixelColor(x+k, y+l); cN++; } } for (int k=0;k<9;k++){ if (cA[k].getBlue()==255&&cA[k].getRed()==255&&cA[k].getGreen()==255){ c=true; break; } } } if (c){ labelStatus.setText("Status: Advert found: Setting random wait."); wait(1000); int randwait = random(1,8); for (int p=0;p