Huge Thanks to drunkgecko54 for his donation of a membership pin!
*/
import java.awt.Color;
import java.awt.Graphics;
import java.util.Map;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.net.*;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JOptionPane;
import java.net.URL;
import java.lang.reflect.Method;
import com.speljohan.rsbot.script.ScriptManifest;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.script.wrappers.RSTile;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.wrappers.RSInterface;
import com.speljohan.rsbot.script.wrappers.RSInterfaceChild;
import com.speljohan.rsbot.script.wrappers.RSInterfaceComponent;
import com.speljohan.rsbot.script.Calculations;
import com.speljohan.rsbot.script.Constants;
import com.speljohan.rsbot.script.wrappers.RSObject;
import com.speljohan.rsbot.script.wrappers.RSItemTile;
import com.speljohan.rsbot.script.wrappers.RSCharacter;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.accessors.Character;
import com.speljohan.rsbot.script.Bank;
import com.speljohan.rsbot.script.wrappers.RSNPC;
import com.speljohan.rsbot.accessors.Item;
import com.speljohan.rsbot.script.wrappers.RSItem;
import com.speljohan.rsbot.script.wrappers.RSArea;
import com.speljohan.rsbot.script.wrappers.RSPlayer;
import com.speljohan.rsbot.accessors.NPC;
@ScriptManifest(authors = { "Wazzu" }, category = "Combat", name = "Stronghold of Security", version = 1, description = "<html>\n<head>\n</head>\n<body bgcolor=\"#CC033C\">\n<font color=\"black\">\n<center><font size=\"8\"><b>Stronghold Of Security</b></font>\n<br><font size=\"3\"><b>Version 2.21, Edition 54</b></font></center><br><br><b>Select Cave </b><select name='cave'><option>Cave 1<option>Cave 2<option>Cave 3<option>Cave 4<option>Cave 5<option>Cave 6<option>Cave 7<option>Cave 8<b>Select NPC To Fight </b><select name='Enemy'><option>Minotaur<option>Goblin<option>Flesh Crawler<option>Zombie<option>Flesh Crawler And Zombie<option>Spider<br><b>Select Food </b><select name='Food'><option>Trout<option>Salmon<option>Tuna<option>Lobster<option>Monkfish<option>Swordfish<option>Cake<option>Chocolate Cake<b>Withdraw </b><select name='foodNumber'><option>Full Inventory<option>20<option>15<option>10<option>5<br><b>HP To Eat At (If Not In Combat) </b><input type=\"text\" size=\"3\" name=\"eatHP\"><b>HP To Eat At (No Matter What) </b><input type=\"text\" size=\"3\" name=\"eatHP2\"><br><b>Select Arrow Pickup </b><select name='arrow'><option>None<option>Bronze<option>Iron<option>Steel<option>All<b>Pickup Gems </b><input type=\"checkbox\" name=\"Gems\" value=\"true\"><b>Pickup Charms </b><input type=\"checkbox\" name=\"Charms\" value=\"true\"><br><b>Other Item ID's </b><input type=\"text\" name=\"item\">(Separate w/comma)<br><b>Other Stackable Items </b><input type=\"text\" name=\"itemStack\">(Recommended to only put one)<br><b>Search For Food In Bank<b> <input type=\"checkbox\" name=\"Search\" value=\"true\">(If No, Put Food In First Bank Slot)<br><b>Select Potion </b><select name='potion'><option>None<option>Strength<option>Super Strength<option>Range<b>Withdraw How Many? </b><select name='number'><option>Select<option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10<b>Drink When Bonus At </b><input type=\"text\" size=\"3\" name=\"drinkNum\"><br><b>Search For Potion In Bank</b> <input type=\"checkbox\" name=\"SearchPot\" value=\"true\">(If No, Put Potion In Second Bank Slot)<br><b>Bury Bones</b> <input type=\"checkbox\" name=\"bury\" value=\"true\"><b>Use Spec</b> <input type=\"checkbox\" name=\"spec\" value=\"true\"><b>Take Ammo</b> <input type=\"checkbox\" name=\"ammo\" value=\"true\"></font>\n</body>\n</html>\n")
public class WazzuStronghold extends Script implements PaintListener {
public int edition = 54;
public double getVersion() {
return 2.21;
}
public static final int [] minotaur = new int [] {4404, 4406};
public static final int [] goblin = new int [] {4407, 4408, 4409, 4410, 4411, 4412};
public static final int [] fleshCrawler = new int [] {4391, 4390};
public static final int [] zombie = new int [] {5377, 5378, 5393, 4394, 5379, 5380};
public static final int [] fleshZombie = new int [] {4391, 4390, 5377, 5378, 5393, 4394, 5379, 5380};
public static final int [] spider = {4400};
public int [] enemy;
public boolean foodIsTrout;
public boolean foodIsSalmon;
public boolean foodIsLobster;
public boolean foodIsMonkfish;
public boolean foodIsSwordfish;
public boolean foodIsTuna;
public boolean foodIsCake;
public boolean foodIsChocCake;
public boolean itsMe;
public boolean Search;
public boolean SearchPot;
public long lastAmmoPick;
public long lastArrowPick;
public long lastCharmPick;
public long lastGemPick;
public long lastItemPick;
public long lastStackPick;
public long lastBonePick;
public long lastPick;
public long lastAttack;
public long lastLog;
public long lastEat;
public long lastPot;
public boolean cave1;
public boolean cave2;
public boolean cave3;
public boolean cave4;
public boolean cave5;
public boolean cave6;
public boolean cave7;
public boolean cave8;
public RSTile northEastHole = new RSTile(3084,3423);
public RSTile southWestHole = new RSTile(3078,3418);
public RSTile northEastHole2 = new RSTile(3087,3425);
public RSTile southWestHole2 = new RSTile(3077,3416);
//For Cave 1
public RSTile northEast1 = new RSTile(1865,5244);
public RSTile southWest1 = new RSTile(1858,5239);
public RSTile northEast2 = new RSTile(1859,5238);
public RSTile southWest2 = new RSTile(1858,5236);
public RSTile northEast3 = new RSTile(1866,5235);
public RSTile southWest3 = new RSTile(1858,5213);
public RSTile northEast4 = new RSTile(1869,5218);
public RSTile southWest4 = new RSTile(1867,5217);
public RSTile northEast5 = new RSTile(1881,5222);
public RSTile southWest5 = new RSTile(1870,5208);
//For Cave 2
public RSTile northEast6 = new RSTile(1915,5230);
public RSTile southWest6 = new RSTile(1901,5210);
public RSTile northEast7 = new RSTile(1905,5233);
public RSTile southWest7 = new RSTile(1904,5231);
public RSTile northEast8A = new RSTile(1914,5240);
public RSTile southWest8A = new RSTile(1904,5234);
public RSTile northEast8B = new RSTile(1914,5244);
public RSTile southWest8B = new RSTile(1908,5240);
public RSTile northEast9 = new RSTile(1907,5243);
public RSTile southWest9 = new RSTile(1904,5242);
public RSTile northEast10 = new RSTile(1903,5245);
public RSTile southWest10 = new RSTile(1887,5218);
public RSTile northEast11 = new RSTile(1888,5236);
public RSTile southWest11 = new RSTile(1886,5235);
public RSTile northEast12 = new RSTile(1885,5236);
public RSTile southWest12 = new RSTile(1878,5226);
//For Cave 4
public RSTile northEast13 = new RSTile(2046,5246);
public RSTile southWest13 = new RSTile(2040,5239);
public RSTile northEast14 = new RSTile(2031,5228);
public RSTile southWest14 = new RSTile(2009,5208);
public RSTile northEast15 = new RSTile(2008,5216);
public RSTile southWest15 = new RSTile(2006,5215);
public RSTile northEast16 = new RSTile(2005,5220);
public RSTile southWest16 = new RSTile(2000,5209);
public RSTile northEast17 = new RSTile(2008,5208);
public RSTile southWest17 = new RSTile(2001,5195);
//For Cave 5
public RSTile northEast18 = new RSTile(2018,5228);
public RSTile southWest18 = new RSTile(2016,5227);
public RSTile northEast19 = new RSTile(2015,5234);
public RSTile southWest19 = new RSTile(2004,5223);
public RSTile northEast20 = new RSTile(2006,5237);
public RSTile southWest20 = new RSTile(2005,5235);
public RSTile northEast21 = new RSTile(2010,5244);
public RSTile southWest21 = new RSTile(1997,5238);
public RSTile northEast22 = new RSTile(1996,5244);
public RSTile southWest22 = new RSTile(1988,5228);
//For Cave 6
public RSTile northEast23 = new RSTile(2026,5214);
public RSTile southWest23 = new RSTile(2014,5203);
public RSTile northEast24 = new RSTile(2021,5202);
public RSTile southWest24 = new RSTile(2020,5200);
public RSTile northEast25 = new RSTile(2020,5199);
public RSTile southWest25 = new RSTile(2008,5185);
public RSTile northEast26 = new RSTile(2033,5199);
public RSTile southWest26 = new RSTile(2021,5185);
public RSTile northEast27 = new RSTile(2036,5186);
public RSTile southWest27 = new RSTile(2034,5185);
public RSTile northEast28 = new RSTile(2046,5191);
public RSTile southWest28 = new RSTile(2037,5185);
public RSTile northEast29 = new RSTile(2046,5194);
public RSTile southWest29 = new RSTile(2036,5189);
//For Cave 3
public RSTile northEast30 = new RSTile(1912,5209);
public RSTile southWest30 = new RSTile(1911,5207);
public RSTile northEast31 = new RSTile(1912,5206);
public RSTile southWest31 = new RSTile(1907,5201);
public RSTile northEast32 = new RSTile(1906,5204);
public RSTile southWest32 = new RSTile(1904,5203);
public RSTile northEast33A = new RSTile(1903,5213);
public RSTile southWest33A = new RSTile(1897,5200);
public RSTile northEast33B = new RSTile(1907,5199);
public RSTile southWest33B = new RSTile(1898,5187);
public RSTile northEast33C = new RSTile(1897,5199);
public RSTile southWest33C = new RSTile(1882,5185);
//For Cave 7
public RSTile northEast34 = new RSTile(2133,5258);
public RSTile southWest34 = new RSTile(2117,5251);
public RSTile northEast35 = new RSTile(2133,5259);
public RSTile southWest35 = new RSTile(2132,5257);
public RSTile northEast36A = new RSTile(2137,5275);
public RSTile southWest36A = new RSTile(2124,5260);
public RSTile northEast36B = new RSTile(2137,5278);
public RSTile southWest36B = new RSTile(2117,5260);
//For Cave 8
public RSTile northEast34B = new RSTile(2133,5259);
public RSTile southWest34B = new RSTile(2117,5251);
public RSTile northEast37A = new RSTile(2152,5289);
public RSTile southWest37A = new RSTile(2138,5274);
public RSTile northEast37B = new RSTile(2148,5292);
public RSTile southWest37B = new RSTile(2145,5290);
public RSTile northEast38 = new RSTile(2152,5292);
public RSTile southWest38 = new RSTile(2149,5291);
public RSTile northEast39 = new RSTile(2156,5292);
public RSTile southWest39 = new RSTile(2153,5289);
public RSTile northEast40 = new RSTile(2156,5288);
public RSTile southWest40 = new RSTile(2155,5286);
public RSTile northEast41 = new RSTile(2165,5286);
public RSTile southWest41 = new RSTile(2155,5278);
public RSTile northEast42 = new RSTile(2163,5289);
public RSTile southWest42 = new RSTile(2162,5287);
public RSTile northEast43A = new RSTile(2167,5305);
public RSTile southWest43A = new RSTile(2157,5290);
public RSTile northEast43B = new RSTile(2156,5298);
public RSTile southWest43B = new RSTile(2145,5295);
public RSTile northEast44 = new RSTile(2149,5301);
public RSTile southWest44 = new RSTile(2148,5299);
public RSTile northEast45 = new RSTile(2155,5309);
public RSTile southWest45 = new RSTile(2145,5302);
public int skill;
public String skillName;
public int xpChange;
public int lvlChange;
public int startLevel;
public String doing;
public String cave;
public int fireRune = 554;
public int airRune = 556;
public int lawRune = 563;
public int teleTab = 8007;
public int [] teleRunes = {554, 556, 563};
public int foodTrout = 333;
public int foodSalmon = 329;
public int foodLobster = 379;
public int foodSwordfish = 373;
public int foodMonkfish = 7946;
public int foodTuna = 361;
public int chocCake1 = 1901;
public int chocCake2 = 1899;
public int chocCake3 = 1897;
public int cake1 = 1895;
public int cake2 = 1893;
public int cake3 = 1891;
public int meat = 2142;
public int foodNum;
public int bonus;
public int potNum;
public int drinkPot;
public int strPot = 113;
public int str3 = 115;
public int str2 = 117;
public int str1 = 119;
public int supStrPot = 2440;
public int supStr3 = 157;
public int supStr2 = 159;
public int supStr1 = 161;
public int rangePot = 2444;
public int range3 = 169;
public int range2 = 171;
public int range1 = 173;
public int vial = 229;
public int potion;
public int ammoID;
public int [] arrowID;
public int [] gemID;
public int [] charmID;
public int [] customID;
public int [] stackID;
public int boneID = 526;
public boolean takeAmmo;
public boolean takeArrow;
public boolean takeCharm;
public boolean takeGem;
public boolean takeCustom;
public boolean takeStack;
public boolean takeBone;
public boolean doSpec;
public int food;
public int hole = 16154;
public int [] booth = {26972, 11402};
public int eatHP;
public int eatHP2;
public int currentHP;
public char n;
public char s;
public char w;
public char e;
public long startTime = System.currentTimeMillis();
public int startLevelAttack = 0;
public int startXPAttack = 0;
public int startLevelDefense = 0;
public int startXPDefense = 0;
public int startLevelStrength = 0;
public int startXPStrength = 0;
public int startLevelHP = 0;
public int startXPHP = 0;
public int startLevelRange = 0;
public int startXPRange = 0;
RSTile [] bankToHole = new RSTile[] { new RSTile(3094,3491), new RSTile(3086,3485),
new RSTile(3081,3476), new RSTile(3080,3467),
new RSTile(3087,3460), new RSTile(3087,3450),
new RSTile(3087,3440), new RSTile(3080,3433),
new RSTile(3080,3423)
};
RSTile [] holeToBank = reversePath(bankToHole);
RSTile [] fountainToBank = new RSTile [] {new RSTile(3212,3424), new RSTile(3205,3428),
new RSTile(3196, 3429), new RSTile(3189,3435)
};
RSTile [] varrockToHole = new RSTile [] {new RSTile(3189,3435), new RSTile(3180, 3430),
new RSTile(3170,3427), new RSTile(3162,3421),
new RSTile(3153,3417), new RSTile(3143,3417),
new RSTile(3133,3416), new RSTile(3123,3415),
new RSTile(3114,3420), new RSTile(3104,3420),
new RSTile(3094,3420), new RSTile(3084,3421),
};
RSTile [] door2To3 = new RSTile [] { new RSTile(1859,5235), new RSTile(1862,5226), new RSTile(1866,5217)
};
RSTile [] door3To2 = reversePath(door2To3);
RSTile [] cave5Path = new RSTile [] {new RSTile(1996, 5216), new RSTile(1989, 5223),
new RSTile(1989, 5233)
};
RSTile [] cave5Reverse = reversePath(cave5Path);
public RSTile DOOR_1 = new RSTile(1859, 5238);
public RSTile DOOR_2 = new RSTile(1859, 5235);
public RSTile DOOR_3 = new RSTile(1867, 5217);
public RSTile DOOR_4 = new RSTile(1870, 5217);
public RSTile NEXT_TO_LADDER1 = new RSTile(1859, 5243);
public RSTile doorTile;
public RSTile weirdTile = new RSTile(1864,5216);
public RSTile weirdTile2 = new RSTile(1911,5210);
public RSTile teleTile1 = new RSTile(1914, 5222);
//Wrong Doors
public RSTile c1wd1 = new RSTile(1878, 5222);
public RSTile c1wd2 = new RSTile(1874, 5207);
public RSTile c2wd1 = new RSTile(1887, 5244);
public RSTile c2wd2 = new RSTile(1889, 5236);
public RSTile c3wd1 = new RSTile(1882, 5189);
public RSTile c3wd2 = new RSTile(1897, 5213);
public RSTile c4wd1 = new RSTile(2005, 5194);
public RSTile c6wd1 = new RSTile(2045, 5195);
public RSTile c7wd1 = new RSTile(2137, 5262);
public RSTile c7wd2 = new RSTile(2133, 5278);
//Wrong Areas
public RSTile c1NE1 = new RSTile(1879,5225);
public RSTile c1SW1 = new RSTile(1878,5223);
public RSTile c1NE2 = new RSTile(1875,5207);
public RSTile c1SW2 = new RSTile(1874,5205);
public RSTile c2NE1 = new RSTile(1886,5244);
public RSTile c2SW1 = new RSTile(1884,5243);
public RSTile c2NE2 = new RSTile(1888,5236);
public RSTile c2SW2 = new RSTile(1886,5235);
public RSTile c3NE1 = new RSTile(1881,5189);
public RSTile c3SW1 = new RSTile(1879,5188);
public RSTile c3NE2 = new RSTile(1896,5213);
public RSTile c3SW2 = new RSTile(1894,5212);
public RSTile c4NE1 = new RSTile(2005,5194);
public RSTile c4SW1 = new RSTile(2004,5192);
public RSTile c6NE1 = new RSTile(2046,5197);
public RSTile c6SW1 = new RSTile(2045,5195);
public RSTile c7NE1 = new RSTile(2140,5263);
public RSTile c7SW1 = new RSTile(2138,5262);
public RSTile c7NE2 = new RSTile(2133,5281);
public RSTile c7SW2 = new RSTile(2132,5279);
public RSTile area14Tile = new RSTile(2021, 5217);
public RSTile area16Tile = new RSTile(2003, 5210);
public RSTile area17Tile = new RSTile(2005, 5205);
public RSTile area21Tile = new RSTile(2000, 5243);
public RSTile area22Tile = new RSTile(1994, 5241);
public RSTile area23Tile = new RSTile(2021, 5210);
public RSTile area25Tile = new RSTile(2019, 5193);
public RSTile area26Tile = new RSTile(2023, 5193);
public RSTile cave3Tile1 = new RSTile(1901, 5201);
public RSTile cave3Tile2 = new RSTile(1898, 5194);
public RSTile cave3Tile3 = new RSTile(1891, 5192);
public RSTile cave7Tile = new RSTile(2128, 5269);
public RSTile door5 = new RSTile(1905, 5230);
public RSTile door6 = new RSTile(1905, 5233);
public RSTile door7 = new RSTile(1908, 5242);
public RSTile door8 = new RSTile(1904, 5242);
public RSTile door9 = new RSTile(1889, 5236);
public RSTile door10 = new RSTile(1886, 5236);
public RSTile door11 = new RSTile(2008, 5216);
public RSTile door12 = new RSTile(2006, 5216);
public RSTile door13 = new RSTile(2018, 5228);
public RSTile door14 = new RSTile(2016, 5228);
public RSTile door15 = new RSTile(2005, 5235);
public RSTile door16 = new RSTile(2005, 5237);
public RSTile door17 = new RSTile(2020, 5202);
public RSTile door18 = new RSTile(2020, 5200);
public RSTile door19 = new RSTile(2034, 5186);
public RSTile door20 = new RSTile(2036, 5186);
public RSTile door21 = new RSTile(1911, 5209);
public RSTile door22 = new RSTile(1911, 5207);
public RSTile door23 = new RSTile(1906, 5204);
public RSTile door24 = new RSTile(1904, 5204);
public RSTile door25 = new RSTile(2132,5257);
public RSTile door26 = new RSTile(2132,5260);
public RSTile door27 = new RSTile(2149, 5291);
public RSTile door28 = new RSTile(2152, 5291);
public RSTile door29 = new RSTile(2155, 5289);
public RSTile door30 = new RSTile(2156, 5286);
public RSTile door31 = new RSTile(2162, 5287);
public RSTile door32 = new RSTile(2162, 5290);
public RSTile door33 = new RSTile(2149, 5299);
public RSTile door34 = new RSTile(2149, 5302);
public RSTile holeTile = new RSTile(3081, 3421);
public RSTile portal1 = new RSTile(1863, 5238);
public RSTile portal2 = new RSTile(2039, 5240);
public RSTile portal3 = new RSTile(2120, 5258);
public RSTile ladder1Tile = new RSTile(1859, 5244);
public RSTile ladder1bTile = new RSTile(1913, 5226);
public RSTile ladder2Tile = new RSTile(1902, 5222);
public RSTile ladder3Tile = new RSTile(2042, 5246);
public RSTile ladder4Tile = new RSTile(2026, 5218);
public RSTile ladder5Tile = new RSTile(2123, 5251);
public RSTile chain1Tile = new RSTile(1881, 5232);
public RSTile chain2Tile = new RSTile(2017, 5210);
public RSTile chain3Tile = new RSTile(2031, 5189);
public RSTile chain4Tile = new RSTile(2150, 5278);
public boolean onStart(Map<String, String> args) {
if (args.get("Enemy").equals("Minotaur")) {
enemy = minotaur;
}
if (args.get("Enemy").equals("Goblin")) {
enemy = goblin;
}
if (args.get("Enemy").equals("Flesh Crawler")) {
enemy = fleshCrawler;
}
if (args.get("Enemy").equals("Zombie")) {
enemy = zombie;
}
if (args.get("Enemy").equals("Flesh Crawler And Zombie")) {
enemy = fleshZombie;
}
if (args.get("Enemy").equals("Spider")) {
enemy = spider;
}
cave1 = (args.get("cave").equals("Cave 1"));
cave2 = (args.get("cave").equals("Cave 2"));
cave3 = (args.get("cave").equals("Cave 3"));
cave4 = (args.get("cave").equals("Cave 4"));
cave5 = (args.get("cave").equals("Cave 5"));
cave6 = (args.get("cave").equals("Cave 6"));
cave7 = (args.get("cave").equals("Cave 7"));
cave8 = (args.get("cave").equals("Cave 8"));
if(cave1) {
cave = "1";
}
if(cave2) {
cave = "2";
}
if(cave3) {
cave = "3";
}
if(cave4) {
cave = "4";
}
if(cave5) {
cave = "5";
}
if(cave6) {
cave = "6";
}
if(cave7) {
cave = "7";
}
if(cave8) {
cave = "8";
}
foodIsSalmon = (args.get("Food").equals("Salmon"));
foodIsTrout = (args.get("Food").equals("Trout"));
foodIsLobster = (args.get("Food").equals("Lobster"));
foodIsMonkfish = (args.get("Food").equals("Monkfish"));
foodIsSwordfish = (args.get("Food").equals("Swordfish"));
foodIsTuna = (args.get("Food").equals("Tuna"));
foodIsChocCake = (args.get("Food").equals("Chocolate Cake"));
foodIsCake = (args.get("Food").equals("Cake"));
Search = (args.get("Search") != null);
SearchPot = (args.get("SearchPot") != null);
takeAmmo = (args.get("ammo") != null);
if (args.get("Food").equals("Trout")) {
food = foodTrout;
}
if (args.get("Food").equals("Salmon")) {
food = foodSalmon;
}
if (args.get("Food").equals("Lobster")) {
food = foodLobster;
}
if (args.get("Food").equals("Monkfish")) {
food = foodMonkfish;
}
if (args.get("Food").equals("Swordfish")) {
food = foodSwordfish;
}
if (args.get("Food").equals("Tuna")) {
food = foodTuna;
}
if (args.get("Food").equals("Chocolate Cake")) {
food = chocCake3;
}
if (args.get("Food").equals("Cake")) {
food = cake3;
}
eatHP = Integer.parseInt(args.get("eatHP"));
eatHP2 = Integer.parseInt(args.get("eatHP2"));
String drink = args.get("drinkNum");
if(drink.length() < 1) {
potion = 1;
}
if(drink.length() > 0) {
drinkPot = Integer.parseInt(args.get("drinkNum"));
}
if (args.get("arrow").equals("None")) {
arrowID = new int [] {1};
takeArrow = false;
}
if (args.get("arrow").equals("Bronze")) {
arrowID = new int [] {882};
takeArrow = true;
}
if (args.get("arrow").equals("Iron")) {
arrowID = new int [] {884};
takeArrow = true;
}
if (args.get("arrow").equals("Steel")) {
arrowID = new int [] {886};
takeArrow = true;
}
if (args.get("arrow").equals("All")) {
arrowID = new int [] {882, 884, 886};
takeArrow = true;
}
if (args.get("Charms") != null) {
charmID = new int [] {12158, 12159, 12160, 12163};
takeCharm = true;
}
if (args.get("Charms") == null) {
charmID = new int [] {1};
takeCharm = false;
}
if (args.get("Gems") != null) {
gemID = new int [] {1617, 1619, 1621, 1623};
takeGem = true;
}
if (args.get("Gems") == null) {
gemID = new int [] {1};
takeGem = false;
}
if (args.get("bury") != null) {
takeBone = true;
}
doSpec = (args.get("spec") != null);
if (args.get("bury") == null) {
takeBone = false;
}
if (args.get("foodNumber").equals("Full Inventory")) {
foodNum = 28;
}
if (args.get("foodNumber").equals("20")) {
foodNum = 20;
}
if (args.get("foodNumber").equals("15")) {
foodNum = 15;
}
if (args.get("foodNumber").equals("10")) {
foodNum = 10;
}
if (args.get("foodNumber").equals("5")) {
foodNum = 5;
}
if (args.get("potion").equals("None")) {
potion = 1;
}
if (args.get("potion").equals("Strength")) {
potion = strPot;
}
if (args.get("potion").equals("Super Strength")) {
potion = supStrPot;
}
if (args.get("potion").equals("Range")) {
potion = rangePot;
}
if (args.get("number").equals("1")) {
potNum = 1;
}
if (args.get("number").equals("2")) {
potNum = 2;
}
if (args.get("number").equals("3")) {
potNum = 3;
}
if (args.get("number").equals("4")) {
potNum = 4;
}
if (args.get("number").equals("5")) {
potNum = 5;
}
if (args.get("number").equals("6")) {
potNum = 6;
}
if (args.get("number").equals("7")) {
potNum = 7;
}
if (args.get("number").equals("8")) {
potNum = 8;
}
if (args.get("number").equals("9")) {
potNum = 9;
}
if (args.get("number").equals("10")) {
potNum = 10;
}
String itemCus = args.get("item");
if(itemCus.length() < 1) {
customID = new int [] {1};
takeCustom = false;
}
else {
String[] itemCust = itemCus.split(",");
customID = new int[itemCust.length];
for(int i = 0; i < itemCust.length; i++) {
itemCust[i] = itemCust[i].trim();
customID[i] = Integer.parseInt(itemCust[i]);
}
takeCustom = true;
}
String itemStackCus = args.get("itemStack");
if(itemStackCus.length() < 1) {
stackID = new int [] {1};
takeStack = false;
}
else {
String[] itemStackCust = itemStackCus.split(",");
stackID = new int[itemStackCust.length];
for(int i = 0; i < itemStackCust.length; i++) {
itemStackCust[i] = itemStackCust[i].trim();
stackID[i] = Integer.parseInt(itemStackCust[i]);
}
takeStack = true;
}
log("Time To Fight, Bitch");
startTime = System.currentTimeMillis();
if (isLoggedIn()) {
startLevelAttack = skills.getRealSkillLevel(0);
startXPAttack = skills.getCurrentSkillExp(0);
startLevelDefense = skills.getRealSkillLevel(1);
startXPDefense = skills.getCurrentSkillExp(1);
startLevelStrength = skills.getRealSkillLevel(2);
startXPStrength = skills.getCurrentSkillExp(2);
startLevelHP = skills.getRealSkillLevel(3);
startXPHP = skills.getCurrentSkillExp(3);
startLevelRange = skills.getRealSkillLevel(4);
startXPRange = skills.getCurrentSkillExp(4);
}
doing = "Start Up...";
URLConnection url = null;
BufferedReader in = null;
BufferedWriter out = null;
try {
url = new URL("http://www.wazzuscripting.webs.com/scripts/stronghold_of_security_version.txt").openConnection();
in = new BufferedReader(new InputStreamReader(url.getInputStream()));
if(Double.parseDouble(in.readLine()) > getVersion()) {
JOptionPane.showMessageDialog(null, "Your version is Out-Of-Date. Please Update.");
openURL("http://www.rsbot.org/vb/showthread.php?t=74271");
log("Script Out Of Date. Please Download & Use The Updated Version.");
return false;
}
}
catch(IOException e) {
return false;
}
lastArrowPick = System.currentTimeMillis();
lastCharmPick = System.currentTimeMillis();
lastGemPick = System.currentTimeMillis();
lastItemPick = System.currentTimeMillis();
lastStackPick = System.currentTimeMillis();
lastBonePick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
lastAttack = System.currentTimeMillis();
lastLog = System.currentTimeMillis();
lastEat = System.currentTimeMillis();
lastPot = System.currentTimeMillis();
return true;
}
public int loop () {
RSObject bankBooth = findObject(booth);
RSNPC theNPC = getNearestReachableNPCByID(enemy);
if(!inventoryContains(food)) {
goBank();
}
if(!inventoryContains(food) && bankBooth != null) {
if(distanceTo(bankBooth.getLocation()) < 5) {
doing = "Banking...";
bank();
}
}
if(inventoryContains(food) && theNPC != null && canReach(theNPC.getLocation(), false)) {
fight();
}
if(inventoryContains(food)) {
if(theNPC == null || !canReach(theNPC, false)) {
doing = ("Walking To Cave " + cave + "...");
goFight();
}
}
return(random(50,100));
}
public int fight() {
RSNPC theNPC = getNearestFreeReachableNPCByID(enemy);
currentHP = skills.getCurrentSkillLevel(Constants.STAT_HITPOINTS);
ammoID = getEquipmentArray()[13];
if(potion == strPot || potion == supStrPot) {
bonus = skills.getCurrentSkillLevel(Constants.STAT_STRENGTH) - skills.getRealSkillLevel(Constants.STAT_STRENGTH);
}
if(potion == rangePot) {
bonus = skills.getCurrentSkillLevel(Constants.STAT_RANGE) - skills.getRealSkillLevel(Constants.STAT_RANGE);
}
if(currentHP < eatHP2) {
eat();
return(random(10,20));
}
if(bonus < drinkPot) {
if(potion == strPot) {
if(inventoryContains(strPot) || inventoryContains(str3) || inventoryContains(str2) || inventoryContains(str1)) {
if(System.currentTimeMillis() - lastPot > 5000) {
downPotion();
}
}
}
if(potion == supStrPot) {
if(inventoryContains(supStrPot) || inventoryContains(supStr3) || inventoryContains(supStr2) || inventoryContains(supStr1)) {
if(System.currentTimeMillis() - lastPot > 5000) {
downPotion();
}
}
}
if(potion == rangePot) {
if(inventoryContains(rangePot) || inventoryContains(range3) || inventoryContains(range2) || inventoryContains(range1)) {
if(System.currentTimeMillis() - lastPot > 5000) {
downPotion();
}
}
}
}
if(getInventoryCount(ammoID) > 100) {
eatItem(ammoID);
return(random(100,200));
}
if(doSpec) {
if(specFull() && !specSelected()) {
clickSpec();
}
}
if(isMeInCombat()) {
if(theNPC != null) {
final Point npcLocation = Calculations.tileToScreen(theNPC.getLocation());
doing = "Under Attack...";
if(pointOnScreen(npcLocation)) {
moveMouse(npcLocation, 0, 0);
}
}
return(random(2,5));
}
if(System.currentTimeMillis() - lastPick < 500) {
doing = "Picking...";
return(random(2,5));
}
if(System.currentTimeMillis() - lastAttack < 500) {
doing = "Attacking...";
return(random(2,5));
}
try {
if(getMyPlayer().getInteracting() != null) {
doing = "Fighting...";
return(random(2,5));
}
}
catch (final ArrayIndexOutOfBoundsException aiobe) {
return 5;
}
if(getMyPlayer().isMoving()) {
doing = "Moving...";
return(random(2,5));
}
else {
doing = "Absent...";
RSItemTile pickArrow = getGroundItemByID(6, arrowID);
RSItemTile pickCharm = getGroundItemByID(6, charmID);
RSItemTile pickGem = getGroundItemByID(6, gemID);
RSItemTile pickItem = getGroundItemByID(6, customID);
RSItemTile pickStack = getGroundItemByID(6, stackID);
RSItemTile pickBone = getGroundItemByID(6, boneID);
RSItemTile pickAmmo = getGroundItemByID(10, ammoID);
if(inventoryContains(vial)) {
atInventoryItem(vial, "Drop");
return(random(300,500));
}
if(isInventoryFull() && inventoryContains(boneID)) {
buryBones();
return(random(200,500));
}
if(System.currentTimeMillis() - lastArrowPick > 3000) {
if(canReach(pickArrow, false)) {
if(takeArrow == true && inventoryContains(arrowID) || getInventoryCount() < 28) {
pickUpArrow();
return(random(10,20));
}
}
}
if(System.currentTimeMillis() - lastCharmPick > 1000) {
if(canReach(pickCharm, false)) {
if(takeCharm == true && getInventoryCount() < 28) {
pickUpCharm();
return(random(10,20));
}
}
}
if(System.currentTimeMillis() - lastGemPick > 1000) {
if(canReach(pickGem, false)) {
if(takeGem == true && getInventoryCount() < 28) {
pickUpGem();
return(random(10,20));
}
}
}
if(System.currentTimeMillis() - lastItemPick > 1000) {
if(canReach(pickItem, false)) {
if(takeCustom == true && getInventoryCount() < 28) {
pickUpCustomItem();
return(random(10,20));
}
}
}
if(System.currentTimeMillis() - lastStackPick > 1000) {
if(canReach(pickStack, false)) {
if(takeStack == true && inventoryContains(stackID) || getInventoryCount() < 28) {
pickUpStackItem();
return(random(10,20));
}
}
}
if(takeAmmo) {
if(System.currentTimeMillis() - lastAmmoPick > 1000) {
if(canReach(pickAmmo, false)) {
if(inventoryContains(ammoID) || getInventoryCount() < 28) {
pickUpAmmo();
return(random(10,20));
}
}
}
}
if(System.currentTimeMillis() - lastBonePick > 1000) {
if(canReach(pickBone, false)) {
if(takeBone == true && getInventoryCount() < 28) {
pickUpBone();
return(random(10,20));
}
}
}
if(currentHP <= eatHP) {
eat();
return(random(10,20));
}
else {
if(getEnergy() > random(25,100)) {
setRun(true);
wait(random(10,20));
}
if(theNPC != null) {
if(getMyPlayer().getInteracting() == null && !getMyPlayer().isMoving()) {
if(!clickNPC(theNPC, "Attack")) {
return(random(750,1000));
}
else {
return(random(2,5));
}
}
}
else {
return(random(50,100));
}
}
return(random(50,100));
}
}
public boolean specFull() {
return(getSetting(300) == 1000);
}
public boolean specSelected() {
return(getSetting(301) ==1);
}
public int clickSpec() {
if(specFull() && !specSelected()) {
openTab(TAB_ATTACK);
wait(random(200,500));
clickMouse(650,423,20,5,true);
openTab(TAB_INVENTORY);
return(random(200,300));
}
return(random(5,10));
}
public boolean buryBones() {
doing = "Burying Bones...";
int inventoryCount = getInventoryCount();
int[] inventoryArray = getInventoryArray();
outer: for (int off = 0; off < inventoryArray.length; off++) {
if (inventoryArray[off] == -1) {
continue;
}
if (inventoryArray[off] != boneID) {
continue outer;
}
for (int tries = 0; tries < 30; tries++) {
eatItem(inventoryArray[off]);
wait(750);
if (getInventoryCount() < inventoryCount) {
break;
}
}
if (getInventoryCount() >= inventoryCount) {
return false;
}
inventoryArray = getInventoryArray();
inventoryCount = getInventoryCount();
}
return true;
}
public int downPotion() {
if(potion == strPot) {
if(inventoryContains(str1)) {
eatItem(str1);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(str2)) {
eatItem(str2);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(str3)) {
eatItem(str3);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(strPot)) {
eatItem(strPot);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
}
if(potion == supStrPot) {
if(inventoryContains(supStr1)) {
eatItem(supStr1);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(supStr2)) {
eatItem(supStr2);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(supStr3)) {
eatItem(supStr3);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(supStrPot)) {
eatItem(supStrPot);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
}
if(potion == rangePot) {
if(inventoryContains(range1)) {
eatItem(range1);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(range2)) {
eatItem(range2);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(range3)) {
eatItem(range3);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
if(inventoryContains(rangePot)) {
eatItem(rangePot);
lastPot = System.currentTimeMillis();
return(random(5,10));
}
}
return(random(5,10));
}
public int eat() {
if(inventoryContains(meat)) {
eatItem(meat);
return(random(10,20));
}
if(!foodIsChocCake && !foodIsCake) {
eatItem(food);
return(random(10,20));
}
if(foodIsChocCake) {
if(inventoryContains(chocCake1)) {
eatItem(chocCake1);
return(random(10, 20));
}
if(inventoryContains(chocCake2)) {
eatItem(chocCake2);
return(random(10, 20));
}
if(inventoryContains(chocCake3)) {
eatItem(chocCake3);
return(random(10, 20));
}
}
if(foodIsCake) {
if(inventoryContains(cake1)) {
eatItem(cake1);
return(random(10, 20));
}
if(inventoryContains(cake2)) {
eatItem(cake2);
return(random(10, 20));
}
if(inventoryContains(cake3)) {
eatItem(cake3);
return(random(10, 20));
}
}
return(random(10,20));
}
public int pickUpArrow() {
RSItemTile pickArrow = getGroundItemByID(6, arrowID);
if(canReach(pickArrow, false)) {
RSItemTile [] allArrows = getGroundItemsAt(pickArrow);
int listPosition = 0;
for (int i = 0; i < allArrows.length; i++) {
int currentArrow = allArrows[i].getItem().getID();
for (int itemArrow : arrowID) {
if (itemArrow == currentArrow) {
listPosition = (i);
break;
}
}
}
rightClickTile(pickArrow);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastArrowPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastArrowPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpCharm() {
RSItemTile pickCharm = getGroundItemByID(6, charmID);
if(canReach(pickCharm, false)) {
RSItemTile [] allCharms = getGroundItemsAt(pickCharm);
int listPosition = 0;
for (int i = 0; i < allCharms.length; i++) {
int currentCharm = allCharms[i].getItem().getID();
for (int itemCharm : charmID) {
if (itemCharm == currentCharm) {
listPosition = (i);
break;
}
}
}
rightClickTile(pickCharm);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastCharmPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastCharmPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpGem() {
RSItemTile pickGem = getGroundItemByID(6, gemID);
if(canReach(pickGem, false)) {
RSItemTile [] allGems = getGroundItemsAt(pickGem);
int listPosition = 0;
for (int i = 0; i < allGems.length; i++) {
int currentGem = allGems[i].getItem().getID();
for (int itemGem : gemID) {
if (itemGem == currentGem) {
listPosition = (i);
break;
}
}
}
rightClickTile(pickGem);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastGemPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastGemPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpCustomItem() {
RSItemTile pickItem = getGroundItemByID(6, customID);
if(canReach(pickItem, false)) {
RSItemTile [] allItems = getGroundItemsAt(pickItem);
int listPosition = 0;
for (int i = 0; i < allItems.length; i++) {
int currentItem = allItems[i].getItem().getID();
for (int itemCustom : customID) {
if (itemCustom == currentItem) {
listPosition = (i);
break;
}
}
}
rightClickTile(pickItem);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastItemPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastItemPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpStackItem() {
RSItemTile pickStack = getGroundItemByID(6, stackID);
if(canReach(pickStack, false)) {
RSItemTile [] allStack = getGroundItemsAt(pickStack);
int listPosition = 0;
for (int i = 0; i < allStack.length; i++) {
int currentStack = allStack[i].getItem().getID();
for (int itemStack : stackID) {
if (itemStack == currentStack) {
listPosition = (i);
break;
}
}
}
rightClickTile(pickStack);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastStackPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastStackPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpAmmo() {
ammoID = getEquipmentArray()[13];
RSItemTile pickAmmo = getGroundItemByID(10, ammoID);
if(canReach(pickAmmo, false)) {
RSItemTile [] allAmmo = getGroundItemsAt(pickAmmo);
int listPosition = 0;
for (int i = 0; i < allAmmo.length; i++) {
int currentAmmo = allAmmo[i].getItem().getID();
if (ammoID == currentAmmo) {
listPosition = (i);
break;
}
}
rightClickTile(pickAmmo);
wait(random(200,300));
if(!getMenuActions().contains("Take")) {
atMenu("Cancel");
lastAmmoPick = System.currentTimeMillis();
}
int menuPosition = 0;
int i = 0;
for (String menuItem : getMenuActions()) {
if (menuItem.contains("Take")) {
menuPosition = i;
break;
}
i++;
}
if(isMenuOpen()) {
atMenuItemCustom(menuPosition + listPosition);
lastAmmoPick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(1000,1500));
}
return(random(2,5));
}
return(random(2,5));
}
public int pickUpBone() {
RSItemTile pickBones = getGroundItemByID(6, boneID);
if(canReach(pickBones, false)) {
atTile(pickBones, "Take bones");
lastBonePick = System.currentTimeMillis();
lastPick = System.currentTimeMillis();
return(random(2,5));
}
return(random(2,5));
}
public boolean onPath(RSTile[] t){
for(int i = 0; i < t.length; i++ ){
if(distanceTo(t[i]) < 13){
return true;
}
}
return false;
}
public void bank() {
RSObject bankBooth = findObject(booth);
if(bankBooth != null) {
atObject(bankBooth, "Use-quickly");
if(getInterface(Constants.INTERFACE_BANK).isValid()) {
if(inventoryContains(fireRune) && inventoryContains(airRune) && inventoryContains(lawRune) && skills.getRealSkillLevel(STAT_MAGIC) > 24) {
bank.depositAllExcept(teleRunes);
wait(random(1000,2000));
}
if(inventoryContains(teleTab) && skills.getRealSkillLevel(STAT_MAGIC) > 24) {
bank.depositAllExcept(teleTab);
wait(random(1000,2000));
}
if((!inventoryContains(fireRune) || !inventoryContains(airRune) || !inventoryContains(lawRune) || skills.getRealSkillLevel(STAT_MAGIC) < 25)
&& (!inventoryContains(teleTab) || skills.getRealSkillLevel(STAT_MAGIC) < 25)) {
clickMouse(400,310,5,5,true);
wait(random(500,1000));
}
if(potion != 1) {
bankPotion();
wait(random(500,1000));
}
clickMouse(48,66,5,5,true);
wait(random(300,500));
if(Search) {
clickMouse(83,309,5,5,true);
wait(random(1000,2000));
if(foodIsTrout) {
sendText("trout", false);
}
if(foodIsSalmon) {
sendText("salmon", false);
}
if(foodIsLobster) {
sendText("lobster", false);
}
if(foodIsMonkfish) {
sendText("monkfish", false);
}
if(foodIsSwordfish) {
sendText("swordfish", false);
}
if(foodIsTuna) {
sendText("tuna", false);
}
if(foodIsChocCake) {
sendText("chocolate cake", false);
}
}
wait(random(2000,3000));
withdrawFood();
wait(random(1000,2000));
if(inventoryContains(food)) {
bank.close();
}
}
}
}
public void withdrawFood() {
clickMouse(53,112,5,5,false);
if(foodNum == 28) {
atMenu("Withdraw-All");
}
if(foodNum == 20) {
atMenu("Withdraw-10");
wait(random(500,750));
clickMouse(53,112,5,5,false);
atMenu("Withdraw-10");
}
if(foodNum == 15) {
atMenu("Withdraw-10");
wait(random(500,750));
clickMouse(53,112,5,5,false);
atMenu("Withdraw-5");
}
if(foodNum == 10) {
atMenu("Withdraw-10");
}
if(foodNum == 5) {
atMenu("Withdraw-5");
}
}
public void bankPotion() {
if(SearchPot) {
if(potion == strPot) {
clickMouse(83,309,5,5,true);
wait(random(1000,2000));
sendText("Strength Potion", false);
wait(random(500,1000));
}
if(potion == supStrPot) {
clickMouse(83,309,5,5,true);
wait(random(1000,2000));
sendText("Super Strength Potion", false);
wait(random(500,1000));
}
if(potion == rangePot) {
clickMouse(83,309,5,5,true);
wait(random(1000,2000));
sendText("Range Potion", false);
wait(random(500,1000));
}
moveMouse(53,112,5,5);
withdrawPot();
}
else {
moveMouse(97,112,5,5);
withdrawPot();
}
}
public void withdrawPot() {
if(potNum == 1) {
clickMouse(true);
}
if(potNum == 2) {
clickMouse(true);
wait(random(400,600));
clickMouse(true);
}
if(potNum == 3) {
clickMouse(true);
wait(random(400,600));
clickMouse(true);
wait(random(400,600));
clickMouse(true);
}
if(potNum == 4) {
clickMouse(true);
wait(random(400,600));
clickMouse(true);
wait(random(400,600));
clickMouse(true);
wait(random(400,600));
clickMouse(true);
}
if(potNum == 5) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-5");
}
if(potNum == 6) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-X");
wait(random(500,750));
sendText("6", true);
}
if(potNum == 7) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-X");
wait(random(500,750));
sendText("7", true);
}
if(potNum == 8) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-X");
wait(random(500,750));
sendText("8", true);
}
if(potNum == 9) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-X");
wait(random(500,750));
sendText("9", true);
}
if(potNum == 10) {
clickMouse(false);
wait(random(300,400));
atMenu("Withdraw-10");
}
}
public boolean walkTileMMCustom(final RSTile t) {
final Point p = tileToMinimap(t);
if (p.x == -1 || p.y == -1) {
return false;
}
clickMouse(p, 0, 0, true);
return true;
}
public void goFight() {
currentHP = skills.getCurrentSkillLevel(Constants.STAT_HITPOINTS);
RSObject downHole = findObject(hole);
//Areas
RSArea area1 = new RSArea(southWest1, northEast1);
RSArea area2 = new RSArea(southWest2, northEast2);
RSArea area3 = new RSArea(southWest3, northEast3);
RSArea area4 = new RSArea(southWest4, northEast4);
RSArea area5 = new RSArea(southWest5, northEast5);
RSArea area6 = new RSArea(southWest6, northEast6);
RSArea area7 = new RSArea(southWest7, northEast7);
RSArea area8A = new RSArea(southWest8A, northEast8A);
RSArea area8B = new RSArea(southWest8B, northEast8B);
RSArea area9 = new RSArea(southWest9, northEast9);
RSArea area10 = new RSArea(southWest10, northEast10);
RSArea area11 = new RSArea(southWest11, northEast11);
RSArea area12 = new RSArea(southWest12, northEast12);
RSArea area13 = new RSArea(southWest13, northEast13);
RSArea area14 = new RSArea(southWest14, northEast14);
RSArea area15 = new RSArea(southWest15, northEast15);
RSArea area16 = new RSArea(southWest16, northEast16);
RSArea area17 = new RSArea(southWest17, northEast17);
RSArea area18 = new RSArea(southWest18, northEast18);
RSArea area19 = new RSArea(southWest19, northEast19);
RSArea area20 = new RSArea(southWest20, northEast20);
RSArea area21 = new RSArea(southWest21, northEast21);
RSArea area22 = new RSArea(southWest22, northEast22);
RSArea area23 = new RSArea(southWest23, northEast23);
RSArea area24 = new RSArea(southWest24, northEast24);
RSArea area25 = new RSArea(southWest25, northEast25);
RSArea area26 = new RSArea(southWest26, northEast26);
RSArea area27 = new RSArea(southWest27, northEast27);
RSArea area28 = new RSArea(southWest28, northEast28);
RSArea area29 = new RSArea(southWest29, northEast29);
RSArea area30 = new RSArea(southWest30, northEast30);
RSArea area31 = new RSArea(southWest31, northEast31);
RSArea area32 = new RSArea(southWest32, northEast32);
RSArea area34 = new RSArea(southWest34, northEast34);
RSArea area34B = new RSArea(southWest34B, northEast34B);
RSArea area35 = new RSArea(southWest35, northEast35);
RSArea area37A = new RSArea(southWest37A, northEast37A);
RSArea area37B = new RSArea(southWest37B, northEast37B);
RSArea area38 = new RSArea(southWest38, northEast38);
RSArea area39 = new RSArea(southWest39, northEast39);
RSArea area40 = new RSArea(southWest40, northEast40);
RSArea area41 = new RSArea(southWest41, northEast41);
RSArea area42 = new RSArea(southWest42, northEast42);
RSArea area43A = new RSArea(southWest43A, northEast43A);
RSArea area43B = new RSArea(southWest43B, northEast43B);
RSArea area44 = new RSArea(southWest44, northEast44);
RSArea area45 = new RSArea(southWest45, northEast45);
RSArea areaHole1 = new RSArea(southWestHole, northEastHole);
RSArea areaHole2 = new RSArea(southWestHole2, northEastHole2);
//Wrong Areas
RSArea c11 = new RSArea(c1SW1, c1NE1);
RSArea c12 = new RSArea(c1SW2, c1NE2);
RSArea c21 = new RSArea(c2SW1, c2NE1);
RSArea c22 = new RSArea(c2SW2, c2NE2);
RSArea c31 = new RSArea(c3SW1, c3NE1);
RSArea c32 = new RSArea(c3SW2, c3NE2);
RSArea c41 = new RSArea(c4SW1, c4NE1);
RSArea c61 = new RSArea(c6SW1, c6NE1);
RSArea c71 = new RSArea(c7SW1, c7NE1);
RSArea c72 = new RSArea(c7SW2, c7NE2);
if(currentHP < eatHP2) {
eat();
wait(random(10,20));
}
if(cave1) {
if(distanceTo(weirdTile) < 3 && inventoryContains(food)) {
findDoor(DOOR_3, 'w');
wait(random(10,20));
}
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_1) >= 3 && inventoryContains(food)) {
walkTileMMCustom(DOOR_1);
wait(random(2000,3000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_1) < 3 && inventoryContains(food)) {
findDoor(DOOR_1, 'n');
wait(random(10,20));
}
if(area2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(DOOR_2, 'n');
wait(random(10,20));
}
if(area3.contains(getMyPlayer().getLocation()) && !tileOnScreen(DOOR_3) && inventoryContains(food)) {
walkPathMMCustom(door2To3, 13);
wait(random(2000,3000));
}
if(area3.contains(getMyPlayer().getLocation()) && tileOnScreen(DOOR_3) && inventoryContains(food)) {
findDoor(DOOR_3, 'w');
wait(random(20,30));
}
if(area4.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(DOOR_4, 'w');
wait(random(20,30));
}
if(c11.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c1wd1, 'n');
wait(random(10,20));
}
if(c12.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c1wd2, 'n');
wait(random(10,20));
}
}
if(cave2) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(door5) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door5);
wait(random(1000,2000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(door5) < 3 && inventoryContains(food)) {
findDoor(door5, 'n');
wait(random(10,20));
}
if(area7.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door6, 'n');
wait(random(10,20));
}
if(area8A.contains(getMyPlayer().getLocation()) || area8B.contains(getMyPlayer().getLocation()) && distanceTo(door7) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door7);
wait(random(2000,3000));
}
if(area8B.contains(getMyPlayer().getLocation()) && distanceTo(door7) < 3 && inventoryContains(food)) {
findDoor(door7, 'w');
wait(random(10,20));
}
if(area9.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door8, 'w');
wait(random(10,20));
}
if(c21.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c2wd1, 'w');
wait(random(10,20));
}
if(c22.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c2wd2, 'w');
wait(random(10,20));
}
}
if(cave3) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(door21) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door21);
wait(random(1000,2000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(door21) < 3 && inventoryContains(food)) {
findDoor(door21, 'n');
wait(random(10,20));
}
if(area30.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door22, 's');
wait(random(10,20));
}
if(area31.contains(getMyPlayer().getLocation()) && distanceTo(door23) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door23);
wait(random(1000,2000));
}
if(area31.contains(getMyPlayer().getLocation()) && distanceTo(door23) < 3 && inventoryContains(food)) {
findDoor(door23, 'e');
wait(random(10,20));
}
if(area32.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door24, 'w');
wait(random(10,20));
}
if(c31.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c3wd1, 'w');
wait(random(10,20));
}
if(c32.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c3wd2, 'w');
wait(random(10,20));
}
}
if(cave4) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder2Tile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) < 3 && inventoryContains(food)) {
atTile(ladder2Tile, "Climb-down");
wait(random(2000,3000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal2);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) < 3 && inventoryContains(food)) {
atTile(portal2, "Use");
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(door11) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door11);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(door11) < 3 && inventoryContains(food)) {
findDoor(door11, 'e');
wait(random(10,20));
}
if(area15.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door12, 'w');
wait(random(10,20));
}
if(area16.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkTileMMCustom(area17Tile);
wait(random(500,1000));
}
if(c41.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c4wd1, 'n');
wait(random(10,20));
}
}
if(cave5) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder2Tile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) < 3 && inventoryContains(food)) {
atTile(ladder2Tile, "Climb-down");
wait(random(2000,3000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal2);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) < 3 && inventoryContains(food)) {
atTile(portal2, "Use");
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && !area19.contains(getMyPlayer().getLocation()) && !area18.contains(getMyPlayer().getLocation()) && distanceTo(door13) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door13);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && !area19.contains(getMyPlayer().getLocation()) && !area18.contains(getMyPlayer().getLocation()) && distanceTo(door13) < 3 && inventoryContains(food)) {
findDoor(door13, 'e');
wait(random(10,20));
}
if(area18.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door14, 'w');
wait(random(10,20));
}
if(area19.contains(getMyPlayer().getLocation()) && distanceTo(door15) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door15);
wait(random(500,1000));
}
if(area19.contains(getMyPlayer().getLocation()) && distanceTo(door15) < 3 && inventoryContains(food)) {
findDoor(door15, 's');
wait(random(10,20));
}
if(area20.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door16, 'n');
wait(random(10,20));
}
if(area21.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkTileMMCustom(area22Tile);
wait(random(2000,3000));
}
}
if(cave6) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder2Tile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) < 3 && inventoryContains(food)) {
atTile(ladder2Tile, "Climb-down");
wait(random(2000,3000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal2);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) < 3 && inventoryContains(food)) {
atTile(portal2, "Use");
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && !area23.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkTileMMCustom(area23Tile);
wait(random(500,1000));
}
if(area23.contains(getMyPlayer().getLocation()) && distanceTo(door17) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door17);
wait(random(500,1000));
}
if(area23.contains(getMyPlayer().getLocation()) && distanceTo(door17) < 3 && inventoryContains(food)) {
findDoor(door17, 'n');
wait(random(10,20));
}
if(area24.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
setRun(true);
findDoor(door18, 's');
wait(random(10,20));
}
if(area25.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(area26Tile);
wait(random(500,1000));
}
if(area26.contains(getMyPlayer().getLocation()) && distanceTo(door19) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door19);
wait(random(500,1000));
}
if(area26.contains(getMyPlayer().getLocation()) && distanceTo(door19) < 3 && inventoryContains(food)) {
findDoor(door19, 'w');
wait(random(10,20));
}
if(area27.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door20, 'e');
wait(random(10,20));
}
if(c61.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c6wd1, 's');
wait(random(10,20));
}
}
if(cave7) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder2Tile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) < 3 && inventoryContains(food)) {
atTile(ladder2Tile, "Climb-down");
wait(random(2000,3000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal2);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) < 3 && inventoryContains(food)) {
atTile(portal2, "Use");
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(ladder4Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder4Tile);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(ladder4Tile) < 3 && inventoryContains(food)) {
atTile(ladder4Tile, "Climb-down");
wait(random(500,1000));
}
if(area34.contains(getMyPlayer().getLocation()) && distanceTo(door25) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door25);
wait(random(500,1000));
}
if(area34.contains(getMyPlayer().getLocation()) && distanceTo(door25) < 3 && inventoryContains(food)) {
findDoor(door25, 's');
wait(random(10,20));
}
if(area35.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door26, 's');
wait(random(10,20));
}
if(c71.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c7wd1, 'e');
wait(random(10,20));
}
if(c72.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(c7wd2, 'n');
wait(random(10,20));
}
}
if(cave8) {
if(onPath(bankToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(bankToHole, 13);
}
if(onPath(varrockToHole) && !areaHole2.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkPathMMCustom(varrockToHole, 13);
}
if(areaHole2.contains(getMyPlayer().getLocation()) && !areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
walkTileMMCustom(holeTile);
wait(random(300,500));
}
if(downHole != null && areaHole1.contains(getMyPlayer().getLocation()) && !getMyPlayer().isMoving() && inventoryContains(food)) {
atObject(downHole, "Climb-down");
wait(random(300,500));
}
if(distanceTo(portal1) < 20 && canReach(portal1, true) && inventoryContains(food)) {
if(distanceTo(portal1) >= 3) {
walkTileMMCustom(portal1);
wait(random(500,1000));
}
if(distanceTo(portal1) < 3) {
atTile(portal1, "Use");
wait(random(200,300));
}
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder2Tile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && distanceTo(ladder2Tile) < 3 && inventoryContains(food)) {
atTile(ladder2Tile, "Climb-down");
wait(random(2000,3000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal2);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(portal2) < 3 && inventoryContains(food)) {
atTile(portal2, "Use");
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(ladder4Tile) >= 3 && inventoryContains(food)) {
walkTileMMCustom(ladder4Tile);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(ladder4Tile) < 3 && inventoryContains(food)) {
atTile(ladder4Tile, "Climb-down");
wait(random(500,1000));
}
if(area34B.contains(getMyPlayer().getLocation()) && distanceTo(portal3) >= 3 && inventoryContains(food)) {
walkTileMMCustom(portal3);
wait(random(500,1000));
}
if(area34B.contains(getMyPlayer().getLocation()) && distanceTo(portal3) < 3 && inventoryContains(food)) {
atTile(portal3, "Use");
wait(random(10,20));
}
if(area37A.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkTileMMCustom(door27);
wait(random(500,1000));
}
if(area37B.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door27, 'w');
wait(random(500,1000));
}
if(area38.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door28, 'e');
wait(random(500,1000));
}
if(area39.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door29, 's');
wait(random(500,1000));
}
if(area40.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door30, 's');
wait(random(500,1000));
}
if(area41.contains(getMyPlayer().getLocation()) && distanceTo(door31) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door31);
wait(random(500,1000));
}
if(area41.contains(getMyPlayer().getLocation()) && distanceTo(door31) < 3 && inventoryContains(food)) {
findDoor(door31, 's');
wait(random(10,20));
}
if(area42.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door32, 's');
wait(random(500,1000));
}
if(area43A.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
walkTileMMCustom(door33);
wait(random(500,1000));
}
if(area43B.contains(getMyPlayer().getLocation()) && distanceTo(door33) >= 3 && inventoryContains(food)) {
walkTileMMCustom(door33);
wait(random(500,1000));
}
if(area43B.contains(getMyPlayer().getLocation()) && distanceTo(door33) < 3 && inventoryContains(food)) {
findDoor(door33, 's');
wait(random(10,20));
}
if(area44.contains(getMyPlayer().getLocation()) && inventoryContains(food)) {
findDoor(door34, 's');
wait(random(500,1000));
}
}
}
public void goBank() {
RSObject downHole = findObject(hole);
RSArea area1 = new RSArea(southWest1, northEast1);
RSArea area2 = new RSArea(southWest2, northEast2);
RSArea area3 = new RSArea(southWest3, northEast3);
RSArea area4 = new RSArea(southWest4, northEast4);
RSArea area5 = new RSArea(southWest5, northEast5);
RSArea area6 = new RSArea(southWest6, northEast6);
RSArea area7 = new RSArea(southWest7, northEast7);
RSArea area8A = new RSArea(southWest8A, northEast8A);
RSArea area8B = new RSArea(southWest8B, northEast8B);
RSArea area9 = new RSArea(southWest9, northEast9);
RSArea area10 = new RSArea(southWest10, northEast10);
RSArea area11 = new RSArea(southWest11, northEast11);
RSArea area12 = new RSArea(southWest12, northEast12);
RSArea area13 = new RSArea(southWest13, northEast13);
RSArea area14 = new RSArea(southWest14, northEast14);
RSArea area15 = new RSArea(southWest15, northEast15);
RSArea area16 = new RSArea(southWest16, northEast16);
RSArea area17 = new RSArea(southWest17, northEast17);
RSArea area18 = new RSArea(southWest18, northEast18);
RSArea area19 = new RSArea(southWest19, northEast19);
RSArea area20 = new RSArea(southWest20, northEast20);
RSArea area21 = new RSArea(southWest21, northEast21);
RSArea area22 = new RSArea(southWest22, northEast22);
RSArea area23 = new RSArea(southWest23, northEast23);
RSArea area24 = new RSArea(southWest24, northEast24);
RSArea area25 = new RSArea(southWest25, northEast25);
RSArea area26 = new RSArea(southWest26, northEast26);
RSArea area27 = new RSArea(southWest27, northEast27);
RSArea area28 = new RSArea(southWest28, northEast28);
RSArea area29 = new RSArea(southWest29, northEast29);
RSArea area30 = new RSArea(southWest30, northEast30);
RSArea area31 = new RSArea(southWest31, northEast31);
RSArea area32 = new RSArea(southWest32, northEast32);
RSArea area33A = new RSArea(southWest33A, northEast33A);
RSArea area33B = new RSArea(southWest33B, northEast33B);
RSArea area33C = new RSArea(southWest33C, northEast33C);
RSArea area34 = new RSArea(southWest34, northEast34);
RSArea area34B = new RSArea(southWest34B, northEast34B);
RSArea area35 = new RSArea(southWest35, northEast35);
RSArea area36A = new RSArea(southWest36A, northEast36A);
RSArea area36B = new RSArea(southWest36B, northEast36B);
RSArea area37A = new RSArea(southWest37A, northEast37A);
RSArea area37B = new RSArea(southWest37B, northEast37B);
RSArea area38 = new RSArea(southWest38, northEast38);
RSArea area39 = new RSArea(southWest39, northEast39);
RSArea area40 = new RSArea(southWest40, northEast40);
RSArea area41 = new RSArea(southWest41, northEast41);
RSArea area42 = new RSArea(southWest42, northEast42);
RSArea area43A = new RSArea(southWest43A, northEast43A);
RSArea area43B = new RSArea(southWest43B, northEast43B);
RSArea area44 = new RSArea(southWest44, northEast44);
RSArea area45 = new RSArea(southWest45, northEast45);
if(inventoryContains(fireRune) && inventoryContains(airRune) && inventoryContains(lawRune) && skills.getRealSkillLevel(STAT_MAGIC) > 24 && !onPath(fountainToBank)) {
doing = "Teleporting...";
teleVarrock();
}
if(inventoryContains(lawRune) && skills.getRealSkillLevel(STAT_MAGIC) > 24 && !onPath(fountainToBank)) {
doing = "Teleporting...";
teleTabVarrock();
}
if(onPath(fountainToBank)) {
doing = "Walking To Bank...";
if(getCurrentTab() != Constants.TAB_INVENTORY) {
openTab(Constants.TAB_INVENTORY);
wait(random(200,300));
}
walkPathMMCustom(fountainToBank, 13);
}
else {
doing = "Walking To Bank...";
if(cave1) {
if(area5.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_4) > 2 && !inventoryContains(food)) {
walkTileMMCustom(DOOR_4);
wait(random(2000,3000));
}
if(area5.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_4) < 3 && !inventoryContains(food)) {
findDoor(DOOR_4, 'w');
wait(random(10,20));
}
if(area4.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(DOOR_3, 'w');
wait(random(10,20));
}
if(area3.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_2) > 2 && !inventoryContains(food)) {
walkPathMMCustom(door3To2, 13);
wait(random(2000,3000));
}
if(area3.contains(getMyPlayer().getLocation()) && distanceTo(DOOR_2) < 3 && !inventoryContains(food)) {
findDoor(DOOR_2, 'n');
wait(random(10,20));
}
if(area2.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(DOOR_1, 'n');
wait(random(10,20));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(NEXT_TO_LADDER1);
wait(random(2000,3000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(2000,3000));
}
if(onPath(holeToBank) || distanceTo(downHole) < 5 && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave2) {
if(area10.contains(getMyPlayer().getLocation()) && distanceTo(door9) < 3 && !inventoryContains(food)) {
findDoor(door9, 'w');
wait(random(10,20));
}
if(area11.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door10, 'w');
wait(random(10,20));
}
if(area12.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
if(distanceTo(chain1Tile) < 3) {
atTile(chain1Tile, "Climb-up");
wait(random(1000,2000));
}
else {
walkTileMMCustom(chain1Tile);
wait(random(300,500));
}
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 5 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(2000,3000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
else {
if (area10.contains(getMyPlayer().getLocation()) && distanceTo(door9) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door9);
wait(random(1000,2000));
}
}
}
if(cave3) {
if(area33C.contains(getMyPlayer().getLocation()) && distanceTo(cave3Tile2) >= 15 && !inventoryContains(food)) {
walkTileMMCustom(cave3Tile3);
wait(random(500,1000));
}
if(area33C.contains(getMyPlayer().getLocation()) && distanceTo(cave3Tile2) < 15 && !inventoryContains(food)) {
walkTileMMCustom(cave3Tile2);
wait(random(500,1000));
}
if(area33B.contains(getMyPlayer().getLocation()) && distanceTo(cave3Tile1) >= 15 && !inventoryContains(food)) {
walkTileMMCustom(cave3Tile2);
wait(random(500,1000));
}
if(area33B.contains(getMyPlayer().getLocation()) && distanceTo(cave3Tile1) < 15 && !inventoryContains(food)) {
walkTileMMCustom(cave3Tile1);
wait(random(500,1000));
}
if(area33A.contains(getMyPlayer().getLocation()) && distanceTo(door24) >= 3 && !inventoryContains(food)) {
walkTileMMCustom(door24);
wait(random(500,1000));
}
if(area33A.contains(getMyPlayer().getLocation()) && distanceTo(door24) < 3 && !inventoryContains(food)) {
findDoor(door24, 'w');
wait(random(10,20));
}
if(area32.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door23, 'e');
wait(random(10,20));
}
if(area31.contains(getMyPlayer().getLocation()) && distanceTo(door22) >= 3 && !inventoryContains(food)) {
walkTileMMCustom(door22);
wait(random(500,1000));
}
if(area31.contains(getMyPlayer().getLocation()) && distanceTo(door22) < 3 && !inventoryContains(food)) {
findDoor(door22, 's');
wait(random(10,20));
}
if(area30.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door21, 'n');
wait(random(10,20));
}
if(area6.contains(getMyPlayer().getLocation()) && !tileOnScreen(ladder1bTile) && !inventoryContains(food)) {
walkTileMMCustom(ladder1bTile);
wait(random(500,1000));
}
if(area6.contains(getMyPlayer().getLocation()) && tileOnScreen(ladder1bTile) && !inventoryContains(food)) {
atTile(ladder1bTile, "Climb-up");
wait(random(500,1000));
}
if(getMyPlayer().getLocation() == (weirdTile2) && !inventoryContains(food)) {
walkTileMMCustom(ladder1bTile);
wait(random(500,1000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave4) {
if(area17.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
walkTileMMCustom(area16Tile);
wait(random(500,1000));
}
if(area16.contains(getMyPlayer().getLocation()) && distanceTo(door12) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door12);
wait(random(500,1000));
}
if(area16.contains(getMyPlayer().getLocation()) && distanceTo(door12) < 3 && !inventoryContains(food)) {
findDoor(door12, 'w');
wait(random(10,20));
}
if(area15.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door11, 'e');
wait(random(10,20));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(chain2Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(chain2Tile);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && distanceTo(chain2Tile) < 3 && !inventoryContains(food)) {
atTile(chain2Tile, "Climb-up");
wait(random(1000,2000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder3Tile);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) < 3 && !inventoryContains(food)) {
atTile(ladder3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder1Tile);
wait(random(500,1000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(1000,2000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave5) {
if(area22.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
walkTileMMCustom(area21Tile);
wait(random(500,1000));
}
if(area21.contains(getMyPlayer().getLocation()) && distanceTo(door16) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door16);
wait(random(500,1000));
}
if(area21.contains(getMyPlayer().getLocation()) && distanceTo(door16) < 3 && !inventoryContains(food)) {
findDoor(door16, 'n');
wait(random(10,20));
}
if(area20.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door15, 's');
wait(random(10,20));
}
if(area19.contains(getMyPlayer().getLocation()) && distanceTo(door14) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door14);
wait(random(500,1000));
}
if(area19.contains(getMyPlayer().getLocation()) && distanceTo(door14) < 3 && !inventoryContains(food)) {
findDoor(door14, 'w');
wait(random(10,20));
}
if(area18.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door13, 'e');
wait(random(10,20));
}
if(area14.contains(getMyPlayer().getLocation()) && !area19.contains(getMyPlayer().getLocation()) && !area18.contains(getMyPlayer().getLocation()) && distanceTo(door13) < 2 && !inventoryContains(food)) {
walkTileMMCustom(area14Tile);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && !area19.contains(getMyPlayer().getLocation()) && !area18.contains(getMyPlayer().getLocation()) && distanceTo(chain2Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(chain2Tile);
wait(random(500,1000));
}
if(area14.contains(getMyPlayer().getLocation()) && !area19.contains(getMyPlayer().getLocation()) && !area18.contains(getMyPlayer().getLocation()) && distanceTo(chain2Tile) < 3 && !inventoryContains(food)) {
atTile(chain2Tile, "Climb-up");
wait(random(1000,2000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder3Tile);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) < 3 && !inventoryContains(food)) {
atTile(ladder3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder1Tile);
wait(random(500,1000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(1000,2000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave6) {
if((area28.contains(getMyPlayer().getLocation()) || area29.contains(getMyPlayer().getLocation())) && distanceTo(door20) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door20);
wait(random(1000,2000));
}
if(area28.contains(getMyPlayer().getLocation()) && distanceTo(door20) < 3 && !inventoryContains(food)) {
findDoor(door20, 'e');
wait(random(10,20));
}
if(area27.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door19, 'w');
wait(random(10,20));
}
if(area26.contains(getMyPlayer().getLocation()) && distanceTo(chain3Tile) > 2 && !getMyPlayer().isMoving() && !inventoryContains(food)) {
walkTileMMCustom(chain3Tile);
wait(random(1000,2000));
}
if(area26.contains(getMyPlayer().getLocation()) && distanceTo(chain3Tile) < 3 && !inventoryContains(food)) {
atTile(chain3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder3Tile);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) < 3 && !inventoryContains(food)) {
atTile(ladder3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder1Tile);
wait(random(500,1000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(1000,2000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave7) {
if(area36B.contains(getMyPlayer().getLocation()) && !area36A.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
walkTileMMCustom(cave7Tile);
wait(random(500,1000));
}
if(area36A.contains(getMyPlayer().getLocation()) && distanceTo(door26) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door26);
wait(random(500,1000));
}
if(area36A.contains(getMyPlayer().getLocation()) && distanceTo(door26) < 3 && !inventoryContains(food)) {
findDoor(door26, 's');
wait(random(10,20));
}
if(area35.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door25, 's');
wait(random(10,20));
}
if(area34.contains(getMyPlayer().getLocation()) && distanceTo(ladder5Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder5Tile);
wait(random(500,1000));
}
if(area34.contains(getMyPlayer().getLocation()) && distanceTo(ladder5Tile) < 3 && !inventoryContains(food)) {
atTile(ladder5Tile, "Climb-up");
wait(random(1000,2000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder3Tile);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) < 3 && !inventoryContains(food)) {
atTile(ladder3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder1Tile);
wait(random(500,1000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(1000,2000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
if(cave8) {
if(area45.contains(getMyPlayer().getLocation()) && distanceTo(door34) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door34);
wait(random(500,1000));
}
if(area45.contains(getMyPlayer().getLocation()) && distanceTo(door34) < 3 && !inventoryContains(food)) {
findDoor(door34, 's');
wait(random(10,20));
}
if(area44.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door33, 's');
wait(random(10,20));
}
if(area43B.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
walkTileMMCustom(door32);
wait(random(500,1000));
}
if(area43A.contains(getMyPlayer().getLocation()) && distanceTo(door32) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door32);
wait(random(500,1000));
}
if(area43A.contains(getMyPlayer().getLocation()) && distanceTo(door32) < 3 && !inventoryContains(food)) {
findDoor(door32, 's');
wait(random(10,20));
}
if(area42.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door31, 's');
wait(random(10,20));
}
if(area41.contains(getMyPlayer().getLocation()) && distanceTo(door30) > 2 && !inventoryContains(food)) {
walkTileMMCustom(door30);
wait(random(500,1000));
}
if(area41.contains(getMyPlayer().getLocation()) && distanceTo(door30) < 3 && !inventoryContains(food)) {
findDoor(door30, 's');
wait(random(10,20));
}
if(area40.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door29, 's');
wait(random(10,20));
}
if(area39.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door28, 'e');
wait(random(10,20));
}
if(area38.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
findDoor(door27, 'w');
wait(random(10,20));
}
if(area37B.contains(getMyPlayer().getLocation()) && !inventoryContains(food)) {
walkTileMMCustom(chain4Tile);
wait(random(500,1000));
}
if(area37A.contains(getMyPlayer().getLocation()) && distanceTo(chain4Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(chain4Tile);
wait(random(500,1000));
}
if(area37A.contains(getMyPlayer().getLocation()) && distanceTo(chain4Tile) < 3 && !inventoryContains(food)) {
atTile(chain4Tile, "Climb-up");
wait(random(10,20));
}
if(area34B.contains(getMyPlayer().getLocation()) && distanceTo(ladder5Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder5Tile);
wait(random(500,1000));
}
if(area34B.contains(getMyPlayer().getLocation()) && distanceTo(ladder5Tile) < 3 && !inventoryContains(food)) {
atTile(ladder5Tile, "Climb-up");
wait(random(1000,2000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder3Tile);
wait(random(500,1000));
}
if(area13.contains(getMyPlayer().getLocation()) && distanceTo(ladder3Tile) < 3 && !inventoryContains(food)) {
atTile(ladder3Tile, "Climb-up");
wait(random(1000,2000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) > 2 && !inventoryContains(food)) {
walkTileMMCustom(ladder1Tile);
wait(random(500,1000));
}
if(area1.contains(getMyPlayer().getLocation()) && distanceTo(ladder1Tile) < 3 && !inventoryContains(food)) {
atTile(ladder1Tile, "Climb-up");
wait(random(1000,2000));
}
if(onPath(holeToBank) && !inventoryContains(food)) {
walkPathMMCustom(holeToBank, 13);
}
}
}
}
public int teleVarrock() {
openTab(TAB_MAGIC);
wait(random(200,300));
clickMouse(620,278,2,2,true);
return(random(200,300));
}
public int teleTabVarrock() {
atInventoryItem(teleTab, "Break");
return(random(200,300));
}
public boolean findDoor(RSTile t, char direction) {
RSObject theDoor = getObjectAt(t);
if(theDoor == null)
return false;
switch(direction) {
case 'n':
return atDoorTiles(theDoor.getLocation(), new RSTile(theDoor.getLocation().getX(), theDoor.getLocation().getY() + 1));
case 'w':
return atDoorTiles(theDoor.getLocation(), new RSTile(theDoor.getLocation().getX() - 1, theDoor.getLocation().getY()));
case 'e':
return atDoorTiles(theDoor.getLocation(), new RSTile(theDoor.getLocation().getX() + 1, theDoor.getLocation().getY()));
case 's':
return atDoorTiles(theDoor.getLocation(), new RSTile(theDoor.getLocation().getX(), theDoor.getLocation().getY() - 1));
default:
log("Invalid door direction char");
}
return false;
}
private long lastTry = 0;
private int tryCount = 0;
private RSTile lastDoor = null;
public boolean atDoorTiles(RSTile a, RSTile b) {
if(a != lastDoor) {
lastTry = 0;
tryCount = 0;
lastDoor = a;
}
tryCount++;
if(System.currentTimeMillis() - lastTry > random(2000, 4000)) {
tryCount = 1;
}
lastTry = System.currentTimeMillis();
if(tryCount > 4) {
if(random(1,2) < random(1,2))
setCameraRotation(getCameraAngle() + ((random(0, 9) < random(6, 8)) ? (random(-20, 20)) : (random(-360, 360))));
if(random(1,2) < random(1,2))
setCameraAltitude(random(0, 100));
}
if(tryCount > 100) {
log("Problems finding door....");
stopAllScripts();
}
else {
ArrayList<RSTile> theObjs = new ArrayList<RSTile>();
theObjs.add(a);
theObjs.add(b);
try {
Point[] thePoints = new Point[theObjs.size()];
for(int c = 0; c < theObjs.size(); c++) {
thePoints[c] = Calculations.tileToScreen(theObjs.get(c));
}
float xTotal = 0;
float yTotal = 0;
for(int c = 0; c < thePoints.length; c++) {
xTotal += thePoints[c].getX();
yTotal += thePoints[c].getY();
}
Point location = new Point((int)(xTotal / (float)thePoints.length), (int)(yTotal / (float)thePoints.length) - random(0, 40));
if (location.x == -1 || location.y == -1) {
return false;
}
if(Math.sqrt(Math.pow((getMouseLocation().getX() - location.getX()), 2) + Math.pow((getMouseLocation().getY() - location.getY()), 2)) < random(20, 30)) {
ArrayList<String> commands = getMenuItems();
for(int c = 0; c < commands.size(); c++) {
if(commands.get(c).contains("Open")) {
if(atMenu("Open")) {
wait(random(1000,2000));
lastTry = 0;
tryCount = 0;
return true;
}
}
}
}
moveMouse(location, 7, 7);
if(atMenu("Open")) {
wait(random(1000,2000));
lastTry = 0;
tryCount = 0;
return true;
}
} catch (final Exception e) {
return false;
}
}
return false;
}
public boolean rightClickTile(final RSTile tile) {
try {
final Point location = Calculations.tileToScreen(tile);
if (location.x == -1 || location.y == -1) {
return false;
}
moveMouse(location, 3, 3);
clickMouse(false);
wait(random(50,100));
return true;
} catch (final Exception e) {
return false;
}
}
public boolean atMenuItemCustom(final int i) {
if (!isMenuOpen()) {
return false;
}
try {
final RSTile menu = getMenuLocation();
final int xOff = random(4, getMenuItems().get(i).length() * 4);
final int yOff = random(24, 28) + (15 * i);
moveMouse(menu.getX() + xOff, menu.getY() + yOff, 2, 2);
if (!isMenuOpen()) {
return false;
}
clickMouse(true);
return true;
} catch (final Exception e) {
e.printStackTrace();
return false;
}
}
public boolean atNPCCustom(final RSNPC npc, final String action) {
if (npc == null) {
return false;
}
final RSTile tile = npc.getLocation();
if (!tile.isValid()) {
return false;
}
if (distanceTo(tile) > 5) {
walkTileMM(tile);
}
return clickRSNPCCustom(npc, action);
}
public boolean clickRSNPCCustom(final RSNPC npc, final String action) {
try {
int a;
final String fullCommand = action + " " + npc.getName();
for (a = 10; a-- >= 0;) {
final List<String> menuItems = getMenuItems();
if (menuItems.size() > 1) {
if (listContainsString(menuItems, fullCommand)) {
if (menuItems.get(0).contains(fullCommand)) {
clickMouse(true);
return true;
} else {
return atMenuCustom(fullCommand);
}
}
}
final Point screenLoc = npc.getScreenLocation();
if (!pointOnScreen(screenLoc)) {
return false;
}
moveMouse(screenLoc);
}
return false;
} catch (final Exception e) {
e.printStackTrace();
return false;
}
}
public boolean atMenuCustom(final String optionContains) {
int idx = getMenuIndex(optionContains);
if (!isMenuOpen()) {
if (idx == -1) {
return false;
}
if (idx == 0) {
clickMouse(true);
} else {
clickMouse(false);
atMenuItemCustom(idx);
}
return true;
} else {
if (idx == -1) {
idx = getMenuIndex("Cancel");
atMenuItemCustom(idx);
return false;
} else {
atMenuItemCustom(idx);
return true;
}
}
}
private boolean listContainsString(final List<String> list, final String string) {
try {
for(String command : list) {
if(command.contains(string)) {
return true;
}
}
} catch (final Exception e) {
e.printStackTrace();
}
return false;
}
public void onRepaint(Graphics g) {
long millis = System.currentTimeMillis() - startTime;
long hours = millis / (1000 * 60 * 60);
millis -= hours * 1000 * 60 * 60;
long minutes = millis / (1000 * 60);
millis -= minutes * 1000 * 60;
long seconds = millis / 1000;
int XPChangeAttack = skills.getCurrentSkillExp(0) - startXPAttack;
int LevelChangeAttack = skills.getRealSkillLevel(0) - startLevelAttack;
int XPChangeDefense = skills.getCurrentSkillExp(1) - startXPDefense;
int LevelChangeDefense = skills.getRealSkillLevel(1) - startLevelDefense;
int XPChangeStrength = skills.getCurrentSkillExp(2) - startXPStrength;
int LevelChangeStrength = skills.getRealSkillLevel(2) - startLevelStrength;
int XPChangeHP = skills.getCurrentSkillExp(3) - startXPHP;
int LevelChangeHP = skills.getRealSkillLevel(3) - startLevelHP;
int XPChangeRange = skills.getCurrentSkillExp(4) - startXPRange;
int LevelChangeRange = skills.getRealSkillLevel(4) - startLevelRange;
int x = 330;
int y = 200;
if(skills.getCurrentSkillExp(0) > startXPAttack) {
skill = 0;
skillName = "Attack";
xpChange = XPChangeAttack;
lvlChange = LevelChangeAttack;
startLevel = startLevelAttack;
}
if(skills.getCurrentSkillExp(1) > startXPDefense) {
skill = 1;
skillName = "Defense";
xpChange = XPChangeDefense;
lvlChange = LevelChangeDefense;
startLevel = startLevelDefense;
}
if(skills.getCurrentSkillExp(2) > startXPStrength) {
skill = 2;
skillName = "Strength";
xpChange = XPChangeStrength;
lvlChange = LevelChangeStrength;
startLevel = startLevelStrength;
}
if(skills.getCurrentSkillExp(4) > startXPRange) {
skill = 4;
skillName = "Range";
xpChange = XPChangeRange;
lvlChange = LevelChangeRange;
startLevel = startLevelRange;
}
g.setColor(new Color(0, 0, 0, 175));
g.fillRoundRect(330, 200, 185, 135, 10, 10);
g.fillRoundRect(365, 0, 150, 20, 10, 10);
g.fillRoundRect(387, 20, 128, 20, 10, 10);
g.setColor(Color.red);
g.drawString ("Stronghold Of Security", x + 32,y += 15);
g.setColor(Color.yellow);
g.drawString("Run Time: " + hours + " : " + minutes + " : " + seconds, x + 10, y += 22);
g.drawString(skillName + " level " + skills.getRealSkillLevel(skill) + " (Gained " + + lvlChange + " )", x + 10, y += 15);
g.drawString("Gained: " + skillName + " exp : " + xpChange, x + 10, y += 15);
g.drawString("% Left To Level " + skillName + ": " + (100 - skills.getPercentToNextLevel(skill)) + "%", x + 10, y += 15);
g.drawString(skillName + " Exp/hour : " + (int) ((xpChange) * (3600000D / (((double) System.currentTimeMillis() - (double) startTime)))), 368,15);
g.drawString("Hitpoints lvl: " + skills.getRealSkillLevel(STAT_HITPOINTS), x + 10, y += 15);
g.drawString("Hp Exp Gained: " + XPChangeHP, x + 10, y += 15);
g.drawString("% Left To Level HP: " + (100 - skills.getPercentToNextLevel(STAT_HITPOINTS)) + "%", x + 10, y += 15);
g.drawString(doing, 390, 35);
}
public boolean clickNPC(final RSNPC npc, final String action) {
try {
int a;
final StringBuffer npcCommandBuf = new StringBuffer();
npcCommandBuf.append(action);
npcCommandBuf.append(" ");
npcCommandBuf.append(npc.getName());
final String npcCommand = npcCommandBuf.toString();
for (a = 10; a-- >= 0;) {
final List<String> menuItems = getMenuItems();
if (menuItems.size() > 1) {
if (listContainsString(menuItems, npcCommand)) {
if (menuItems.get(0).contains(npcCommand)) {
clickMouse(true);
lastAttack = System.currentTimeMillis();
return true;
}
else {
// clickMouse(false);
wait(random(230, 520));
lastAttack = System.currentTimeMillis();
return atMenu(npcCommand);
}
}
}
final Point screenLoc = npc.getScreenLocation();
if (!pointOnScreen(screenLoc)) {
walkTileMMCustom(npc.getLocation());
return false;
}
final Point randomP = new Point(random(screenLoc.x - 15,
screenLoc.x + 15), random(screenLoc.y - 15,
screenLoc.y + 15));
if (randomP.x >= 0 && randomP.y >= 0) {
moveMouse(randomP);
}
}
return false;
} catch (final Exception e) {
return false;
}
}
public boolean atInventoryItemCustom(final int itemID, final String option) {
if (getCurrentTab() != Constants.TAB_INVENTORY
&& !RSInterface.getInterface(Constants.INTERFACE_BANK)
.isValid()
&& !RSInterface.getInterface(Constants.INTERFACE_STORE)
.isValid()) {
openTab(Constants.TAB_INVENTORY);
}
final int[] items = getInventoryArray();
final java.util.List<Integer> possible = new ArrayList<Integer>();
for (int i = 0; i < items.length; i++) {
if (items[i] == itemID) {
possible.add(i);
}
}
final int idx = possible.get(random(0, possible.size()));
final Point t = getInventoryItemPoint(idx);
moveMouse(t, 5, 5);
return atMenu(option);
}
@Override
public void onFinish() {
Bot.getEventManager().removeListener(PaintListener.class, this);
}
public boolean walkPathMMCustom(final RSTile[] path, final int maxDist) {
try {
final RSTile next = nextTile(path, maxDist);
if (next != null) {
walkTileMMCustom(next);
current = next;
wait(random(1000,2000));
return false;
} else if (next != null && next.equals(current)) {
return false;
}
} catch (final Exception e) {
return false;
}
return true;
}
private static RSTile current = new RSTile(0, 0);
private boolean isMeInCombat() {
if(interactingWithMe() != null) {
return true;
}
return false;
}
RSNPC interactingWithMe() {
int Dist = 10;
RSNPC npc = null;
NPC[] npcs = Bot.getClient().getNPCArray();
int[] validNPCs = Bot.getClient().getNPCIndexArray();
for (int element : validNPCs) {
if (npcs[element] == null)
continue;
RSNPC Monster = new RSNPC(npcs[element]);
try {
if(Monster.getHPPercent() < 1)
continue;
if(Monster.isInteractingWithLocalPlayer() && canAttack(Monster) && getMyPlayer().isInCombat()) {
int distance = distanceTo(Monster);
if (distance < Dist) {
Dist = distance;
npc = Monster;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
return npc;
}
boolean canAttack(RSNPC NPC) {
for(int x = 0; x < NPC.getActions().length; x++) {
if (NPC.getActions()[x] != null) {
if(NPC.getActions()[x].toLowerCase().contains("attack")) {
return true;
}
}
}
return false;
}
public int eatItem(final int itemID) {
if (getCurrentTab() != Constants.TAB_INVENTORY
&& !RSInterface.getInterface(Constants.INTERFACE_BANK)
.isValid()
&& !RSInterface.getInterface(Constants.INTERFACE_STORE)
.isValid()) {
openTab(Constants.TAB_INVENTORY);
}
final int[] items = getInventoryArray();
final java.util.List<Integer> possible = new ArrayList<Integer>();
for (int i = 0; i < items.length; i++) {
if (items[i] == itemID) {
possible.add(i);
}
}
if (possible.size() == 0) {
return(random(5,10));
}
final int idx = possible.get(0);
final Point t = getInventoryItemPoint(idx);
while(lastEat < (System.currentTimeMillis() - 2000)) {
moveMouse(t, 5, 5);
clickMouse(true);
lastEat = System.currentTimeMillis();
return(random(5,10));
}
return(random(5,10));
}
public void openURL(final String url) {
final String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS")) {
final Class<?> fileMgr = Class
.forName("com.apple.eio.FileManager");
final 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 {
final 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 (final Exception e) {
}
}
public RSNPC getNearestFreeReachableNPCByID(final int... ids) {
int Dist = 20;
RSNPC closest = null;
final int[] validNPCs = Bot.getClient().getNPCIndexArray();
final NPC[] npcs = Bot.getClient().getNPCArray();
for (final int element : validNPCs) {
if (npcs[element] == null) {
continue;
}
final RSNPC Monster = new RSNPC(npcs[element]);
try {
for (final int id : ids) {
if (id != Monster.getID() || Monster.isInCombat() || !canReach(Monster, false)) {
continue;
}
final int distance = distanceTo(Monster);
if (distance < Dist) {
Dist = distance;
closest = Monster;
}
}
} catch (final Exception e) {
// e.printStackTrace(); TODO: Why?
}
}
return closest;
}
public RSNPC getNearestReachableNPCByID(final int... ids) {
int Dist = 20;
RSNPC closest = null;
final int[] validNPCs = Bot.getClient().getNPCIndexArray();
final NPC[] npcs = Bot.getClient().getNPCArray();
for (final int element : validNPCs) {
if (npcs[element] == null) {
continue;
}
final RSNPC Monster = new RSNPC(npcs[element]);
try {
for (final int id : ids) {
if (id != Monster.getID() || !canReach(Monster, false)) {
continue;
}
final int distance = distanceTo(Monster);
if (distance < Dist) {
Dist = distance;
closest = Monster;
}
}
} catch (final Exception e) {
// e.printStackTrace(); TODO: Why?
}
}
return closest;
}
}