What Scripts should i use for this account..?

Discussion in 'RuneScape 3 Cheating' started by IHI A D E S, Jan 2, 2009.

What Scripts should i use for this account..?
  1. Unread #1 - Jan 2, 2009 at 9:08 PM
  2. IHI A D E S
    Joined:
    Nov 15, 2008
    Posts:
    471
    Referrals:
    0
    Sythe Gold:
    0

    IHI A D E S Forum Addict
    Banned

    What Scripts should i use for this account..?

    Hello i know there are posts like this but i am looking for scripts that will help get some of my stats to 99. I will be using the Rsbot. First off heres the stats id like to get to 99.

    Woodcutting (My wc lvl is currently 91)

    Strength (Currently 83)

    Fishing (Currently 79)

    Cooking (Currently 83)

    Mining (Currently 68)


    This is one of my old accounts and i dont really care if it gets banned. Im basically just looking for good scripts that will be effective for these stats and for my lvls. So if you would post here with links to the script and the name i would really appreciate it. Thanks :]
     
  3. Unread #2 - Jan 3, 2009 at 12:36 AM
  4. Fromaaz
    Joined:
    Mar 21, 2008
    Posts:
    645
    Referrals:
    1
    Sythe Gold:
    0

    Fromaaz Apprentice
    Banned

    What Scripts should i use for this account..?

    Do you know what the search function is? Try the RSBot website. They have specific sub-forums for all of the above.

    You could have found them all in the time it takes to make this post.
     
  5. Unread #3 - Jan 3, 2009 at 12:49 AM
  6. IHI A D E S
    Joined:
    Nov 15, 2008
    Posts:
    471
    Referrals:
    0
    Sythe Gold:
    0

    IHI A D E S Forum Addict
    Banned

    What Scripts should i use for this account..?


    dam it took a genius like you to tell me that huh.

    fuck off.
     
  7. Unread #4 - Jan 3, 2009 at 3:15 AM
  8. Sup3r 4ut03r
    Joined:
    Aug 27, 2008
    Posts:
    983
    Referrals:
    1
    Sythe Gold:
    0

    Sup3r 4ut03r Apprentice

    What Scripts should i use for this account..?

    He's right, the search is there for a reason, but just download my script pack and use some of the scripts in there, I personally use Don'tPanic's Varrock Yew Chopper, it cuts good and it's a good GUI that doesn't get in the way. Get WC to 99.
     
  9. Unread #5 - Jan 3, 2009 at 3:44 PM
  10. gridfun
    Joined:
    Jan 3, 2006
    Posts:
    43
    Referrals:
    0
    Sythe Gold:
    0

    gridfun Member

    What Scripts should i use for this account..?

    Well, for mining i think TenacGuildMiner is the best available.
    Code:
    import java.awt.*;
    import java.util.*;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.net.URL;
    import java.net.URLConnection;
    
    import com.speljohan.rsbot.bot.*;
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.accessors.*;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.event.listeners.*;
    
    public class TenacGuildMiner extends Script implements PaintListener {
    
        int[] bankerID = { 6200 };
        int[] bankBoothID = { 11758 };
            
        RSTile topLadderObjectTile = new RSTile(3019, 3339);
        int[] ladderID = { 30941 };
        int[] coalRockID = { 31068, 31069, 31070 };
        int[] mithRockID = { 31086, 31087, 31088 };
    
        int coalID = 453;
        int mithrilID = 447;
        int[] gemID = { 1617, 1619, 1621, 1623 };
        int[] pickaxeHandleID = { 466 };
        int[] pickaxeID = { 1265, 1267, 1269, 1273, 1271, 1275 };
        int[] pickaxeHeadID = { 480, 482, 484, 486, 488, 490 };
        int[] brokenPickaxeID =  { 468, 470, 472, 474, 476, 478 };
        
        int[] junkItems = { 1917, 1971 }; //beer, kebab
        int goldPiecesID = 995;
    
        RSTile lumbridgeTile = new RSTile(3221, 3218);
    
        RSTile bankTile = new RSTile(3014, 3356);
        RSTile[] betweenBankAndLadderTiles = { new RSTile(3019, 3351), new RSTile(3022, 3351), new RSTile(3024, 3352) };
        RSTile ladderTile = new RSTile(3021, 3341);
        //RSTile[] topLadderTiles = { new RSTile(3022, 3341), new RSTile(3022, 3337) };
        //RSTile[] bottomLadderTiles = { new RSTile(3021, 9741), new RSTile(3022, 9740) };
    
        RSTile[] coalToLadderPath = { new RSTile(3046, 9752), new RSTile(3044, 9745), new RSTile(3044, 9738),
                                      new RSTile(3037, 9737), new RSTile(3030, 9737), new RSTile(3020, 9739) };
    
        RSTile[] ladderToCoalPath = { new RSTile(3020, 9739), new RSTile(3030, 9737), new RSTile(3037, 9737),
                                      new RSTile(3044, 9738), new RSTile(3044, 9745), new RSTile(3046, 9752) };
    
        RSTile[] lumbridgeToFalidorPath = { new RSTile(3226, 3218), new RSTile(3233, 3220), new RSTile(3233, 3225),
                                            new RSTile(3231, 3230), new RSTile(3228, 3233), new RSTile(3223, 3238),
                                            new RSTile(3221, 3242), new RSTile(3219, 3247), new RSTile(3218, 3251),
                                            new RSTile(3217, 3256), new RSTile(3217, 3257), new RSTile(3217, 3261),
                                            new RSTile(3217, 3266), new RSTile(3216, 3272), new RSTile(3216, 3277),
                                            new RSTile(3210, 3280), new RSTile(3205, 3280), new RSTile(3204, 3279),
                                            new RSTile(3197, 3279), new RSTile(3190, 3282), new RSTile(3184, 3286),
                                            new RSTile(3178, 3287), new RSTile(3172, 3286), new RSTile(3165, 3285),
                                            new RSTile(3158, 3291), new RSTile(3149, 3296), new RSTile(3143, 3294),
                                            new RSTile(3137, 3295), new RSTile(3136, 3295), new RSTile(3130, 3295),
                                            new RSTile(3123, 3299), new RSTile(3118, 3296), new RSTile(3112, 3295),
                                            new RSTile(3106, 3295), new RSTile(3099, 3295), new RSTile(3094, 3292),
                                            new RSTile(3088, 3290), new RSTile(3082, 3289), new RSTile(3076, 3288),
                                            new RSTile(3074, 3284), new RSTile(3074, 3280), new RSTile(3069, 3277),
                                            new RSTile(3063, 3277), new RSTile(3057, 3276), new RSTile(3050, 3276),
                                            new RSTile(3047, 3276), new RSTile(3044, 3274), new RSTile(3037, 3277),
                                            new RSTile(3030, 3278), new RSTile(3024, 3276), new RSTile(3018, 3275),
                                            new RSTile(3013, 3276), new RSTile(3011, 3278), new RSTile(3007, 3284),
                                            new RSTile(3004, 3289), new RSTile(3007, 3294), new RSTile(3006, 3299),
                                            new RSTile(3004, 3304), new RSTile(3006, 3310), new RSTile(3007, 3316),
                                            new RSTile(3007, 3321), new RSTile(3005, 3326), new RSTile(3007, 3331),
                                             new RSTile(3007, 3332), new RSTile(3007, 3337), new RSTile(3007, 3343),
                                             new RSTile(3007, 3349), new RSTile(3005, 3355), new RSTile(3007, 3361),
                                             new RSTile(3012, 3361), new RSTile(3015, 3355) };
    
        long startTime = System.currentTimeMillis();
        int startingLevel = skills.getCurrentSkillLevel(STAT_MINING);
        int startingExperience = skills.getCurrentSkillExp(STAT_MINING);
        int oldExperience = 0;
        int ranAwayFromCombat = 0;
        int gemsBanked = 0;
        int coalBanked = 0;
        int mithBanked = 0;
        int gemsDropped = 0;
        int coalDropped = 0;
        int mithDropped = 0;
        int xpPerCoal = 50;
        int xpPerMithril = 80;
        int energyToRunAt = random(40, 90);
    
        boolean powermine = false;
        int invCountToDrop = random(10, 29);
        boolean dropping = false;
        
        boolean walkBack = false;
        boolean miningMith = false;
        boolean runAway = false;
        boolean needNewPick = false;
    
        int priceOfCoal = getMarketPriceOfItem(coalID);
        int priceOfMithril = getMarketPriceOfItem(mithrilID);
    
        public double getVersion() {
            return 2.1;
        }
    
        public String getName() {
            return "Tenac's Guild Miner";
        }
    
        public String getAuthor() {
            return "Tenac";
        }
    
        public String getScriptCategory() {
            return "Mining";
        }
    
        public String getScriptDescription( ) {
            String html = "";
    
            html += "<html>\n";
            html += "<body>\n";
    
            html += "<font size=\"6\">";
            html += "<center><h2>" + getName() + "</h2></center>\n";
            html += "</font>";
    
            html += "<b>Author:</b>" + getAuthor() + "<br/>";
            html += "<b>Version:</b>" + getVersion() + "<br/><br>";
    
            html += "Start anywhere with a pickaxe and at least 60 mining, preferably inside Falidor East bank or Mining Guild.<br>\n<br>";
            
            html += "<input type=\"checkbox\" name=\"mineMith\" value=\"yes\">Mine mithril rocks also?\n<br>";
            html += "<input type=\"checkbox\" name=\"powermine\" value=\"yes\">Drop ores?\n<br>";
            
            html += "</body>\n";
            html += "</html\n";
    
            return html;
        }
    
        public boolean onStart(Map<String, String> args) {
            startTime = System.currentTimeMillis();
            if(isLoggedIn()) {
                startingLevel = skills.getCurrentSkillLevel(STAT_MINING);
                startingExperience = skills.getCurrentSkillExp(STAT_MINING);
                setCameraAltitude(true);
                setCameraRotation(random(1, 359));
            }
    
            if(args.get("mineMith") != null)
                miningMith = true;
    
            if(args.get("powermine") != null)
                powermine = true;
    
            Bot.getEventManager().addListener(PaintListener.class, this);
            return true;
        }
    
        public void onFinish() {
            Bot.getEventManager().removeListener(PaintListener.class, this);
        }
    
        int height = 1;
    
        public void onRepaint(Graphics g) {
            if(isLoggedIn()) {
                if(startTime == 0)
                    startTime = System.currentTimeMillis();
    
                if(startingLevel == 0 || startingExperience == 0) {
                    startingLevel = skills.getCurrentSkillLevel(STAT_MINING);
                }
    
                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;
    
                g.setColor(new Color(33, 46, 207, 100));
                //window is (0, 0) (337, 515)
                //my box is (515 - 260, 0) (337, 200)
                int x = 515 - 230;
                int y = 4;
                g.fillRoundRect(x, y, 230, height, 20, 20);
                g.setColor(new Color(26, 36, 162, 255));
                g.drawRoundRect(x, y, 230, height, 20, 20);
                
                g.setColor(new Color(255, 255, 255, 255));
                g.drawString("Tenac's Guild Miner v" + getVersion(), x + 10, y += 15);
                g.drawString("Running for " + hours + ":" + minutes + ":" + seconds, x + 10, y += 15);
                if(powermine) {
                    g.drawString("Dropped " + coalDropped + " coal", x + 10, y += 15);
                    g.drawString("Dropped " + mithDropped + " mithril", x + 10, y += 15);
                    g.drawString("Dropped " + gemsDropped + " gems", x + 10, y += 15);
                } else {
                    g.drawString("Banked " + coalBanked + " coal", x + 10, y += 15);
                    g.drawString("Banked " + mithBanked + " mithril", x + 10, y += 15);
                    g.drawString("Banked " + gemsBanked + " gems", x + 10, y += 15);
                }
                if(!powermine) {
                    g.drawString("Gained " + ((coalBanked * priceOfCoal) + (mithBanked * priceOfMithril)) + "gp", x + 10, y += 15);
                    //averaging __gp per hour
                }
                g.drawString("Currently level " + skills.getCurrentSkillLevel(STAT_MINING) + " and " + skills.getPercentToNextLevel(STAT_MINING) + "% to next level", x + 10, y += 15);
                g.drawString("Gained " + (skills.getCurrentSkillLevel(STAT_MINING) - startingLevel) + " levels", x + 10, y += 15);
                //___ until level (skills.getCurrentSkillLevel(STAT_MINING) + 1)
                g.drawString("Gained " + (skills.getCurrentSkillExp(STAT_MINING) - startingExperience) + " experience", x + 10, y += 15);
                //averaging ____ experience per hour
                g.drawString("Ran from combat " + ranAwayFromCombat + " times", x + 10, y += 15);
                g.drawString("" + (int)(skills.getXPToNextLevel(STAT_MINING) / xpPerCoal + 1) + " more coal until next level", x + 10, y += 15);
                height = y + 3;
            }
        }
    
        public void printProgressReport() {
            if(startTime == 0)
                startTime = System.currentTimeMillis();
            if(startingLevel == 0 || startingExperience == 0) {
                startingLevel = skills.getCurrentSkillLevel(STAT_MINING);
                startingExperience = skills.getCurrentSkillExp(STAT_MINING);
            }
            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;
            log("Tenac's Guild Miner v" + getVersion());
            log("Running for " + hours + ":" + minutes + ":" + seconds);
            if(powermine) {
                log("Dropped " + coalDropped + " coal");
                log("Dropped " + mithDropped + " mithril");
                log("Dropped " + gemsDropped + " gems");
            } else {
                log("Banked " + coalBanked + " coal");
                log("Banked " + mithBanked + " mithril");
                log("Banked " + gemsBanked + " gems");
            }
            if(!powermine) {
                log("Gained " + ((coalBanked * priceOfCoal) + (mithBanked * priceOfMithril)) + "gp");
                //averaging __gp per hour
            }
            log("Currently level " + skills.getCurrentSkillLevel(STAT_MINING) + " and " + skills.getPercentToNextLevel(STAT_MINING) + "% to next level");
            log("Gained " + (skills.getCurrentSkillLevel(STAT_MINING) - startingLevel) + " levels");
            //___ until level (skills.getCurrentSkillLevel(STAT_MINING) + 1)
            log("Gained " + (skills.getCurrentSkillExp(STAT_MINING) - startingExperience) + " experience");
            //averaging ____ experience per hour
            log("Ran from combat " + ranAwayFromCombat + " times");
            log("" + (int)(skills.getXPToNextLevel(STAT_MINING) / xpPerCoal + 1) + " more coal until next level");
        }
    
        public int getMarketPriceOfItem(int id) {
            String pageSource = "";
            int begin = 0;
            int end = 0;
            try {
                URL theUrl = new URL("http://itemdb-rs.runescape.com/viewitem.ws?obj=" + id);
                URLConnection theUrlConnection = theUrl.openConnection();
                BufferedReader in = new BufferedReader(new InputStreamReader(theUrlConnection.getInputStream()));
                String inputLine = "";
                while ((inputLine = in.readLine()) != null)
                    pageSource += inputLine;
                in.close();
                pageSource = pageSource.replaceAll("\n", "");
                pageSource = pageSource.replaceAll("\t", "");
                begin = pageSource.indexOf("<b>Market price:</b> ") + ("<b>Market price:</b> ").length();
                end = pageSource.indexOf("</span><span><b>Maximum price:</b>");
            } catch (Exception e) {
                System.out.println("Error obtaining price of http://itemdb-rs.runescape.com/viewitem.ws?obj=" + id);
            }
            return (int)new Integer(pageSource.substring(begin, end)).intValue();
        }
    
        public int loop() {
            if(!isLoggedIn())
                return random(500, 800);
    
            //if(getGroundItemByID(17, pickaxeHeadID) != null && (isCarryingItem(pickaxeHandleID)))
            if(getGroundItemByID(17, pickaxeHeadID) != null)
                return fixPickaxe();
            
            if(getEnergy() >= energyToRunAt) {
                energyToRunAt = random(40, 90);
                setRun(true);
            }
            
            if(getMyPlayer().isInCombat())
                runAway = true;
            
            if(runAway)
                return runAway();
            
            if(distanceTo(lumbridgeTile) <= 17)
                walkBack = true;
    
            if(isLost()) {
                if(myGetNextTile(lumbridgeToFalidorPath, 17) == null)
                    return teleportToLumbridge();
                walkBack = true;
            }
    
            if(walkBack) {
                if(myWalkPath(lumbridgeToFalidorPath, 17, 1)) {
                    walkBack = false;
                    return depositInventory();
                }
            }
    
    /*
            //will never be called since the  rsbot equipment interface is fucked up
            if(isCarryingItem(brokenPickaxeID) || isCarryingItem(pickaxeHandleID) || !isCarryingItem(pickaxeID))
                return getNewPick();
    */
    
            if(getInterface(211).isValid())
                if(getInterface(211).getChild(1).containsText("You need a Pickaxe") && getGroundItemByID(17, pickaxeHeadID) == null)
                    needNewPick = true;
            
            if(needNewPick) {
                if(getNewPick() == 99999) {
                    needNewPick = false;
                    return random(10, 20);
                } else {
                    return random(10, 20);
                }
            }
    
            if(isCarryingJunk())
                return dropJunk();
    
            if(canEquipPickaxe())
                return wieldPickaxe();
    
            if(powermine && (getInventoryCount() >= invCountToDrop || isInventoryFull()))
                dropping = true;
    
            if(dropping)
                return dropInventory();
    
            if(isInventoryFull() && !powermine)
                return depositInventory();
    
            if(isInventoryFull())
                return depositInventory();
    
            return mineCoal();
        }
    
        public boolean isLost() {
            if(distanceTo(lumbridgeTile) <= 17)
                    return false;
            if(distanceTo(bankTile) <= 17)
                return false;
            if(distanceTo(ladderTile) <= 17)
                return false;
            for(int i = 0; i < betweenBankAndLadderTiles.length - 1; i++)
                if(distanceTo(betweenBankAndLadderTiles[i]) <= 17)
                        return false;
            for(int i = 0; i < coalToLadderPath.length - 1; i++)
                if(distanceTo(coalToLadderPath[i]) <= 17)
                        return false;
            return true;
        }
    
        public int dropInventory() {
            if(atInventoryItem(coalID, "Drop")) {
                coalDropped++;
                wait(random(500, 700));
                return random(50, 75);
            } else if(atInventoryItem(mithrilID, "Drop")) {
                mithDropped++;
                wait(random(500, 700));
                return random(50, 75);
            }
            for(int i = 0; i < gemID.length; i++) {
                if(atInventoryItem(gemID[i], "Drop")) {
                    gemsDropped++;
                    wait(random(500, 700));
                    return random(50, 75);
                }
            }
            dropping = false;
            invCountToDrop = random(10, 29);
            return random(50, 75);
        }
    
        public boolean isCarryingJunk() {
            for(int i = 0; i < junkItems.length; i++) {
                if(inventoryContainsOneOf(junkItems[i])) {
                    return true;
                }
            }
            RSItem item = getInventoryItemByID(goldPiecesID);
            if(item != null) {
                if(item.getStackSize() <= 5000) {
                    return true;
                }
            }
            return false;
        }
        
        public int dropJunk() {
            for(int i = 0; i < junkItems.length; i++) {
                if(inventoryContainsOneOf(junkItems[i])) {
                    if(atInventoryItem(junkItems[i], "Drop"))
                        return random(550, 700);
                }
            }
            RSItem item = getInventoryItemByID(goldPiecesID);
            if(item != null) {
                if(item.getStackSize() <= 5000) {
                    if(atInventoryItem(goldPiecesID, "Drop"))
                        return random(550, 700);
                }
            }
            return random(40, 100);
        }
        
        public void unequipWeapon() {
            openTab(TAB_EQUIPMENT);
            RSInterface equip = RSInterface.getInterface(INTERFACE_TAB_EQUIPMENT);
            RSInterfaceChild weapon = equip.getChild(16);
            atInterface(weapon);
            wait(random(400, 800));
            openTab(TAB_INVENTORY);
        }
    
        public int runAway() {
            log("Running away from combat...");
            setRun(true);
            if(getMyPlayer().getLocation().getY() > 6000) {
                if(!myWalkPath(coalToLadderPath, 17, 2))
                    return random(200, 300);
                waitUntilNotMoving();
                if(!climbUpLadder())
                    climbUpLadder();
                wait(random(2200, 3400));
            } else {
                RSTile curentTile = getMyPlayer().getLocation();
                int xRand = random(-16, 17);
                int yRand;
                if(random(0, 2) == 0)
                    yRand = -(int)(Math.sqrt((16 * 16) - (xRand * xRand)));
                else
                    yRand = -(int)(Math.sqrt((16 * 16)- (xRand * xRand)));
                RSTile runawayTile = new RSTile(curentTile.getX() + xRand, curentTile.getY() + yRand);
                myWalkTile(runawayTile, 0);
                waitUntilNearTile(runawayTile, 0);
                wait(random(2200, 3400));
                myWalkTile(curentTile, 1);
                wait(random(50, 600));
                if(random(0, 4) < 3)
                    moveMouse(random(100, 415), random(100, 237));
                waitUntilNotMoving();
            }
            runAway = false;
            ranAwayFromCombat++;
            log("Combat evaded.");
            return random(50, 100);
        }
    
        long upLadderTimer = System.currentTimeMillis();
    
        public boolean climbUpLadder() {
            upLadderTimer = System.currentTimeMillis();
            RSObject object = getNearestObjectById(16, ladderID);
            if(object == null)
                return false;
            if(!Calculations.onScreen(Calculations.tileToScreen(object.getLocation()))) {
                myWalkTile(object.getLocation(), 2);
                wait(random(50, 600));
                if(random(0, 4) < 3)
                    moveMouse(random(100, 415), random(100, 237));
                waitUntilNotMoving();
            }
            if(atObject(object, "up")) {
                while(getMyPlayer().getLocation().getY() > 6000 && System.currentTimeMillis() - upLadderTimer < 6000) {
                    if(getMyPlayer().getLocation().getY() < 6000)
                        return true;
                    if(System.currentTimeMillis() - upLadderTimer >= 6000)
                        return false;
                    wait(random(600, 800));
                }
            } else {
                setCameraRotation(random(1, 359));
                //setCameraAltitude(true);
            }
            return false;
        }
    
        public boolean atTileModified(RSTile tile, String action) {
            try {
                Point location = Calculations.tileToScreen(tile);
                if (location.x == -1 || location.y == -1) return false;
                int xRand = 0;
                int yRand = 0;
                if(random(0, 2) == 0)
                    xRand = random(-26, -16);
                else
                    xRand = random(16, 26);
                if(random(0, 2) == 0)
                    yRand = random(-26, -16);
                else
                    yRand = random(16, 26);
                moveMouse(location, xRand, yRand);
                if (getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
                    clickMouse(true);
                } else {
                    clickMouse(false);
                    if(!atMenu(action))
                        return false;
                }
                waitUntilNotMoving();
                return true;
            } catch (Exception e) {
                return false;
            }
        }
    
        long downLadderTimer = System.currentTimeMillis();
    
        public boolean climbDownLadder() {
            downLadderTimer = System.currentTimeMillis();
            if(!Calculations.onScreen(Calculations.tileToScreen(topLadderObjectTile)))
                return false;
            if(atTileModified(topLadderObjectTile, "down")) {
                while(getMyPlayer().getLocation().getY() < 6000 && System.currentTimeMillis() - downLadderTimer < 6000) {
                    if(getMyPlayer().getLocation().getY() > 6000)
                        return true;
                    if(System.currentTimeMillis() - downLadderTimer >= 6000)
                        return false;
                    wait(random(600, 800));
                }
            } else {
                //if(distanceTo(ladderTile) > 6)
                //    myWalkTile(ladderTile, 2);
                setCameraRotation(random(1, 359));
                //setCameraAltitude(true);
                //waitUntilNearTile(ladderTile, 0);
            }
            return false;
        }
    
        public int getNewPick() {
            if(getMyPlayer().getLocation().getY() > 6000) {
                if(myWalkPath(coalToLadderPath, 15, 3)) {
                    waitUntilNotMoving();
                    climbUpLadder();
                }
                return random(100, 200);
            }
            if(distanceTo(bankTile) > 4) {
                if(myWalkTile(bankTile, 1)) {
                    wait(random(50, 600));
                    if(random(0, 4) < 3)
                        moveMouse(random(100, 415), random(100, 237));
                    waitUntilNotMoving();
                } else {
                    RSTile theTile = betweenBankAndLadderTiles[random(0, betweenBankAndLadderTiles.length)];
                    myWalkTile(theTile, 1);
                    if(random(0, 2) == 0)
                        setCameraAltitude(true);
                    waitUntilNearTile(theTile, 2);
                }
                return random(200, 300);
            }
            if(!RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                int r = random(0, 2);
                if(r == 0)
                    if(!atObject(getNearestObjectById(15, bankBoothID), "uickl"))
                        myWalkTile(bankTile, 2);
                if(r == 1)
                    if(!atNPC(getNearestNPCByID(bankerID), "ank Ba"))
                        myWalkTile(bankTile, 2);
                wait(random(200, 300));
                waitUntilNotMoving();
                return random(100, 300);
            }
            if(RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                coalBanked += getInventoryCount(coalID);
                mithBanked += getInventoryCount(mithrilID);
                gemsBanked += getInventoryCount(gemID);
                bank.depositAll();
    
                moveMouse(52 + random(-10, 10), 106 + random(-10, 10));
                if(getMenuItems().get(0).toLowerCase().contains(("pickaxe").toLowerCase()) && !getMenuItems().get(0).toLowerCase().contains(("Broken").toLowerCase())) {
                    clickMouse(true);
                    wait(random(1100, 1500));
                } else {
                    log("No useable pickaxe, ending script =(");
                    bank.close();
                    printProgressReport();
                    stopAllScripts();
                }
                bank.close();
            }
            return 99999;
        }
    
        int headAttempts;
        public int fixPickaxe() {
            RSItemTile head = getGroundItemByID(17, pickaxeHeadID);
            if(head != null) {
                log("Getting pickaxe head...");
                myWalkTile(head, 1);
                waitUntilNearTile(head, 0);
                headAttempts = 0;
                while(!atTile(head, "Take") || headAttempts <= 10) {
                    setCameraRotation(random(1, 359));
                    if(random(0, 3) == 0)
                        atTile(randomizeTile(head, 1, 1), "Walk");
                    headAttempts++;
                    
                }
            }
            //if(equipmentContains(pickaxeHandleID) || equipmentContains(brokenPickaxeID))
                unequipWeapon();
            openTab(TAB_INVENTORY);
            wait(random(200, 300));
            if(getInventoryItemByID(pickaxeHeadID) != null && getInventoryItemByID(pickaxeHandleID) != null)
                useItem(getInventoryItemByID(pickaxeHeadID), getInventoryItemByID(pickaxeHandleID));
    
            if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 40 && inventoryContainsOneOf(pickaxeID[5]))
                atInventoryItem(pickaxeID[5], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 30 && inventoryContainsOneOf(pickaxeID[4]))
                atInventoryItem(pickaxeID[4], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 20 && inventoryContainsOneOf(pickaxeID[3]))
                atInventoryItem(pickaxeID[3], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 5 && inventoryContainsOneOf(pickaxeID[2]))
                atInventoryItem(pickaxeID[2], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[1]))
                atInventoryItem(pickaxeID[1], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[0]))
                atInventoryItem(pickaxeID[0], "ield");
            return random(200, 400);
        }
    
        public boolean canEquipPickaxe() {
            if((skills.getCurrentSkillLevel(STAT_ATTACK) >= 40 && inventoryContainsOneOf(pickaxeID[5])) ||
               (skills.getCurrentSkillLevel(STAT_ATTACK) >= 30 && inventoryContainsOneOf(pickaxeID[4])) ||
               (skills.getCurrentSkillLevel(STAT_ATTACK) >= 20 && inventoryContainsOneOf(pickaxeID[3])) ||
               (skills.getCurrentSkillLevel(STAT_ATTACK) >= 5 && inventoryContainsOneOf(pickaxeID[2])) ||
               (skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[1])) ||
               (skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[0])))
                return true;
            return false;
        }
        
        public int wieldPickaxe() {
            if(RSInterface.getInterface(INTERFACE_BANK).isValid())
                bank.close();
    
            if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 40 && inventoryContainsOneOf(pickaxeID[5]))
                atInventoryItem(pickaxeID[5], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 30 && inventoryContainsOneOf(pickaxeID[4]))
                atInventoryItem(pickaxeID[4], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 20 && inventoryContainsOneOf(pickaxeID[3]))
                atInventoryItem(pickaxeID[3], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 5 && inventoryContainsOneOf(pickaxeID[2]))
                atInventoryItem(pickaxeID[2], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[1]))
                atInventoryItem(pickaxeID[1], "ield");
            else if(skills.getCurrentSkillLevel(STAT_ATTACK) >= 1 && inventoryContainsOneOf(pickaxeID[0]))
                atInventoryItem(pickaxeID[0], "ield");
            return random(200, 400);
        }
    
        public int depositInventory() {
            if(getMyPlayer().getLocation().getY() > 6000) {
                if(myWalkPath(coalToLadderPath, 15, 3)) {
                    waitUntilNotMoving();
                    climbUpLadder();
                }
                return random(100, 200);
            }
            if(distanceTo(bankTile) > 4) {
                if(myWalkTile(bankTile, 1)) {
                    wait(random(50, 600));
                    if(random(0, 4) < 3)
                        moveMouse(random(100, 415), random(100, 237));
                    waitUntilNotMoving();
                } else {
                    RSTile theTile = betweenBankAndLadderTiles[random(0, betweenBankAndLadderTiles.length)];
                    myWalkTile(theTile, 1);
                    if(random(0, 2) == 0)
                        setCameraAltitude(true);
                    waitUntilNearTile(theTile, 2);
                }
                return random(200, 300);
            }
            if(!RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                int r = random(0, 2);
                if(r == 0)
                    if(!atObject(getNearestObjectById(15, bankBoothID), "uickl"))
                        myWalkTile(bankTile, 2);
                if(r == 1)
                    if(!atNPC(getNearestNPCByID(bankerID), "ank Ba"))
                        myWalkTile(bankTile, 2);
                wait(random(200, 300));
                waitUntilNotMoving();
                return random(200, 300);
            }
            if(RSInterface.getInterface(INTERFACE_BANK).isValid()) {
                coalBanked += getInventoryCount(coalID);
                mithBanked += getInventoryCount(mithrilID);
                gemsBanked += getInventoryCount(gemID);
                bank.depositAllExcept(pickaxeID);
                if(random(0, 5) == 0)
                    bank.close();
            }
            return random(25, 100);
        }
    
        public void mouseOverMiningSkill() {
            openTab(TAB_STATS);
            //2 interfaces, one for the pickaxe image, other for the skill text
            RSInterfaceChild one = RSInterface.getInterface(320).getChild(9);
            RSInterfaceChild two = RSInterface.getInterface(320).getChild(10);
            if(random(0, 2) == 0)
                moveMouse(new Point(one.getAbsoluteX() + random(2, one.getWidth() - 1), one.getAbsoluteY() + random(2, one.getHeight() - 1)));
            else
                moveMouse(new Point(two.getAbsoluteX() + random(2, two.getWidth() - 1), two.getAbsoluteY() + random(2, two.getHeight() - 1)));
        }
    
        //4% chance of doing antiban: 17/425, every 4.8-19.2 seconds doing antiban
        public int antiBan() {
            switch(random(0, 425)) {
                case 0: setCameraRotation(random(1, 359)); break;
                case 1: setCameraRotation(random(1, 359)); break;
                case 2: setCameraRotation(random(1, 359)); break;
                case 3: setCameraRotation(random(1, 359)); break;
                case 4: setCameraRotation(random(1, 359)); break;
                case 5: setCameraRotation(random(1, 359)); break;
    
                case 6: setRun(true); break;
    
                case 7: moveMouse(random(0, 515), random(0, 337)); break;
                case 8: moveMouse(random(0, 515), random(0, 337)); break;
                case 9: moveMouse(random(100, 415), random(100, 237)); break;
                case 10: moveMouse(random(100, 415), random(100, 237)); break;
                case 11: moveMouse(random(100, 415), random(100, 237)); break;
                case 12: moveMouse(random(0, 764), random(0, 502)); break;
    
                case 13: mouseOverMiningSkill(); break;
                case 14: mouseOverMiningSkill(); break;
    
                case 15: openTab(TAB_INVENTORY); break;
                case 16: openTab(random(0, 13)); break;
    
                default: break;
            }
            return random(50, 200);
        }
    
        RSTile lastRockLocation = new RSTile(0000, 0000);
        RSObject rock;
        long timeIdle = System.currentTimeMillis();
    
        public boolean mineNewRock() {
            RSObject obj = getObjectAt(lastRockLocation);
            if(obj == null)
                return true;
            for(int i = 0; i < coalRockID.length; i++) {
                if(obj.getID() == coalRockID[i])
                    return false;
            }
            for(int i = 0; i < mithRockID.length; i++) {
                if(obj.getID() == mithRockID[i])
                    return false;
            }
            return true;
        }
    
        public boolean atRock(RSObject obj) {
            try {
                Point location = Calculations.tileToScreen(obj.getLocation());
                if (location.x == -1 || location.y == -1) return false;
                moveMouse(location, 3, 3);
                wait(random(40, 80));
                boolean validRock = false;
                RSObject temp = getObjectAt(obj.getLocation());
                if(temp != null) {
                    int id = temp.getID();
                    for(int i = 0; i < coalRockID.length; i++) {
                        if(id == coalRockID[i])
                            validRock = true;
                    }
                    if(!validRock) {
                        for(int i = 0; i < mithRockID.length; i++) {
                            if(id == mithRockID[i])
                                validRock = true;
                        }
                    }
                }
                if(!validRock)
                    return false;
                if(!getMenuItems().get(0).toLowerCase().contains(("ine R").toLowerCase())) {
                    moveMouse(location, 6, 6);
                    wait(random(40, 80));
                    if(!getMenuItems().get(0).toLowerCase().contains(("ine R").toLowerCase())) {
                        moveMouse(location, 6, 6);
                        wait(random(40, 80));
                        if(!getMenuItems().get(0).toLowerCase().contains(("ine R").toLowerCase())) {
                            moveMouse(location, 6, 6);
                            wait(random(40, 80));
                        }
                    }
                }
                    
                if(getMenuItems().get(0).toLowerCase().contains(("ine R").toLowerCase())) {
                    clickMouse(true);
                } else {
                    clickMouse(false);
                    if(!atMenu("ine R"))
                        return false;
                }
                wait(random(500, 1000));
                waitUntilNotMoving();
                return true;
            } catch (Exception e) {
                return false;
            }
        }
    
        private boolean isObjectOccupied(RSObject obj) {
            Player[] players = Bot.getClient().getPlayerArray();
            int[] playerIndex = Bot.getClient().getPlayerIndexArray();
            if(obj.getLocation() == null)
                return true;
            for(int element : playerIndex) {
                if(players[element] == null)
                    continue;
                RSPlayer player = new RSPlayer(players[element]);
                if(!player.getName().equals(getMyPlayer().getName()))
                    if(distanceBetween(obj.getLocation(), player.getLocation()) < 2 && player.getAnimation() != -1)
                        return true;
            }
            return false;
        }
    
        private RSObject findNearestUnoccupiedObject(RSObject... objects) {
            RSObject nearestObj = null;
            for(int i = 0; i < objects.length; i++) {
                if(isObjectOccupied(objects[i]))
                    continue;
                if(nearestObj == null)
                    nearestObj = objects[i];
                else if(distanceTo(objects[i].getLocation()) < distanceTo(nearestObj.getLocation()))
                    nearestObj = objects[i];
            }
            return nearestObj;
        }
    
        public int mineCoal() {
            if(getMyPlayer().getLocation().getY() < 6000) {
                if(!climbDownLadder()) {
                    if(Calculations.onScreen(Calculations.tileToScreen(topLadderObjectTile)))
                        return random(20, 80);
                    if(myWalkTile(ladderTile, 2)) {
                        if(random(0, 4) < 3)
                            moveMouse(random(100, 415), random(100, 237));
                        waitUntilNearTile(ladderTile, 0);
                    } else {
                        RSTile theTile = betweenBankAndLadderTiles[random(0, betweenBankAndLadderTiles.length)];
                        myWalkTile(theTile, 1);
                        if(random(0, 2) == 0)
                            setCameraAltitude(true);
                        waitUntilNearTile(theTile, 2);
                    }
                    return random(200, 300);
                }
                return random(200, 400);
            }
    
            if(getMyPlayer().getAnimation() != -1)
                timeIdle = System.currentTimeMillis();
            
            if(getObjectAt(lastRockLocation) == null)
                lastRockLocation = new RSTile(0000, 0000);
    
            if(mineNewRock() || ((getMyPlayer().getAnimation() == -1) && (System.currentTimeMillis() - timeIdle >= 4000) && !getMyPlayer().isMoving())) {
                rock = null;
                if(miningMith && (findNearestUnoccupiedObject(findObjects(16, mithRockID)) != null || getNearestObjectById(16, mithRockID) != null)) {
                    if(findNearestUnoccupiedObject(findObjects(16, mithRockID)) != null)
                        rock = findNearestUnoccupiedObject(findObjects(16, mithRockID));
                    else
                        rock = getNearestObjectById(16, mithRockID);
                } else {
                    if(findNearestUnoccupiedObject(findObjects(10, coalRockID)) != null)
                        rock = findNearestUnoccupiedObject(findObjects(10, coalRockID));
                    else
                        rock = getNearestObjectById(16, coalRockID);
                }
                if(rock == null) {
                    if(distanceTo(ladderToCoalPath[ladderToCoalPath.length - 1]) < 6) {
                        myWalkPath(coalToLadderPath, 15, 3);
                        wait(random(50, 600));
                        if(random(0, 4) < 3)
                            moveMouse(random(100, 415), random(100, 237));
                        waitUntilNotMoving();
                        return random(50, 200);
                    }
                    if(distanceTo(coalToLadderPath[coalToLadderPath.length - 1]) < 6) {
                        myWalkPath(ladderToCoalPath, 15, 3);
                        wait(random(50, 600));
                        if(random(0, 4) < 3)
                            moveMouse(random(100, 415), random(100, 237));
                        waitUntilNotMoving();
                        return random(50, 200);
                    }
                    if(random(0, 2) == 0)
                        myWalkPath(ladderToCoalPath, 17, 3);
                    else
                        myWalkPath(coalToLadderPath, 17, 3);
    
                    wait(random(50, 600));
                    if(random(0, 4) < 3)
                        moveMouse(random(100, 415), random(100, 237));
                    waitUntilNotMoving();
                    return random(50, 200);
                }
                if(rock.getLocation().getY() > 9756) {
                    myWalkPath(coalToLadderPath, 17, 3);
                    waitUntilNotMoving();
                    lastRockLocation = new RSTile(0000, 0000);
                    return random(50, 200);
                }
                //if(!tileOnScreen(rock.getLocation())) {
                if(!Calculations.onScreen(Calculations.tileToScreen(rock.getLocation()))) {
                    if(!myWalkTile(rock.getLocation(), 2)) {
                        lastRockLocation = new RSTile(0000, 0000);
                        return random(20, 40);
                    }
                    if(random(0, 4) == 0)
                        setCameraAltitude(true);
                    wait(random(50, 200));
                    if(random(0, 4) < 3)
                        moveMouse(random(100, 415), random(100, 237));
                    waitUntilNotMoving();
                    return random(50, 200);
                }
                lastRockLocation = rock.getLocation();
                if(!atRock(rock))
                    setCameraRotation(random(1, 359));
    
                return random(100, 300);
            }
            return antiBan();
        }
    
        int tries = 0;
        public int teleportToLumbridge() {
            if(distanceTo(lumbridgeTile) > 17) {
                castSpell(1);
                wait(random(1500, 2400));
                if(getMyPlayer().getAnimation() != -1) {
                    wait(random(12500,14000));
                } else {
                    tries++;
                    if(tries >= 4) {
                        log("Unable to teleport to lumbridge, stopping script");
                        printProgressReport();
                        stopAllScripts();
                    }
                    int r = random(120000, 400000);
                    log("Unable to teleport to lumbridge, will attempt again in " + (r / 1000) + "seconds");
                    printProgressReport();
                    logout();
                    wait(r);
                    login();
                }
            }
            myWalkTile(lumbridgeTile, 1);
            setRun(true);
            waitUntilNearTile(lumbridgeTile, 2);
            return random(100, 600);
        }
    
        public void waitUntilNotMoving() {
            wait(random(700, 1000));
            while(getMyPlayer().isMoving())
                wait(random(25, 100));
        }
    
        public void waitUntilNearTile(RSTile tile, int dist) {
            wait(random(700, 1000));
            while(distanceTo(tile) >= dist && getMyPlayer().isMoving())
                wait(random(25, 100));
        }
    
        public boolean myWalkTile(RSTile theTile, int randomness) {
            if(theTile == null)
                return false;
            if((distanceTo(theTile)) <= 17) {
                RSTile newTile;
                if(randomness == 0)
                    newTile = new RSTile(theTile.getX(), theTile.getY());
                else
                    newTile = new RSTile(theTile.getX() + random(-randomness, randomness + 1), theTile.getY() + random(-randomness, randomness + 1));
    
                if(random(0, 30) == 0)
                    turnToTile(newTile, 15);
    
                if(tileOnScreen(newTile) && random(0, 10) == 0) {
                    if(!atTile(newTile, "Walk")) {
                        if(!walkTileMM(newTile)) {
                            //log("Failed walking to tile: (" + theTile.getX() + ", " + theTile.getY() + ")");
                            return false;
                        } else {
                            return true;
                        }
                    } else {
                        return true;
                    }
                } else {
                    if(!walkTileMM(newTile)) {
                        //log("Failed walking to tile: (" + theTile.getX() + ", " + theTile.getY() + ")");
                        return false;
                    } else {
                        return true;
                    }
                }
            } else {
                //log("Tile out of reach: (" + theTile.getX() + ", " + theTile.getY() + ")");
                return false;
            }
        }
    
        public RSTile myGetNextTile(RSTile[] path, int maxDist) {
            for(int i = path.length - 1; i >= 0; i--) {
                if(distanceTo(path[i]) <= maxDist) {
                    return path[i];
                }
            }
            return null;
        }
    
        /**
         * Walks to the next reachable tile in the path
         *
         * @param path The path it will walk
         * @param maxDist The max distance it will search for the next tile in the path
         * @param randomness the randomness it will add to clicking the tile
         * @return if you are within 4 tiles of the destination
         */
        public boolean myWalkPath(RSTile[] path, int maxDist, int randomness) {
            if(distanceTo(path[path.length - 1]) <= 4) {
                return true;
            } else {
                RSTile theTile = myGetNextTile(path, maxDist);
                if(theTile != null) {
                    myWalkTile(theTile, randomness);
                    waitUntilNearTile(theTile, 2);
                }
                return false;
            }
        }
    
        public RSObject getNearestObjectById(int range, int... ids) {
            for(int i = 0; i <= range; i++) {
                RSObject temp = findObject(i, ids);
                if(temp != null) {
                    return temp;
                }
            }
            return null;
        }
    
        public RSObject[] findObjects(int range, int... ids) {
            ArrayList<RSObject> matches = new ArrayList<RSObject>();
            RSTile pos = getMyPlayer().getLocation();
            int xBegin = pos.getX() - range;
            int yBegin = pos.getY() - range;
            int xEnd = pos.getX() + range;
            int yEnd = pos.getY() + range;
            for (int x = xBegin; x < xEnd; x++) {
                for (int y = yBegin; y < yEnd; y++) {
                    RSTile t = new RSTile(x, y);
                    RSObject obj = getObjectAt(t);
                    if (obj == null)
                        continue;
                    for (int objType : ids) {
                        if (objType == obj.getID())
                            matches.add(obj);
                    }
                }
            }
            try {
                matches.trimToSize();
                return (RSObject[]) matches.toArray(new RSObject[matches.size()]);
            } catch (Exception e) { }
            return new RSObject[0];
        }
    
    }
    
    For str if youre p2p, YakAttack is THE best script, for f2p, mabey Stronghold.
    Code:
    import java.awt.*;
    import java.awt.event.KeyEvent;
    import java.util.Map;
    
    import com.speljohan.rsbot.accessors.NPC;
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    
    public class YakAttack extends Script implements PaintListener {
    	// Variables.
    	private final int YAK_ID = 5529;
    	private int yakHealth = 50;
    	public int startHealthXP = 0;
    	private int anti = 0;
    	private int run = 0;
    	public int camangle = random(0, 360);
    	public int DEFENCE = 1;
    	public int ATTACK = 0;
    	public int STRENGTH = 2;
    	public int style = 0;
    	public int startLevel = 0;
    	public int startXP = 0;
    	public long startTime = System.currentTimeMillis();
    	public long time = System.currentTimeMillis();
    
    	public double getVersion() {
    		return 1.00;
    	}
    
    	public String getName() {
    		return "Yak Attack";
    	}
    
    	public String getAuthor() {
    		return "Cjg&Bug5532";
    	}
    
    	public String getScriptCategory() {
    		return "Combat";
    	}
    
    	public String getScriptDescription() {
    		String html = "";
    
    		html += "<html>\n";
    		html += "<body>\n";
    		html += "<h2>" + getName() + " v" + getVersion() + "</h2><br>\n";
    		html += "Author: " + getAuthor() + "<br><br>\n";
    		html += "Description";
    		html += "<center>\n";
    		html += "Arguments:";
    		html += "<form>Attack:<input type=\"radio\" name=\"style\" value=\"attack\" checked=\"checked\"> ";
    		html += "Strength:<input type=\"radio\" name=\"style\" value=\"strength\"> ";
    		html += "Defence:<input type=\"radio\" name=\"style\" value=\"defence\"><br /></form>";
    		html += "</center>\n";
    		html += "</body>\n";
    		html += "</html\n";
    
    		return html;
    	}
    
    	public boolean onStart(Map<String, String> args) {
    		Bot.getEventManager().addListener(PaintListener.class, this);
    
    		if (args.get("style").equals("attack")) {
    			style = ATTACK;
    		}
    		if (args.get("style").equals("defence")) {
    			style = DEFENCE;
    		}
    		if (args.get("style").equals("strength")) {
    			style = STRENGTH;
    		}
    
    		log("Starting YakAttack " + getVersion() + "");
    		log("Training: " + args.get("style") + ".");
    
    		startLevel = 0;
    		startTime = System.currentTimeMillis();
    		if (isLoggedIn()) {
    			startLevel = skills.getCurrentSkillLevel(style);
    			startXP = skills.getCurrentSkillExp(style);
    		}
    
    		return true;
    	}
    
    	public void turnCamera() {
    		char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
    		char[] UD = new char[] { KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    		char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
    				KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    		int random2 = random(0, 2);
    		int random1 = random(0, 2);
    		int random4 = random(0, 4);
    
    		if (random(0, 3) == 0) {
    			Bot.getInputManager().pressKey(LR[random1]);
    			try {
    				Thread.sleep(random(100, 400));
    			} catch (Exception e) {}
    			Bot.getInputManager().pressKey(UD[random2]);
    			try {
    				Thread.sleep(random(300, 600));
    			} catch (Exception e) {}
    			Bot.getInputManager().releaseKey(UD[random2]);
    			try {
    				Thread.sleep(random(100, 400));
    			} catch (Exception e) {}
    			Bot.getInputManager().releaseKey(LR[random1]);
    		} else {
    			Bot.getInputManager().pressKey(LRUD[random4]);
    			if (random4 > 1) {
    				try {
    					Thread.sleep(random(300, 600));
    				} catch (Exception e) {}
    			} else {
    				try {
    					Thread.sleep(random(500, 900));
    				} catch (Exception e) {}
    			}
    			Bot.getInputManager().releaseKey(LRUD[random4]);
    		}
    	}
    
    	public void onFinish() {
    		Bot.getEventManager().removeListener(PaintListener.class, this);
    	}
    
    	public void antiban() {
    
    		anti = random(0, 40);
    
    		if (anti <= 2) {
    			turnCamera();
    			wait(random(500, 1000));
    		}
    
    		if (anti == 7) {
    			moveMouse(random(0, 764), random(0, 501));
    
    		}
    
    		if (anti == 8) {
    
    			openTab(random(0, 13));
    
    		}
    
    		if (anti == 9) {
    			openTab(TAB_STATS);
    			wait(random(250, 700));
    			moveMouse(random(556, 707), random(230, 442));
    			wait(random(255, 400));
    		}
    
    		if (anti == 10) {
    			if (run == 0) {
    				setRun(true);
    				run = 1;
    			} else {
    				openTab(TAB_STATS);
    				wait(random(350, 800));
    				moveMouse(random(556, 707), random(230, 442));
    				wait(random(255, 400));
    
    			}
    		}
    	}
    
    	public RSNPC getNextNPCByID(int... ids) {
    		int Dist = 35;
    		RSNPC closest = null;
    		int[] validNPCs = Bot.getClient().getNPCIndexArray();
    		NPC[] npcs = Bot.getClient().getNPCArray();
    
    		for (int element : validNPCs) {
    			if (npcs[element] == null) {
    				continue;
    			}
    			RSNPC Monster = new RSNPC(npcs[element]);
    			try {
    				for (int id : ids) {
    					if (id != Monster.getID()) {
    						continue;
    					}
    					int distance = distanceTo(Monster);
    					if (distance < Dist && !Monster.isInCombat()) {
    						Dist = distance;
    						closest = Monster;
    					}
    				}
    			} catch (Exception e) {}
    		}
    		return closest;
    	}
    
    	public int loop() {
    		// Variables
    		RSPlayer myPlayer = getMyPlayer();
    		RSNPC yak = getNearestFreeNPCByName("Yak");
    
    		if ((myPlayer.isInCombat() || myPlayer.isMoving())
    				&& skills.getCurrentSkillExp(3) * 3 < yakHealth * 4
    						+ startHealthXP * 3) {
    			antiban();
    		}
    
    		if (skills.getCurrentSkillExp(3) * 3 >= yakHealth * 4 + startHealthXP
    				* 3 - 2) {
    			RSNPC yak2 = getNextNPCByID(YAK_ID);
    
    			if (yak2 != null) {
    				if (yak2.isInCombat()) {
    					return random(150, 300);
    				}
    				startHealthXP = skills.getCurrentSkillExp(3);
    				atNPC(yak2, "Attack");
    				return random(150, 300);
    			}
    		}
    
    		if (!myPlayer.isInCombat()
    				&& !myPlayer.isMoving()
    				|| skills.getCurrentSkillExp(3) * 3 >= yakHealth * 4
    						+ startHealthXP * 3) {
    			if (yak != null) {
    				if (yak.isInCombat()) {
    					return random(150, 300);
    				}
    				startHealthXP = skills.getCurrentSkillExp(3);
    				atNPC(yak, "Attack");
    				wait(random(2000, 3000));
    				return random(150, 300);
    			}
    			if (!myPlayer.isInCombat()) {
    				log("Attempting to find free yak...");
    				turnCamera();
    				wait(random(500, 1000));
    			}
    		}
    		return random(500, 1000);
    	}
    
    	public void onRepaint(Graphics g) {
    		if (isLoggedIn()) {
    			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 XPChange = skills.getCurrentSkillExp(style) - startXP;
    			int YakKills = XPChange / (yakHealth * 4);
    			int YakKillsTill = skills.getXPToNextLevel(style) / (yakHealth * 4);
    			int LevelChange = skills.getCurrentSkillLevel(style) - startLevel;
    			int Xprint = 255;
    			int Yprint = 20;
    			int nextLvl = skills.getCurrentSkillLevel(style) + 1;
    			int perNextLvl = 100 - skills.getPercentToNextLevel(style);
    
    			float XPperSec = 0;
    			if ((minutes > 0 || hours > 0 || seconds > 0) && XPChange > 0) {
    				XPperSec = XPChange
    						/ (seconds + minutes * 60 + hours * 60 * 60);
    			}
    
    			float XPperMin = XPperSec * 60;
    			float XPperHour = XPperMin * 60;
    			float timeTillLvl = 9999;
    			int minsTillLvl = (int) timeTillLvl;
    
    			if (XPperMin > 0) {
    				timeTillLvl = skills.getXPToNextLevel(style) / XPperMin;
    			}
    			minsTillLvl = (int) timeTillLvl;
    
    			g.setColor(Color.red);
    			g.drawString("Killed: " + YakKills + " Yaks, " + YakKillsTill
    					+ " till next level.", Xprint, Yprint);
    			g.drawString("Runtime: " + hours + " hours " + minutes
    					+ " minutes " + seconds + " seconds.", Xprint, Yprint + 15);
    			g.drawString("Current: " + skills.getCurrentSkillLevel(style)
    					+ " levels and " + skills.getCurrentSkillExp(style)
    					+ " exp.", Xprint, Yprint + 30);
    			g.drawString("Gained: " + LevelChange + " levels and " + XPChange
    					+ " exp.", Xprint, Yprint + 45);
    			g.drawString(skills.getXPToNextLevel(style) + " XP to level "
    					+ nextLvl + ", only " + perNextLvl
    					+ "% left to next level.", Xprint, Yprint + 60);
    			g.drawString(XPperHour + " exp per Hour.", Xprint, Yprint + 75);
    
    			g.drawString("Approximitly " + minsTillLvl
    					+ " Minutes till next Level!", Xprint, Yprint + 90);
    
    		}
    	}
    }
    
    
    Code:
    //version:2.2
    
    import com.speljohan.rsbot.script.*;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.bot.Bot;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import java.util.Map;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    
    import java.awt.event.*;
    import javax.swing.*;
    
    import java.awt.Graphics;
    import java.io.IOException;
    import java.lang.reflect.Method;
    
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    
    import com.speljohan.rsbot.accessors.NPC;
    
    
    
    
    
    public class Stronghold extends Script implements PaintListener,ActionListener {
    
    	public double version = 2.2;
    
    	private final int MINOTAUR27_ID = 4406;
    	private final int MINOTAUR12_ID = 4404;
    	private final int GOBLIN5_ID = 4407;
    	private final int GOBLIN11_ID = 4409;
    	private final int GOBLIN13_ID = 4408;
    	private final int GOBLIN161_ID = 4412;
    	private final int GOBLIN162_ID = 4410;
    	private final int[] GOBLIN16_ID =new int[] {  4412, 4410};
    	private final int GOBLIN25_ID = 4411;
    	private final int[] GOBLIN5to13_ID = new int[] { 4408, 4407, 4409};
    	private final int[] GOBLIN16to25_ID = new int[] { 4412, 4411};
    	private final int[] MINO12andWOLF_ID = new int[] { 4413, 4404};
    	private final int[] ALL_ID = new int[] { 4414, 4413, 4408, 4412, 4411, 4410, 4407, 4409, 4404, 4406};
    	private final int WOLF1_ID = 4413;
    	private final int WOLF2_ID = 4414;
    	private final int[] WOLF_ID = new int[] { 4413, 4414};
    
    	private final int GRAT1_ID = 4395;
    	private final int GRAT2_ID = 4944;
    	private final int ZOMBIE31_ID = 4392;
    	private final int ZOMBIE32_ID = 5375;
    	private final int ZOMBIE33_ID = 5376;
    	private final int ZOMBIE44_ID = 4393;
    	private final int FLESH28_ID = 4389;
    	private final int FLESH35_ID = 4390;
    
    	private final int GSPIDER_ID = 4400;
    	private final int SPIDER_ID = 4401;
    
    
    
    
    	private final int MINOTAUR27_HP = 22;
    	private final int MINOTAUR12_HP = 10;
    	private final int GOBLIN5_HP = 5;
    	private final int GOBLIN11_HP = 7;
    	private final int GOBLIN13_HP = 17;
    	private final int GOBLIN16_HP = 22;
    	private final int GOBLIN25_HP = 26;
    	private final int WOLF1_HP = 16;
    	private final int WOLF2_HP = 10;
    
    	private final int GRAT_HP = 25;
    	private final int ZOMBIE_HP = 30;
    	private final int ZOMBIE44_HP = 40;
    	private final int FLESH28_HP = 35;
    	private final int FLESH35_HP = 25;
    
    	private final int GSPIDER_HP = 50;
    	private final int SPIDER_HP = 22;
    
    
    
    	public int[] monsterIDS = new int[] {MINOTAUR27_ID, MINOTAUR12_ID, GOBLIN5_ID, GOBLIN11_ID ,
    			GOBLIN13_ID, GOBLIN161_ID, GOBLIN162_ID, GOBLIN25_ID, WOLF1_ID, WOLF2_ID,
    
    			GRAT1_ID,GRAT2_ID,ZOMBIE31_ID, ZOMBIE32_ID, ZOMBIE33_ID,ZOMBIE44_ID, FLESH28_ID,FLESH35_ID,
    
    			GSPIDER_ID, SPIDER_ID };
    
    	public int[] monsterHPS = new int[] {MINOTAUR27_HP, MINOTAUR12_HP, GOBLIN5_HP, GOBLIN11_HP ,
    			GOBLIN13_HP, GOBLIN16_HP, GOBLIN16_HP, GOBLIN25_HP, WOLF1_HP, WOLF2_HP,
    
    			GRAT_HP,GRAT_HP,ZOMBIE_HP,ZOMBIE_HP,ZOMBIE_HP,ZOMBIE44_HP,FLESH28_HP,FLESH35_HP,
    
    			GSPIDER_HP, SPIDER_HP };
    
    
    
    	public int MONSTER_ID[] = {0,0,0,0,0,0};
    	public final int[] FOOD_ID = { 1895,1893,1891, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229 }; //Has almost every food cookable in runescape, members and non!
    	public final int[] FOOD_HEAL = { 4,4,4,3, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 10, 8, 10, 10, 15, 14, 3, 1, 3, 3, 1, 18, 5, 6, 7, 7, 8, 9, 8, 10, 11, 9, 12, 13, 14, 16, 20, 21, 22, 6, 7, 8, 5, 5, 5, 6, 6, 7, 7, 6, 6, 6, 6, 8, 8, 11, 11, 11, 11, 11, 19, 7, 7, 8, 8, 9, 9, 11, 11, 4, 4, 4, 5, 5, 5, 2, 5, 5, 8, 5, 5, 11, 13, 1, 4, 14, 14, 16, 16, 22, 1, 2, 11, 11, 3, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 8, 7, 8, 7, 5, 5, 5, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 5, 5, 5, 5, 12, 12, 7, 7, 15, 15, 15, };
    	private final int[] ARROWS_ID = new int[] { 638, 640, 882, 884, 886, 888, 863};
    	public final int[] 	CHARMS_ID = new int[] { 12158, 12159, 12160, 12163 };
    	public final int[] 	HERBS_ID = new int[] { 207, 213 };
    	public final int[] 	RUNES_ID = new int[] { 554, 561, 4696 };
    	public final int[] 	STACKABLES_ID = new int[] {};
    	public final int[] 	UNSTACKABLES_ID = new int[] {};
    	public final int[] 	rubbish = new int[] {};
    
    
    	private int health = 10;
    	private int anti = 0;
    	private int check = 0;
    	private int run = 0;
    	private int monsterHealth = 22;
    	public int startHealthXP = 99999999;
    	public int state = 1;
    	public int refill = 0;
    	public int BANKFOOD_ID = 0;
    	public String BANKFOOD = "food";
    	public int BANK = 0;
    	public int DIE = 0;
    	public int cave = 10;
    	public int arrows = 0;
    	public int charms = 0;
    	public int herbs = 0;
    	public int runes = 0;
    	public int equipedarrows = 0;
    	public boolean pot = false;
    	public boolean bones = false;
    	public boolean bury = false;
    
    	public RSTile oldPosition = new RSTile(0,0);
    	public int standingCount = 0;
    	public boolean logout = false;
    
    	public int[] caves = {2,3,5,8,10,16,17,18,25,28,35};
    	public final int ENTRANCE_ID = 16154;
    
    	private final int[] DOOR = new int[]{16124, 16123, 16065, 16066,16089,16090};
    
    	public static final int[] bankWindows = new int[] { 11758, 11402 };
    	public static final int[] ladders = new int[] { 16148 };
    
    
    	public int DEFENCE = 1;
    	public int ATTACK = 0;
    	public int STRENGTH = 2;
    	public int RANGE = 4;
    	public int style = 0;
    	public String style2 = "Attack";
    	public int selectStyle = 0;
    	public boolean quickAttack = true;
    
    
    	public int checkCount = 0;
    
    	public int startLevel = 0;
    	public int startXP = 0;
    	public long startTime = System.currentTimeMillis();
    	public long time = System.currentTimeMillis();
    
    
    	private final RSTile[] GATE1A = {new RSTile(1858, 5238), new RSTile(1859, 5238) } ;
    	private final RSTile[] GATE1B = {new RSTile(1858, 5235), new RSTile(1859, 5235) } ;
    
    	private final RSTile[] GATE2A = {new RSTile(1865, 5227), new RSTile(1865, 5226) } ;
    	private final RSTile[] GATE2B = {new RSTile(1868, 5227), new RSTile(1868, 5226) } ;
    
    	private final RSTile[] GATE3A = {new RSTile(1867, 5218), new RSTile(1867, 5217) } ;
    	private final RSTile[] GATE3B = {new RSTile(1870, 5218), new RSTile(1870, 5217) } ;
    
    	private final RSTile[] GATE4A = {new RSTile(1865, 5227), new RSTile(1865, 5226) } ;
    	private final RSTile[] GATE4B = {new RSTile(1868, 5227), new RSTile(1868, 5226) } ;
    
    	private final RSTile[] GATE5A = {new RSTile(1876, 5240), new RSTile(1876, 5239) } ;
    	private final RSTile[] GATE5B = {new RSTile(1879, 5240), new RSTile(1879, 5239) } ;
    
    	private final RSTile[] GATE6A = {new RSTile(1878, 5223), new RSTile(1879, 5223) } ;
    	private final RSTile[] GATE6B = {new RSTile(1878, 5226), new RSTile(1879, 5226) } ;
    
    	private final RSTile[] GATE7A = {new RSTile(1874, 5207), new RSTile(1875, 5207) } ;
    	private final RSTile[] GATE7B = {new RSTile(1874, 5204), new RSTile(1875, 5204) } ;
    
    	private final RSTile[] GATE8A = {new RSTile(1876, 5240), new RSTile(1876, 5239) } ;
    	private final RSTile[] GATE8B = {new RSTile(1879, 5240), new RSTile(1879, 5239) } ;
    
    	private final RSTile[] GATE9A = {new RSTile(1884, 5244), new RSTile(1884, 5243) } ;
    	private final RSTile[] GATE9B = {new RSTile(1887, 5244), new RSTile(1887, 5243) } ;
    
    	private final RSTile[] GATE10A = {new RSTile(1886, 5236), new RSTile(1886, 5235) } ;
    	private final RSTile[] GATE10B = {new RSTile(1889, 5236), new RSTile(1889, 5235) } ;
    
    
    
    
    	private final RSTile[] GATE19A = {new RSTile(2039, 5245), new RSTile(2039, 5246) } ;
    	private final RSTile[] GATE19B = {new RSTile(2037, 5245), new RSTile(2037, 5246) } ;
    
    	private final RSTile[] GATE20A = {new RSTile(2044, 5239), new RSTile(2045, 5239) } ;
    	private final RSTile[] GATE20B = {new RSTile(2044, 5237), new RSTile(2045, 5237) } ;
    
    	private final RSTile[] GATE23A = {new RSTile(2037, 5203), new RSTile(2036, 5203) } ;
    	private final RSTile[] GATE23B = {new RSTile(2037, 5201), new RSTile(2036, 5201) } ;
    
    	private final RSTile[] GATE26A = {new RSTile(2045, 5197), new RSTile(2046, 5197) } ;
    	private final RSTile[] GATE26B = {new RSTile(2045, 5195), new RSTile(2046, 5195) } ;
    
    	private final RSTile[] GATE30A = {new RSTile(2016,5227), new RSTile(2016,5228) } ;
    	private final RSTile[] GATE30B = {new RSTile(2018,5227), new RSTile(2018,5228) } ;
    
    	private final RSTile[] GATE34A = {new RSTile(2005, 5237), new RSTile(2006, 5237) } ;
    	private final RSTile[] GATE34B = {new RSTile(2005, 5235), new RSTile(2006, 5235) } ;
    
    
    
    
    
    	private final RSTile[] GATE38A = {new RSTile(2133, 5257), new RSTile(2132, 5257) } ;
    	private final RSTile[] GATE38B = {new RSTile(2133, 5260), new RSTile(2132, 5260) } ;
    
    	private final RSTile[] GATE40A = {new RSTile(2133, 5278), new RSTile(2132, 5278) } ;
    	private final RSTile[] GATE40B = {new RSTile(2133, 5281), new RSTile(2132, 5281) } ;
    
    	private final RSTile[] GATE43A = {new RSTile(2138, 5294), new RSTile(2138, 5295) } ;
    	private final RSTile[] GATE43B = {new RSTile(2141, 5294), new RSTile(2141, 5295) } ;
    
    	private final RSTile[] GATE44A = {new RSTile(2149, 5299), new RSTile(2148, 5299) } ;
    	private final RSTile[] GATE44B = {new RSTile(2149, 5302), new RSTile(2148, 5302) } ;
    
    	private int[] portals = {16150,16082};
    
    
    
    
    	private final RSTile[] strongholdTObank = { new RSTile (3081, 3421),
    			 new RSTile (3095, 3419),
    			 new RSTile (3108, 3420),
    			 new RSTile (3122, 3415),
    			 new RSTile (3134, 3416),
    			 new RSTile (3146, 3416),
    			 new RSTile (3158, 3419),
    			 new RSTile (3169, 3427),
    			 new RSTile (3180, 3428),
    			 new RSTile (3187, 3437) };
    	public final RSTilePath toBankPath = new RSTilePath(strongholdTObank, this);
    
    
    	private final RSTile[] DeathWalk = {
    			  new RSTile (3222, 3220),
    			  new RSTile (3235, 3221),
    			  new RSTile (3246, 3226),
    			  new RSTile (3257, 3232),
    			  new RSTile (3258, 3246),
    			  new RSTile (3252, 3257),
    			  new RSTile (3248, 3269),
    			  new RSTile (3241, 3280),
    			  new RSTile (3239, 3292),
    			  new RSTile (3239, 3304),
    			  new RSTile (3239, 3316),
    			  new RSTile (3250, 3321),
    			  new RSTile (3263, 3324),
    			  new RSTile (3253, 3331),
    			  new RSTile (3241, 3335),
    			  new RSTile (3229, 3337),
    			  new RSTile (3226, 3350),
    			  new RSTile (3216, 3358),
    			  new RSTile (3203, 3361),
    			  new RSTile (3196, 3371),
    			  new RSTile (3185, 3377),
    			  new RSTile (3173, 3385),
    			  new RSTile (3168, 3397),
    			  new RSTile (3161, 3407),
    			  new RSTile (3151, 3415),
    			  new RSTile (3138, 3416),
    			  new RSTile (3126, 3416),
    			  new RSTile (3113, 3419),
    			  new RSTile (3101, 3420),
    			  new RSTile (3089, 3420),
    			  new RSTile (3081, 3423)
    			};
    	public final RSTilePath DeathPath = new RSTilePath(DeathWalk, this);
    
    
    	public RSCharacter old;
    	public int NPCChange=0;
    
    
    
    	public String getName() {
    		return "Stronghold";
    	}
    
    	public String getScriptCategory() {
    		return "Combat";
    	}
    
    
    	public String getAuthor() {
    		return "Bug5532";
    	}
    
    	public double getVersion() {
    		return 2.20;
    	}
    
    	public boolean caveCheck(){
    		if(BANK==1){
    			for(int i=0;i<caves.length;i++){
    				if (cave==caves[i]){
    					return true;
    				}
    			}
    			return false;
    		}
    		return true;
    	}
    	public boolean gui = true;
    	public boolean onStart(Map<String, String> args) {
    
    		startup();
    
    		for (int i=0; i<4; i++){
    		MONSTER_ID[i] = 0;
    		}
    
    		//BANKFOOD_ID = Integer.parseInt(args.get("food"));
    		if (!args.get("food").equals("")){
    		BANKFOOD = args.get("food");
    		}
    
    		if (!args.get("cave").equals("")){
    		cave = Integer.parseInt(args.get("cave"));
    		}
    
    
    		if (args.get("des").equals("paint")){
    			gui = false;
    		}
    
    
    
    		if (args.get("style").equals("attack")){
    			style2 = "Attack";
    			style = ATTACK;
    		}
    		if (args.get("style").equals("defence")) {
    			style2 = "Defence";
    			style = DEFENCE;
    		}
    		if (args.get("style").equals("strength")) {
    			style2 = "Strength";
    			style = STRENGTH;
    		}
    		if (args.get("style").equals("range")) {
    			style2 = "Range";
    			style = RANGE;
    		}
    
    		if (args.get("bones") != null) bones = true;
    		if (args.get("burybones") != null) bury = true;
    		if (args.get("potion") != null) pot = true;
    		if (args.get("special") != null) sOn = true;
    		if (args.get("bank") != null) BANK = 1;
    		if (args.get("die") != null) DIE = 1;
    		if (args.get("quickattack") == null) quickAttack=false;
    		if (args.get("arrows") != null) arrows = 1;
    		if (args.get("runes") != null) runes = 1;
    		if (args.get("charms") != null) charms = 1;
    		if (args.get("herbs") != null) herbs = 1;
    
    		if (!caveCheck()){
    			log("Banking does not work in cave "+cave+". Please read the forum and try again.");
    			log("Do not post this in the forum, or I will ban you ;) .");
    			return false;
    		}
    
    		if (args.get("monster").equals("Goblins_Low_Lvl")) {
    			MONSTER_ID = GOBLIN5to13_ID;
    			monsterHealth = GOBLIN13_HP ;
    		}
    		if (args.get("monster").equals("Goblins_High_Lvl")) {
    			MONSTER_ID = GOBLIN16to25_ID;
    			monsterHealth = GOBLIN25_HP ;
    		}
    		if (args.get("monster").equals("Minotaur_Lvl_12_and_Wolf")) {
    			MONSTER_ID = MINO12andWOLF_ID;
    			monsterHealth = WOLF1_HP ;
    		}
    		if (args.get("monster").equals("All")) {
    			MONSTER_ID = monsterIDS;
    			monsterHealth = WOLF1_HP ;
    		}
    
    		if (args.get("monster").equals("Giant_Spiders")) {
    			MONSTER_ID[0] = GSPIDER_ID;
    			monsterHealth = GSPIDER_HP ;
    		}
    
    
    		if (args.get("monster").equals("Goblin_Lvl_5")) {
    			MONSTER_ID[0] = GOBLIN5_ID;
    			monsterHealth = GOBLIN5_HP ;
    		}
    		if (args.get("monster").equals("Goblin_Lvl_11")) {
    			MONSTER_ID[0] = GOBLIN11_ID;
    			monsterHealth = GOBLIN11_HP ;
    		}
    		if (args.get("monster").equals("Goblin_Lvl_13")) {
    			MONSTER_ID[0] = GOBLIN13_ID;
    			monsterHealth = GOBLIN13_HP ;
    		}
    		if (args.get("monster").equals("Goblin_Lvl_16")) {
    			MONSTER_ID = GOBLIN16_ID;
    			monsterHealth = GOBLIN16_HP ;
    		}
    		if (args.get("monster").equals("Goblin_Lvl_25")) {
    			MONSTER_ID[0] = GOBLIN25_ID;
    			monsterHealth = GOBLIN25_HP ;
    		}
    
    		if (args.get("monster").equals("Minotaur_Lvl_12")){
    			MONSTER_ID[0] = MINOTAUR12_ID;
    			monsterHealth = MINOTAUR12_HP ;
    		}
    		if (args.get("monster").equals("Minotaur_Lvl_27")) {
    			MONSTER_ID[0] = MINOTAUR27_ID;
    			monsterHealth = MINOTAUR27_HP ;
    		}
    
    		if (args.get("monster").equals("Wolf")) {
    			MONSTER_ID = WOLF_ID;
    			monsterHealth = WOLF1_HP ;
    		}
    
    
    
    		log("Training: " + args.get("style")+ "." );
    		log("Fighting: " + args.get("monster")+ "." );
    		if(MONSTER_ID[1] == 0){
    		log("Monsters ID: " + MONSTER_ID + ". Monster Health: " + monsterHealth + ".");
    		}
    		//log("Food ID: "+BANKFOOD_ID+".");
    		//FOOD_ID[0] = BANKFOOD_ID;
    		if (!args.get("food").equals("")){
    		log("Food: "+BANKFOOD+".");
    		}
    		if (BANK==1) log("Banking is activated.");
    
    
    		startLevel = 0;
    		startTime = System.currentTimeMillis();
    		if (isLoggedIn()) {
    			startLevel = skills.getCurrentSkillLevel(style);
    			startXP = skills.getCurrentSkillExp(style);
    		}
    		Bot.getEventManager().addListener(PaintListener.class, this);
    		if(gui)createAndShowGUI();
    		return true;
    	}
    
    	@Override
    	public void onFinish() {
    		Bot.getEventManager().removeListener(PaintListener.class, this);
    		Thread1.run=false;
    	}
    
    
    	public void zeroLabels(){
     		for (int i=0; i<labelUpdate.length; i++){
     			labelUpdate[i] = new JLabel("-");
     		}
     	}
    
    
    
     	public JLabel[] labelUpdate = new JLabel[9];
    
    
    
     	private void createAndShowGUI() {
    
     		zeroLabels();
     		JFrame frame = new JFrame("Progress Report");// the frame
     	 	frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    
     	 	JPanel panel = new JPanel(new GridBagLayout());
     	 	GridBagConstraints c = new GridBagConstraints();
     	 	JLabel label;
    
    
     	 	c.anchor = GridBagConstraints.WEST;
     	 	for (int i=0; i<labelUpdate.length; i++){
     	 	 	c.gridx = 0;
     	 	 	c.gridy = i;
     	 	 	label = labelUpdate[i];
     	 	 	panel.add(label, c);
     	 	}
     	     //Display the window.
     	 	frame.add(panel);
     	     frame.setSize(400, 250);
     	 	//frame.pack();
     	     frame.setVisible(true);
    
     	 }
    
    	//paint
    	public int NPCID=0;
    	public void onRepaint(Graphics g) {
    		if (isLoggedIn()) {
    
    			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 XPChange = skills.getCurrentSkillExp(style) - startXP;
    			int MinoKills = XPChange/(monsterHealth*4);
    			int MinoKillsTill = skills.getXPToNextLevel(style)/(monsterHealth*4);
    			int LevelChange = skills.getCurrentSkillLevel(style) - startLevel;
    			int Xbox = 200;
    			int Ybox = 350;
    			int Xprint = Xbox + 5;
    			int Yprint = Ybox + 15;
    			int nextLvl = skills.getCurrentSkillLevel(style) +1;
    			int perNextLvl = 100 - skills.getPercentToNextLevel(style);
    
    
    
    			float XPperSec = 0;
    			if ((minutes > 0 || hours > 0 || seconds > 0) && XPChange > 0) {
    				XPperSec = ((float) XPChange)/(float)(seconds + (minutes*60) + (hours*60*60));
    			}
    
    			float XPperMin = XPperSec*60;
    			float XPperHour = XPperMin*60;
    			float timeTillLvl = 9999;
    			float secsTillLvl = (int) timeTillLvl;
    			float minsTillLvl = (int) timeTillLvl;
    			float hoursTillLvl = (int) timeTillLvl;
    
    			if (XPperSec > 0) {
    				secsTillLvl = skills.getXPToNextLevel(style)/XPperSec ;
    				}
    			if (XPperMin > 0) {
    				minsTillLvl = skills.getXPToNextLevel(style)/XPperMin ;
    				}
    			if (XPperHour > 0) {
    				hoursTillLvl = skills.getXPToNextLevel(style)/XPperHour ;
    				}
    			secsTillLvl -= (int) minsTillLvl*60;
    			minsTillLvl -= (int) hoursTillLvl*60;
    
    			if (minsTillLvl < 0) minsTillLvl = 0;
    
    			if (gui){
    			labelUpdate[0].setText(""+getName()+" v"+getVersion());
    			labelUpdate[1].setText("Killed: " + MinoKills + " Monsters, " + MinoKillsTill + " till next level.");
    	 		labelUpdate[2].setText("Runtime: " + hours + " hours " + minutes
    			+ " minutes " + seconds + " seconds.");
    	 		labelUpdate[3].setText("Current: " + skills.getCurrentSkillLevel(style)
    						+ " levels and " + skills.getCurrentSkillExp(style) + " exp.");
    	 		labelUpdate[4].setText("Gained: " + LevelChange + " levels and " + XPChange
    					+ " exp.");
    	 		labelUpdate[5].setText(skills.getXPToNextLevel(style)
    					+ " XP to level " + nextLvl + ", only "
    					+ perNextLvl + "% left to next level.");
    	 		labelUpdate[6].setText((int)XPperHour	+ " exp per Hour.");
    	 		labelUpdate[7].setText("Approximately " + (int)hoursTillLvl + " hours and " + (int)minsTillLvl
    					+ " minutes till next level!");
    	 		labelUpdate[8].setText("");
    			}
    
    			if (!gui){
    			g.setColor(Color.red);
    			g.drawRoundRect(Xbox, Ybox, 290 - 1, 110 - 1,20,20);
    			g.setColor(new Color(255, 255, 255, 140));
    			//g.setColor(Color.white);
    			g.fillRoundRect(Xbox + 1, Ybox + 1, 290 - 2, 110 - 2,20,20);
    
    
    			g.setColor(Color.black);
    			g.drawString("Killed: " + MinoKills + " Monsters, " + MinoKillsTill + " till next level." , Xprint, Yprint);
    			g.drawString("Runtime: " + hours + " hours " + minutes
    					+ " minutes " + seconds + " seconds.", Xprint, Yprint+15);
    			g.drawString("Current: " + skills.getCurrentSkillLevel(style)
    					+ " levels and " + skills.getCurrentSkillExp(style) + " exp.",
    					Xprint, Yprint+30);
    			g.drawString("Gained: " + LevelChange + " levels and " + XPChange
    					+ " exp.", Xprint, Yprint+45);
    			g.drawString(skills.getXPToNextLevel(style)
    					+ " XP to level " + nextLvl + ", only "
    					+ perNextLvl + "% left to next level.",
    					Xprint, Yprint+60);
    			g.drawString((int)XPperHour	+ " exp per Hour."  ,	Xprint, Yprint+75);
    
    			g.drawString("Approximately " + (int)hoursTillLvl + " hours and " + (int)minsTillLvl
    					+ " minutes till next level!",	Xprint, Yprint+90);
    		//	g.drawString("Int:"+(getMyPlayer().getInteracting() != null), Xprint,Yprint+105);
    
    			}
    		}
    	}
    
    	public void getNPCsID(){
    		int[] validNPCs = Bot.getClient().getNPCIndexArray();
    		NPC[] npcs = Bot.getClient().getNPCArray();
    		RSCharacter npcChar = getMyPlayer().getInteracting();
    
    		for (int element : validNPCs) {
    			if (npcs[element] == null)
    				continue;
    
    			RSNPC npc = new RSNPC(npcs[element]);
    			if(npc.equals(npcChar))
    				NPCID = npc.getID();
    				break;
    		}
    
    	}
    
    	public void pickUpArrows() {
    
    
    		for (int i = 0 ; i<10; i++) {
    		RSItemTile arrow = getNearestGroundItemByID(10, ARROWS_ID);
    		if (arrow != null) {
    			log("Found Arrow " + (i+1) +".");
    			if(!isInventoryFull() || checkIfGroundItemIsInInventory(arrow,ARROWS_ID)){
    				if(atTile(arrow, "arrow")){
    					wait(random(200,500));
    					}
    				}
    			}else{
    				break;
    			}
    		}
    	}
    
    	public void equipArrows() {
    		if (inventoryContains(equipedarrows)){
    			if (getInventoryItemByID(equipedarrows).getStackSize() > random(100,150)){
    				atInventoryItem(equipedarrows, "Wield");
    			}
    		}
    	}
    
    
    
    
    
    	public int escape() {
    
    		if (BANK == 1){
    		refill = 1;
    		return random(100,200);
    		}
    
    
    		RSPlayer myPlayer = getMyPlayer();
    
    		if (myPlayer.getAnimation() == 4282  || myPlayer.getAnimation() == 4283) {
    			beep();
    			return -1;
    		}
    
    
    
    		RSObject door = findObject(DOOR);
    		if (door != null){
    		atObject(door, "Open");
    		}else{
    			beep();
    			return -1;
    		}
    
    
    
    		if (myPlayer.getAnimation() == 4282  || myPlayer.getAnimation() == 4283) {
    			beep();
    			return -1;
    		}
    
    		return random(100,200);
    
    
    
    	}
    
    
    
    
    	public boolean atNPC2(RSNPC npc, String action) {
    		if (npc == null) return false;
    		RSTile tile = npc.getLocation();
    		if (!tile.isValid()) return false;
    		if (distanceTo(tile) > 4) {
    			walkTileMM(tile);
    			wait(random(500,1000));
    		}
    		return clickCharacter2(npc, action);
    	}
    
    	public boolean clickCharacter2(RSCharacter c, String action) {
    		Point screenLoc = null;
    		for (int i = 0; i < 20; i++) {
    			screenLoc = c.getScreenLocation();
    			if (!c.isValid() || !pointOnScreen(screenLoc)) {
    				System.out.println("Not on screen " + action);
    				return false;
    			}
    			if (getMouseLocation().equals(screenLoc)) break;
    			moveMouse(screenLoc);
    		}
    		screenLoc = c.getScreenLocation();
    		if (!getMouseLocation().equals(screenLoc)|| getMyPlayer().getInteracting() != null) return false;
    		if (getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
    			clickMouse(screenLoc, true);
    			return true;
    		} else {
    			clickMouse(screenLoc, false);
    			return atMenu(action);
    		}
    	}
    
    
    
    
        public int[] equipedarray;
        public void getEquipedItems(){
        	equipedarray = getEquipmentArray();
        	log("Equipment checked");
    
        }
    
        public void equipEquipedItems(){
        	for (int i = 0; i<equipedarray.length; i++){
        		//log("checking for item id: "+ equipedarray[i]);
        	if(inventoryContains(equipedarray[i])&&!equipmentContains(equipedarray[i])){
        		openTab(TAB_INVENTORY);
        		if(atInventoryItem( equipedarray[i],"Wield") == false){
        			atInventoryItem( equipedarray[i],"Wear");
        		}
        	}
        	}
    
        }
    
    
    
    	public void antiban() {
    
    		anti = random(0,110);
    
    		if (anti <= 35){
    			moveMouse(random(0,764),random(0,501));
    
    		}
    
    		if (anti >= 36 && anti <= 41 ){
    			if(random(0,1)==1) {
    				myOpenTab(random(0,12));
    			}else{
    			openTab(random(0,12));
    			}
    		}
    
    		if (anti >= 42 && anti <= 52){
    			if(random(0,1)==1) myOpenTab(TAB_STATS);
    			openTab(TAB_STATS);
    			wait( random(250,700));
    			moveMouse(random(556,707),random(230,442));
    			wait( random(750,1500));
    		}
    
    		if (anti >= 53 && anti <= 63){
    			if (!isRunning()){
    			setRun(true);
    			}else {
    				if(random(0,1)==1) myOpenTab(TAB_STATS);
    				openTab(TAB_STATS);
    				wait( random(350,800));
    				moveMouse(random(556,648),random(230,281));
    				wait( random(550,1300));
    
    			}
    		}
    		if (anti >= 64 && anti <= 90){
    			rotate();
    		}
    
    
    
    	}
    
    
    	public void rotate() {
    		int button = random(37,40);
    		Bot.getInputManager().pressKey((char) button);
    		wait(random(500, 1500));
    		Bot.getInputManager().releaseKey((char) button);
    
    	}
    
    
    
    	public RSNPC getNextNPCByID(int... ids) {
    		int Dist = 20;
    		RSNPC closest = null;
    		int[] validNPCs = Bot.getClient().getNPCIndexArray();
    		NPC[] npcs = Bot.getClient().getNPCArray();
    
    		for (int element : validNPCs) {
    			if (npcs[element] == null) {
    				continue;
    			}
    			RSNPC Monster = new RSNPC(npcs[element]);
    			try {
    				for (int id : ids) {
    					if (id != Monster.getID()) {
    						continue;
    					}
    					int distance = distanceTo(Monster);
    					if (distance < Dist && (Monster.getInteracting() == null || Monster.getInteracting() == getMyPlayer() || Monster.getInteracting().getInteracting() != Monster)  && !Monster.isInCombat()) {
    						Dist = distance;
    						closest = Monster;
    					}
    				}
    			} catch (Exception e) {}
    		}
    		return closest;
    	}
    
    	public RSNPC getBusyNPCByID(int... ids) {
    		int Dist = 20;
    		RSNPC closest = null;
    		int[] validNPCs = Bot.getClient().getNPCIndexArray();
    		NPC[] npcs = Bot.getClient().getNPCArray();
    
    		for (int element : validNPCs) {
    			if (npcs[element] == null) {
    				continue;
    			}
    			RSNPC Monster = new RSNPC(npcs[element]);
    			try {
    				for (int id : ids) {
    					if (id != Monster.getID()) {
    						continue;
    					}
    					int distance = distanceTo(Monster);
    					if (distance < Dist && canReach(Monster,true)) {
    						Dist = distance;
    						closest = Monster;
    					}
    				}
    			} catch (Exception e) {}
    		}
    		return closest;
    	}
    
    	public void styleSelecter() {
    		for(int j=70; j<101 ; j++) {
    			for(int i=27; i<37 ; i++) {
    				if (RSInterface.getChildInterface(j, i).containsText(style2)) {
    					openTab(TAB_ATTACK);
    					wait(random(500,1000));
    					atInterface(j,i);
    					log("Style Set, Training "+ style2);
    					selectStyle = 1;
    				}
    
    				}
    			}
    		if (selectStyle == 0) {
    			log("Setting Style Failed.");
    			selectStyle = 1;
    		}
    
    	}
    
    
    	public void changeMonsterHealth(RSNPC monster) {
    
    		int id;
    		id = monster.getID();
    	for (int i= 0 ; i < monsterIDS.length; i++ ) {
    		if (id == monsterIDS[i] ){
    			monsterHealth = monsterHPS[i];
    		}
    	}
    	}
    
    	public boolean playerInBox(int n,int s,int e,int w) {
    		int x = getMyPlayer().getLocation().getX();
    		int y = getMyPlayer().getLocation().getY();
    		if (n >= y && s <= y && x <= e && x >= w){
    			return true;
    		}
    		return false;
    	}
    
    
    	public int whichCave() {
    		int c= 0;
    		if (canReach(getObjectAt(1865,5242), true)) c=1;
    		if (canReach(getObjectAt(1863,5225), true)) c=2;
    		if (canReach(getObjectAt(1870,5228), true)) c=3;
    		if (canReach(getObjectAt(1872,5215), true)) c=5;
    		if (canReach(getObjectAt(1881,5244), true)) c=6;
    		if (canReach(getObjectAt(1886,5232), true)) c=7;
    		if (canReach(getObjectAt(1873,5200), true)) c=8;
    		if (canReach(getObjectAt(1901,5239), true)) c=10;
    		if (canReach(getObjectAt(1908,5224), true)) c=14;
    
    		if (canReach(getObjectAt(2043,5245), true)) c=15;
    		if (canReach(getObjectAt(2025,5235), true)) c=16;
    		if (canReach(getObjectAt(2037,5215), true)) c=17;
    		if (canReach(getObjectAt(2043,5207), true)) c=171;
    		if (canReach(getObjectAt(2043,5193), true)) c=18;
    		if (canReach(getObjectAt(2022,5215), true)) c=26;
    		if (canReach(getObjectAt(2005,5233), true)) c=22;
    		if (canReach(getObjectAt(2005, 5240), true)) c=25;
    
    
    		if (canReach(getObjectAt(2124,5258), true)) c=27;
    		if (canReach(getObjectAt(2119,5273), true)) c=28;
    		if (canReach(getObjectAt(2135,5288), true)) c=36;
    		if (canReach(getObjectAt(2149,5296), true)) c=34;
    		if (canReach(getObjectAt(2145,5307), true)) c=35;
    
    
    		return c;
    	}
    
    
    
    
    	public static int max(int[] t) {
    	    int maximum = t[0];   // start with the first value
    	    for (int i=1; i<t.length; i++) {
    	        if (t[i] > maximum) {
    	            maximum = t[i];   // new maximum
    	        }
    	    }
    	    return maximum;
    	}//end method max
    
    	public static int min(int[] t) {
    	    int minimum = t[0];   // start with the first value
    	    for (int i=1; i<t.length; i++) {
    	        if (t[i] < minimum) {
    	            minimum = t[i];   // new maximum
    	        }
    	    }
    	    return minimum;
    	}//end method min
    
    	public static int min2(int[] t) {
    	    int minimum = t[0];   // start with the first value
    	    for (int i=1; i<t.length; i++) {
    	        if (t[i] < minimum) {
    	            minimum = i;   // new maximum
    	        }
    	    }
    	    return minimum;
    	}
    
    
    	public void beep(){
    		java.awt.Toolkit.getDefaultToolkit().beep();
    		wait(150);
    		java.awt.Toolkit.getDefaultToolkit().beep();
    		wait(150);
    		java.awt.Toolkit.getDefaultToolkit().beep();
    		wait(random(100, 500));
    	}
    
    
    
    
    
    
    	public void grabCharms() {
    		for (int i = 0 ; i<5; i++) {
    			RSItemTile charm = getNearestGroundItemByID(15,CHARMS_ID);
    			if (charm != null) {
    			if(!isInventoryFull() || checkIfGroundItemIsInInventory(charm,CHARMS_ID)){
    					log("Picking up Charms.");
    					atTile(charm, "charm");
    					wait(random(1000,2000));
    					}
    				}
    			}
    		}
    
    	public void grabHerbs() {
    		for (int i = 0 ; i<5; i++) {
    			RSItemTile charm = getNearestGroundItemByID(15,HERBS_ID);
    			if (charm != null) {
    			if(!isInventoryFull() ){
    					log("Picking up Herbs.");
    					atTile(charm, "grimy");
    					wait(random(1000,2000));
    					}
    				}
    			}
    		}
    
    
    	public void grabRunes() {
    
    
    		for (int i = 0 ; i<5; i++) {
    			RSItemTile rune = getNearestGroundItemByID(15,RUNES_ID);
    			if (rune != null) {
    				if(!isInventoryFull() || checkIfGroundItemIsInInventory(rune,RUNES_ID)){
    					log("Picking up Runes.");
    					atTile(rune, "rune");
    					wait(random(1000,2000));
    					}
    				}
    			}
    		}
    
    	public void grabBones() {
    
    
    		for (int i = 0 ; i<5; i++) {
    			RSItemTile bones = getNearestGroundItemByID(15,BONES_ID);
    			if (bones != null) {
    				if(!isInventoryFull()){
    					log("Picking up Bones.");
    					atTile(bones, "Bones");
    					wait(random(500,1500));
    					}
    				}
    			}
    		}
    
    	public int BONES_ID=526;
    
    	public void buryBones() {
    
    		if (getInventoryCount(BONES_ID)>0 && isInventoryFull()){
    			for (int i=0; i<getInventoryCount(BONES_ID); i++) {
    				atInventoryItem(BONES_ID, "Bury");
    				wait(random(200,500));
    			}
    
    		}
    
    	}
    
    
    
    	public void grabStackables() {
    		RSItemTile item = getGroundItemByID(STACKABLES_ID);
    		if(!isInventoryFull() || inventoryContains(item.getItem().getID())){
    			if (item != null) {
    				for (int i = 0; i < STACKABLES_ID.length - 1; i++) {
    					atTile(getGroundItemByID(STACKABLES_ID[i]), "Take");
    				}
    			}
    		}
    	}
    	public void grabUnstackables() {
    		RSItemTile item = getNearestGroundItemByID(15,UNSTACKABLES_ID);
    		if(!isInventoryFull()){
    			if (item != null) {
    				for (int i = 0; i < UNSTACKABLES_ID.length - 1; i++) {
    					atTile(getGroundItemByID(UNSTACKABLES_ID[i]), "Take");
    				}
    			}
    		}
    	}
    
    	public RSItemTile getNearestGroundItemByID( int[] ids) {
    		return getNearestGroundItemByID(50,ids);
    	}
    	public RSItemTile getNearestGroundItemByID( int range, int id) {
    		int[] j = {id};
    		return getNearestGroundItemByID(range,j);
    	}
    
    	public RSItemTile getNearestGroundItemByID(int range, int[] ids) {
    		int pX = getMyPlayer().getLocation().getX();
    		int pY = getMyPlayer().getLocation().getY();
    		int minX = pX - range;
    		int minY = pY - range;
    		int maxX = pX + range;
    		int maxY = pY + range;
    		int dist = 100;
    		RSItemTile nItem = null;
    		for (int x = minX; x <= maxX; x++) {
    			for (int y = minY; y <= maxY; y++) {
    				if (Calculations.canReach(new RSTile(x,y), false)){
    					RSItemTile[] items = getGroundItemsAt(x, y);
    					for (RSItemTile item : items) {
    						int iId = item.getItem().getID();
    						for (int id : ids) {
    							if (iId == id) {
    							//	log(""+id+" at "+x+","+y);
    								if (distanceTo(new RSTile(x,y)) < dist){
    									dist = distanceTo(new RSTile(x,y));
    									nItem = item;
    								}
    
    
    
    							}
    						}
    					}
    				}
    			}
    		}
    		return nItem;
    	}
    
    	public boolean checkIfGroundItemIsInInventory(RSItemTile item2,int ids[]) {
    		RSItemTile[] items = getGroundItemsAt(item2.getX(),item2.getY());
    		for (RSItemTile item : items) {
    			int iId = item.getItem().getID();
    			for (int id : ids) {
    				if (iId == id) {
    					if (inventoryContains(id)) {
    						return true;
    					}
    				}
    			}
    		}
    		return false;
    	}
    
    	public boolean betweenGates(RSTile g1[],RSTile g2[]){
    		int n,s,e,w;
    		int[] y = { g1[0].getY(), g1[1].getY(),g2[0].getY(),g1[1].getY() } ;
    		int[] x = { g1[0].getX(), g1[1].getX(),g2[0].getX(),g1[1].getX() } ;
    		n = max(y);
    		s = min(y);
    		e = max(x);
    		w = min(x);
    		if (playerInBox(n,s,e,w)) {
    			return true;
    		}else{
    			return false;
    		}
    	}
    
    	public boolean betweenGates2 (RSTile g1[],RSTile g2[]){
    		return (canReach(getObjectAt(g1[0]) ,true)   &&   canReach(getObjectAt(g2[0]) ,true) );
    	}
    
    
    	public boolean travelTo(RSTile t) {
    		log("Travelling");
    		int myX = getMyPlayer().getLocation().getX();
    		int myY = getMyPlayer().getLocation().getY();
    		float Dx = t.getX() - myX;
    		float Dy = t.getY() - myY ;
    		float grad = Dy/Dx;
    		int yp = -1;
    		int xp = -1;
    		if ( Dx>0) xp = 1;
    		if ( Dy>0 ) yp = 1;
    
    		int steps = random(9,11);
    		int xsteps = steps *xp;
    		int ysteps = steps *yp;
    
    		//log("DistanceTo:"+distanceTo(t) + "      Xsteps:" + xsteps + "      Ysteps:" + ysteps  +  "   Grad:"+grad);
    
    
    
    //		log("grad:"+grad);
    
    		if (distanceTo(t) > 15){
    
    			if(grad>5 || grad<-5){
    				//log("big");
    				doWalk(new RSTile( myX, myY+ysteps ) );
    			}
    			if ((grad<=5 && grad > 3)||(grad>=-5 && grad < -3)) {
    				//log("5-3");
    				doWalk(new RSTile( myX + xsteps/3, myY+ysteps ) );
    			}
    			if ((grad<=3 && grad > 2)||(grad>=-3 && grad < -2)) {
    				//log("3-2");
    				doWalk(new RSTile( myX + xsteps/2, myY+ysteps ) );
    			}
    			if ((grad<=2 && grad > 0.5)||(grad>=-2 && grad < -0.5)) {
    				//log("2-0.5");
    				doWalk(new RSTile( myX + xsteps, myY+ysteps ) );
    			}
    			if (grad<=0.5 && grad >= -0.5) {
    			//	log("0");
    				doWalk(new RSTile( myX + xsteps, myY ) );
    			}
    
    			/*
    			if (grad <= 0){
    				if (grad < -1){
    					doWalk(new RSTile( myX+(xsteps), (int)(myY+(ysteps*grad)) ) );
    
    				}
    				if (grad >= -1){
    					doWalk(new RSTile( (int)(myX+(xsteps/grad)), myY+(ysteps) ) );
    
    				}
    				}
    			if (grad > 0){
    				if (grad < 1){
    					doWalk(new RSTile( myX+(xsteps), (int)(myY+(ysteps*grad)) ) );
    
    				}
    				if (grad >= 1){
    					doWalk(new RSTile( (int)(myX+(xsteps/grad)), myY+(ysteps) ) );
    
    				}
    
    			}*/
    			wait(random(1000,2000));
    			return false;
    		}
    		if (distanceTo(t) <= 15 && distanceTo(t) > 3){
    			walkTileMM(t);
    			wait(random(1000,2000));
    			return false;
    		}
    		return true;
    
    
    	}
    
    
    	public void goThroughGate(RSTile g[]) {
    		RSObject gate = getObjectAt(g[random(0,1)]);
    		if (gate != null){
    			if (distanceTo(gate.getLocation()) > 30) {
    				travelTo(gate.getLocation());
    				wait(random(1500, 3000));
    							}
    			if (distanceTo(gate.getLocation()) > 10) {
    				walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 )  );
    				wait(random(1500, 3000));
    			}
    			if (distanceTo(gate.getLocation()) > 3) {
    				walkTileMM(gate.getLocation());
    				wait(random(1500, 3000));
    			}
    
    			if (atObject(gate, "Open") == false) rotate();
    			wait(random(500,1000));
    		} else {
    			log("There is no gate.....FAIL!");
    		}
    
    
    	}
    
    	public void stuckInGate(){
    	if (canReach(getObjectAt(2034, 5185), true)) {
    		if(!atObject(getObjectAt(2036, 5185), "Open")) rotate();
    	}
    	}
    
    
    	public void goThroughPortal(int g) {
    		RSObject gate = findObject(g);
    		if (gate != null){
    			if (distanceTo(gate.getLocation()) > 10) {
    				walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 )  );
    				wait(random(1500, 3000));
    			}
    			if (distanceTo(gate.getLocation()) > 3) {
    				walkTileMM(gate.getLocation());
    				wait(random(1500, 3000));
    			}
    
    			atObject(gate, "Use");
    			wait(random(500,1000));
    		} else {
    			log("There is no portal.....FAIL!");
    		}
    
    
    	}
    
    
    	public void goDownLadder(int g) {
    		RSObject gate = findObject(g);
    		if (gate != null){
    			if (distanceTo(gate.getLocation()) > 10) {
    				walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 )  );
    				wait(random(1500, 3000));
    			}
    			if (distanceTo(gate.getLocation()) > 3) {
    				walkTileMM(gate.getLocation());
    				wait(random(1500, 3000));
    			}
    
    			atObject(gate, "Climb-down");
    			wait(random(1500,2000));
    			atInterface(579,17);
    			wait(random(1000,1500));
    		} else {
    			log("There is no ladder.....FAIL!");
    		}
    
    
    	}
    
    
    	public void goUpLadder(int g) {
    		RSObject gate = findObject(g);
    		if (gate != null){
    			if (distanceTo(gate.getLocation()) > 10) {
    				walkTileMM(new RSTile( (gate.getLocation().getX()+getMyPlayer().getLocation().getX())/2 , (gate.getLocation().getY()+getMyPlayer().getLocation().getY())/2 )  );
    				wait(random(1500, 3000));
    			}
    			if (distanceTo(gate.getLocation()) > 3) {
    				walkTileMM(gate.getLocation());
    				wait(random(1500, 3000));
    			}
    
    			atObject(gate, "Climb-up");
    			wait(random(500,1000));
    		} else {
    			log("There is no ladder.....FAIL!");
    		}
    
    
    	}
    
    
    
    
    
    	public void stateSelecter() {
    		if (distanceTo(strongholdTObank[0]) <= 6 && (getInventoryCount(FOOD_ID) > 0 || DIE==1) ) {
    			state = 2;
    		}
    		if (distanceTo(strongholdTObank[0]) <= 6 && getInventoryCount(FOOD_ID) == 0 && DIE==0 ) {
    			state = 3;
    		}
    		if (distanceTo(strongholdTObank[strongholdTObank.length-1]) <= 10) {
    			state = 4;
    		}
    		if (distanceTo(new RSTile (1887,5220)) < 1000) {
    			if (refill == 0) state = 1;
    			if (refill == 1) state = 5;
    		}
    
    		if (distanceTo(DeathWalk[0]) < 15){
    			state = 6;
    		}
    
    		//log("Cave = " + whichCave());
    	}
    
    
    	public void standingStill() {
    		//log("working????");
    
    		if ((oldPosition.getX() == getMyPlayer().getLocation().getX())  &&   (oldPosition.getY() == getMyPlayer().getLocation().getY()) ){
    			standingCount++;
    		//log("ADDING TO COUNT!!!");
    		}
    		if (  (oldPosition.getX() != getMyPlayer().getLocation().getX())  ||   (oldPosition.getY() != getMyPlayer().getLocation().getY())  ){
    		//	log("old POS!!!");
    			oldPosition = new RSTile(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY() )  ;
    			standingCount = 0;
    		}
    		if (getMyPlayer().getInteracting() != null){
    		//	log("stand count 0!!!");
    			standingCount = 0;
    		}
    		if (standingCount > 5 && standingCount < 20) {
    			log("I'm not doing anything... Probably stuck, SPIN AROUND!");
    			rotate();
    		}
    		if (standingCount > 15) beep();
    		if (standingCount > 20) {
    			log("I'm stuck, so will logout before the BANHAMMER.");
    			log("Please post where you got stuck on the forums :)");
    			logout = true;
    		}
    
    	//	log("X:"+oldPosition.getX() + "  Y:" + oldPosition.getY() );
    	}
    
    
    	public boolean dropAllRubbish() {
    		outer: for (int item : getInventoryArray()) {
    			for (int nodrop : rubbish) {
    				if (item == nodrop) {
    					continue outer;
    				}
    			}
    
    			for (int i = 0; i < getInventoryCount(item); i++ ) {
    				atInventoryItem(item, "Drop");
    				wait(random(500, 750));
    			}
    		}
    		return true;
    	}
    	public long sOld = 0;
    	public int sRandom = 0;
    	public int specialValue = 0;
    	public boolean sOn = false;
    	public void special() {
    		if (sOn){
    			if (getSetting(301) == 0 && specialValue == 1){
    				specialValue = 1000 - getSetting(300);
    			}
    
    			if (getSetting(300) >= specialValue){
    				if (getSetting(301) == 0){
    					if (specialValue == 0 && getSetting(300) == 1000){
    						specialValue = 1;
    						myOpenTab(TAB_ATTACK);
    						wait(random(1000,2000));
    						clickMouse(random(575,705),random(414,426), true);
    						wait(random(1000,2000));
    						sRandom = 0;
    					}
    					if (sRandom == 0){
    						sOld = System.currentTimeMillis();
    						sRandom=random(3000,40000);
    					}
    					if (System.currentTimeMillis() > (sOld+sRandom) && specialValue > 1){
    						myOpenTab(TAB_ATTACK);
    						wait(random(1000,2000));
    						clickMouse(random(575,705),random(414,426), true);
    						wait(random(1000,2000));
    						sRandom = 0;
    					}
    				}
    
    
    
    			}
    		}
    	}
    
    
        public void myOpenTab(int tab) {      // Credit goes to nebule for this!
            if (tab == getCurrentTab()) {
                  return;
            }
            switch(tab) {
            case TAB_ATTACK: input.holdKey((char) KeyEvent.VK_F1, random(300, 700)); break;
            case TAB_STATS: input.holdKey((char) KeyEvent.VK_F2, random(300, 700)); break;
            case TAB_QUESTS: input.holdKey((char) KeyEvent.VK_F3, random(300, 700)); break;
            case TAB_INVENTORY: input.holdKey((char) KeyEvent.VK_F4, random(300, 700)); break;
            case TAB_EQUIPMENT: input.holdKey((char) KeyEvent.VK_F5, random(300, 700)); break;
            case TAB_PRAYER: input.holdKey((char) KeyEvent.VK_F6, random(300, 700)); break;
            case TAB_MAGIC: input.holdKey((char) KeyEvent.VK_F7, random(300, 700)); break;
            case TAB_FRIENDS: input.holdKey((char) KeyEvent.VK_F8, random(300, 700)); break;
            default: openTab(tab); break;
            }
      }
    
    
    
    	public long pOld = 0;
    	public int pRandom = 0;
        public void potUp(){
        //	int[] strength = {119,117,115,113};
        //	int[] attack = {125,123,121,2428};
        	int[] combat = {9745,9743,9741,9739};
        	if (getInventoryCount(combat) > 0){
        		if (skills.getCurrentSkillLevel(STAT_STRENGTH) <= skills.getRealSkillLevel(STAT_STRENGTH) + 3){
    				if (pRandom == 0){
    					pOld = System.currentTimeMillis();
    					pRandom=random(10000,120000);
    				}
    				if (System.currentTimeMillis() > (pOld+pRandom)){
    	    			openTab(TAB_INVENTORY);
    	    			wait(random(1000,2000));
    	    			for (int i = 0; i <combat.length; i++){
    	    				if (inventoryContains(combat[i])) {
    	    					log("Potting Up!");
    	            			if(atInventoryItem(combat[i], "Drink")) {
    	            				pRandom=0;
    	            				break;
    	            			}
    	    				}
    	    			}
    				}
        		}
    
        	}
    
    
    
        }
    
        public int getFoodHeal(){
        	int hp=10;
        	if(inventoryContains(FOOD_ID)){
        		int id = getInventoryItemByID(FOOD_ID).getID();
        		for (int i=0;i<FOOD_ID.length;i++){
        			if (id == FOOD_ID[i]){
        				hp=FOOD_HEAL[i];
        				break;
        			}
        		}
        	}
    
    
        	return hp;
        }
    	public boolean activateConditions() {
    		if (!isLoggedIn()) {
    			return false;
    		}
    		if (RSInterface.getChildInterface(242, 3).containsText("Gate of War")) return true;
    		if (RSInterface.getChildInterface(243, 3).containsText("Gate of War")) return true;
    		if (RSInterface.getChildInterface(244, 3).containsText("Gate of War")) return true;
    
    		if (RSInterface.getChildInterface(242, 3).containsText("Rickety Door")) return true;
    		if (RSInterface.getChildInterface(243, 3).containsText("Rickety Door")) return true;
    		if (RSInterface.getChildInterface(244, 3).containsText("Rickety Door")) return true;
    
    		if (RSInterface.getChildInterface(242, 3).containsText("Oozing Barrier")) return true;
    		if (RSInterface.getChildInterface(243, 3).containsText("Oozing Barrier")) return true;
    		if (RSInterface.getChildInterface(244, 3).containsText("Oozing Barrier")) return true;
    
    		if (RSInterface.getChildInterface(242, 3).containsText("Portals of Death")) return true;
    		if (RSInterface.getChildInterface(243, 3).containsText("Portals of Death")) return true;
    		if (RSInterface.getChildInterface(244, 3).containsText("Portals of Death")) return true;
    		return false;
    	}
    	private static final String[] answers = { "Don't give him my password.",
    		"Recovering your account if you forget your password.",
    		"Abuse report",
    		"Talk to any banker",
    		"To help me recover my password if I forget it or it is stolen.",
    		"The birthday of a famous person or event",
    		"Nobody",
    		"Nowhere",
    		"Don't tell them anything and inform Jagex through the game website",
    		"Virus scan my computer then change my password and recoveries",
    		"Only on the RuneScape or FunOrb website",
    		"Every couple of months",
    		"No, it might steal my password",
    		"No.",
    		"Use the 'Recover a Lost Password' section on the Runescape website.",
    		"Don't give them the information and send an 'Abuse Report'.",
    		"Game Inbox on the Runescape website.",
    		"Memorable",
    		"Don't tell them anything and click the 'Report Abuse' Button.",
    		"Politely tell them no and then use the 'Report Abuse' button." };
    
    public void gateOFwar(){
    	if (activateConditions()){
    		int check1=0;
    	 while(true) {
    		if (canContinue()) {
    			clickContinue();
    
    		} else if (RSInterface.getChildInterface(244, 3).containsText("Gate of War")){
    			clickContinue();
    			} else if(RSInterface.getChildInterface(243, 3).containsText("Gate of War")){
    			clickContinue();
    			} else if(RSInterface.getChildInterface(242, 3).containsText("Gate of War")){
    			clickContinue();
    			} else if (RSInterface.getChildInterface(241, 3).containsText("Gate of War")){
    			clickContinue();
    			} else if (RSInterface.getChildInterface(242, 4).containsText("Please pass through")){
    			clickContinue();
    			} else if (RSInterface.getChildInterface(243, 4).containsText("To pass you must answer me")){
    			clickContinue();
    			} else if (!getAnswer()){
    		if (RSInterface.getChildInterface(228, 1).containsText("Select")){
    			log("Guessing");
    			atInterface(228,random(2,3));
    		} else if (RSInterface.getChildInterface(230, 1).containsText("Select")){
    			log("Guessing");
    			atInterface(230,random(2,4));
    		} else
    			wait(random(750,1500));
    		while (canContinue()) {
    			clickContinue();
    
    		}
    
    			}
    		wait(random(1000,1500));
    		while (canContinue()) {
    			clickContinue();
    
    		}
    		if (!canContinue()) {
    			check1++;
    			if (check1>=2)break;
    			wait(random(750,1500));
    
    		}
    			}
    
    	}
    }
    public boolean getAnswer(){
    	for(int i = 0; i < answers.length; i++) {
    		for(int j = 2; j < 5; j++) {
    			if (RSInterface.getChildInterface(230, j).containsText(answers[i])){
    				atInterface(230,j);
    				return true;
    			} else if (RSInterface.getChildInterface(228, j).containsText(answers[i])){
    				atInterface(228,j);
    				return true;
    			}
    		}
    	}
    	return false;
    }
    
    	public int loop() { try {
    		checkCount++;
    		getNPCsID();
    		if (canContinue()) clickContinue();
    		if (logout){
    			beep();
    			return -1;
    		}
    		gateOFwar();
    		stateSelecter();
    		standingStill();
    
    
    		if (isLoggedIn() && startLevel == 0) {
    			startLevel = skills.getCurrentSkillLevel(style);
    			startXP = skills.getCurrentSkillExp(style);
    
    		}
    
    		if (isLoggedIn() && selectStyle == 0 ){
    
    			wait(random(1000,2000));
    			styleSelecter();
    
    			getEquipedItems();
    
    			health = (random(skills.getLvlByExp(skills.getCurrentSkillExp(3))*3,skills.getLvlByExp(skills.getCurrentSkillExp(3))*7))/10;
    			log("Eat when health is under "+ health +".");
    
    			if (getInventoryCount(FOOD_ID) == 0) {
    				log("You have no food!");
    				log("If you do have food please post the ID's in the forum and I will add support for it!");
    			}
    			if (arrows == 1) {
    				equipedarrows = getEquipmentArray()[13];
    				if (equipedarrows == -1){
    					log("No arrows equiped, set to Steel!");
    					equipedarrows = 886;
    				}
    			}
    
    
    
    		}
    
    
    		RSPlayer myPlayer = getMyPlayer();
    
    
    
    switch(state) {
    
    // Fight
    case 1:
    	stuckInGate();
    	special();
    	if(pot) potUp();
    	if(bury)buryBones();
    	equipEquipedItems();
    
    		if (BANK == 1 || DIE == 1){
    		if (cave != whichCave()) {
    			refill = 1;
    			state = 5;
    			return random(800, 1400);
    		}
    		//log("cave:" + cave);
    		//log("actual cave:" + whichCave());
    
    
    		}
    
    
    		if (random(0,50) == random(0,50)) {
    			log("Food heals "+getFoodHeal());
    			health = (random(skills.getLvlByExp(skills.getCurrentSkillExp(3))*3,skills.getLvlByExp(skills.getCurrentSkillExp(3))*6))/10;
    		}
    
    		//if (skills.getCurrentSkillLevel(3) <= 100 )  {
    		//log("test escape");
    		//return escape();
    		//}
    
    
    		if (myPlayer.getInteracting() != null && !myPlayer.isMoving() ) {
    		antiban();
    		}
    
    
    
    		// Health
    		if (skills.getCurrentSkillLevel(3) <= health && DIE == 0 )  {
    			if (getInventoryCount(FOOD_ID) == 0) {
    				log ("Time to stop, I have noooo food!");
    				return escape();
    			}
    			for(int i = 0; i<FOOD_ID.length; i++) {
    			    if(getInventoryCount(FOOD_ID[i]) >= 1) {
    			    	log("Eating.");
    			        atInventoryItem(FOOD_ID[i], "Eat");
    			        wait(2000,3000);
    			        return random(800, 1400);
    			    }
    			}
    			}
    
    
    
    
    
    	/*	if(!quickAttack){
    			if (old!=myPlayer.getInteracting() || NPCChange==0){
    				NPCChange++;
    				old=myPlayer.getInteracting();
    				monsterHealth = 2000;
    			}
    
    		}*/
    
    		if(!quickAttack && ((myPlayer.getInteracting() == null && checkCount >=10)||checkCount >=25)){
    			log("Checking for Items.");
    			if (runes == 1) grabRunes();
    			if (charms == 1)grabCharms();
    			if (herbs == 1)grabHerbs();
    			if (arrows == 1){
    				log("Picking up Arrows.");
    				pickUpArrows();
    				equipArrows();
    
    			}
    			if (bones) grabBones();
    			checkCount=0;
    		}
    		//log("check4?");
    
    
    
    
    		if (quickAttack) {
    		if (skills.getCurrentSkillExp(3)*3 >= (monsterHealth*4+startHealthXP*3)-2) {
    			log("Dead Monster!");
    				if (runes == 1) grabRunes();
    				if (charms == 1)grabCharms();
    				if (herbs == 1)grabHerbs();
    
    			//	grabStackables();
    			//	grabUnstackables();
    				if (arrows == 1){
    					log("Picking up Arrows.");
    					pickUpArrows();
    					equipArrows();
    
    				}
    				if (bones) grabBones();
    
    
    					RSNPC mino2 = getNextNPCByID(MONSTER_ID);
    					startHealthXP = skills.getCurrentSkillExp(3);
    					if (mino2 != null && canReach(mino2,true)) {
    						log("QuickAttack!") ;
    						startHealthXP = skills.getCurrentSkillExp(3);
    						changeMonsterHealth(mino2);
    						atNPC2(mino2,"Attack");
    						return random(500, 1000);
    
    					}
    						}
    
    
    
    
    		}
    
    
    
    //log("check1?");
    
    
    
    
    			if ((myPlayer.getInteracting() == null && !myPlayer.isMoving())) {
    				RSNPC mino = getNextNPCByID(MONSTER_ID);
    				if (mino != null && canReach(mino,true)) {
    
    					if (mino.isInCombat()) {
    						return random(500,1500);
    					}
    
    					log("Attack!") ;
    					startHealthXP = skills.getCurrentSkillExp(3);
    					changeMonsterHealth(mino);
    					atNPC2(mino,"Attack");
    					check=1;
    					return random(500, 1000);
    
    				}
    				RSNPC monst = getBusyNPCByID(MONSTER_ID);
    				if (monst != null){
    					log("All Monsters are in combat!");
    					return random(500, 1000);
    				}
    				if (check >= 11) {
    				log("No monsters :( bye bye");
    				beep();
    				return -1;
    				}
    				log("Cant find any monsters. Check: "+ check);
    				check++;
    
    
    			}
    
    
    
    
    
    
    		return random(1000, 3000);
    
    //Climb down ladder
    case 2:
    	log("Going down hole...");
    	setRun(true);
    	RSObject entrance = findObject(ENTRANCE_ID);
    	if (entrance != null){
    		if (distanceTo(entrance.getLocation()) > 4) {
    			walkTileMM(entrance.getLocation());
    			return random(500, 750);
    		}
    		atObject(entrance, "Climb-down");
    		return random(3000,4000);
    	} else {
    		log("Cant find Entrance.. FAIL");
    		beep();
    		return -1;
    	}
    
    
    
    //Walk to Bank
    case 3:
    	log("Walking to Bank.");
    	setRun(true);
    	//if (distanceTo(strongholdTObank[0]) <= 6){
    	//toBankPath.walkToEnd();
    		travelTo(strongholdTObank[strongholdTObank.length-1]);
    	//}
    	return random(500,1500);
    
    
    
    //At the bank
    case 4:
    	if (pot){
    		if (getInventoryCount(FOOD_ID) < 20 || getInventoryCount(9741) <2 ) {
    
    		 log("Need to get some food");
    
    		 RSObject bankWindow = findObject(bankWindows);
    			if (distanceTo(bankWindow.getLocation()) > 5) {
    				walkTileMM(bankWindow.getLocation());
    				return random(500, 750);
    			}
    			if (!RSInterface.getInterface(762).isValid()) {
    				atObject(bankWindow, "Use-quickly");
    				return random(1500, 1750);
    			}
    		//	int[] dontDeposit = FOOD_ID;
    		//	dontDeposit[0]=9741;
    			bank.depositAllExcept(FOOD_ID);
    			log("Withdrawing Food!");
    			//if (bank.getCount(BANKFOOD_ID) > 0){
    			if (getInventoryCount(FOOD_ID) < 20){
    			bank.searchItem(BANKFOOD);
    				wait(random(700,1200));
    				clickMouse(random(40,70),random(95,120), false);
    				wait(random(700,1200));
    				if (atMenu("X") == false){
    					log("Out of " + BANKFOOD +".");
    					beep();
    					return -1;
    				}
    				wait(random(2000,3000));
    				Bot.getInputManager().sendKeys("25", true);
    				bank.searchItem("");
    				return random(1500, 1750);
    			}
    				if (getInventoryCount(9741) < 2){
    					bank.searchItem("combat potion");
    					wait(random(700,1200));
    					clickMouse(random(40,70),random(95,120), false);
    					wait(random(700,1200));
    					atMenu("X");
    					wait(random(700,1200));
    					Bot.getInputManager().sendKeys("3", true);
    					}
    
                    bank.close();
    
    			//	bank.withdraw(BANKFOOD_ID, random(21 , 27));
    			//}else{
    			//	log("No food in bank.... FAIL");
    			//	return -1;
    			//}
    
    			return random(3000,4500);
    		}
    	 }
    	if (getInventoryCount(FOOD_ID) < 20 && !pot) {
    		 log("Need to get some food");
    
    		 RSObject bankWindow = findObject(bankWindows);
    			if (distanceTo(bankWindow.getLocation()) > 5) {
    				walkTileMM(bankWindow.getLocation());
    				return random(500, 750);
    			}
    			if (!RSInterface.getInterface(762).isValid()) {
    				atObject(bankWindow, "Use-quickly");
    				return random(1500, 1750);
    			}
    
    			bank.depositAllExcept(FOOD_ID);
    			log("Withdrawing Food!");
    			//if (bank.getCount(BANKFOOD_ID) > 0){
    				bank.searchItem(BANKFOOD);
    				wait(random(700,1200));
    				clickMouse(random(40,70),random(95,120), false);
    				wait(random(700,1200));
    
    					if (atMenu("All") == false){
    						log("Out of " + BANKFOOD +".");
    						beep();
    						return -1;
    					}
        				wait(random(700,1200));
                        bank.close();
    
    			//	bank.withdraw(BANKFOOD_ID, random(21 , 27));
    			//}else{
    			//	log("No food in bank.... FAIL");
    			//	return -1;
    			//}
    
    			return random(3000,4500);
    	 }
    	 if (bank.getInterface().isValid()) {
    		 bank.close();
    		 wait(random(300,500));
    	 }
    		setRun(true);
    		toBankPath.walkToStart();
    		return random(500,1500);
    
    
    case 5:
    
    	if (getInventoryCount(FOOD_ID) == 0 && DIE==0) {
    
    
    		stuckInGate();
    
    		if (whichCave() == 1) {
    			goUpLadder(ladders[0]);
    			return random(1500,3000);
    		}
    
    
    		if (whichCave() == 7) {
    			goUpLadder(16146);
    			return random(1500,3000);
    
    		}
    		if (whichCave() == 14) {
    			goUpLadder(16080);
    			return random(1500,3000);
    
    		}
    
    		if (whichCave() == 15) {
    			goUpLadder(16080);
    			return random(1500,3000);
    
    		}
    
    		if (whichCave() == 171) {
    			goUpLadder(16078);
    			return random(1500,3000);
    
    		}
    		if (whichCave() == 27) {
    			goUpLadder(16114);
    			return random(1500,3000);
    
    		}
    
    		if (whichCave() == 35){
    			goThroughGate(GATE44B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE44A,GATE44B)){
    			goThroughGate(GATE44A);
    			return random(1000,1500);
    		}
    		if (whichCave() == 34){
    			goThroughGate(GATE43B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE43A,GATE43B)){
    			goThroughGate(GATE43A);
    			return random(1000,1500);
    		}
    		if (whichCave() == 36){
    			goThroughGate(GATE40B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE40A,GATE40B)){
    			goThroughGate(GATE40A);
    			return random(1000,1500);
    		}
    		if (whichCave() == 28){
    			goThroughGate(GATE38B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE38A,GATE38B)){
    			goThroughGate(GATE38A);
    			return random(1000,1500);
    		}
    		if (whichCave() == 25){
    			goThroughGate(GATE30A);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE30A,GATE30B)){
    			goThroughGate(GATE30B);
    			return random(1000,1500);
    		}
    		if (whichCave() == 22){
    			goThroughGate(GATE34A);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE34A,GATE34B)){
    			goThroughGate(GATE34B);
    			return random(1000,1500);
    		}
    		if (whichCave() == 18){
    			goThroughGate(GATE26B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE26A,GATE26B)){
    			goThroughGate(GATE26A);
    			return random(1000,1500);
    		}
    		if (whichCave() == 17){
    			goThroughGate(GATE23A);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE23A,GATE23B)){
    			goThroughGate(GATE23B);
    			return random(1000,1500);
    		}
    		if (whichCave() == 16){
    			goThroughGate(GATE19B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE19A,GATE19B)){
    			goThroughGate(GATE19A);
    			return random(1000,1500);
    		}
    
    		if (whichCave() == 10){
    			goThroughGate(GATE10B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE10A,GATE10B)){
    			goThroughGate(GATE10A);
    			return random(1000,1500);
    		}
    
    		if (whichCave() == 8){
    			goThroughGate(GATE7B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE7A,GATE7B)){
    			goThroughGate(GATE7A);
    			return random(1000,1500);
    		}
    
    		if (whichCave() == 5){
    			goThroughGate(GATE6A);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE6A,GATE6B)){
    			goThroughGate(GATE6B);
    			return random(1000,1500);
    		}
    
    		if (whichCave() == 3){
    			goThroughGate(GATE2B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE2A,GATE2B)){
    			goThroughGate(GATE2A);
    			return random(1000,1500);
    		}
    
    		if (whichCave() == 2){
    			goThroughGate(GATE1B);
    			return random(1000,1500);
    		}
    		if(betweenGates2(GATE1A,GATE1B)){
    			goThroughGate(GATE1A);
    			return random(1000,1500);
    		}
    
    
    
    
    		log("Not in escape Cave");
    			return random(1500,3000);
    
    	}else{
    
    		if(whichCave() == cave) {
    			refill = 0;
    			state = 1;
    			return random(100,500);
    		}
    
    	if (cave == 10 || cave == 2 || cave == 3)	{
    		if(whichCave() == 1) goThroughGate(GATE1A);
    		if(betweenGates2(GATE1A,GATE1B)) goThroughGate(GATE1B);
    		if(whichCave() == 2) goThroughGate(GATE2A);
    		if(betweenGates2(GATE2A,GATE2B)) goThroughGate(GATE2B);
    		if(whichCave() == 3) goThroughGate(GATE5A);
    		if(betweenGates2(GATE5A,GATE5B)) goThroughGate(GATE5B);
    		if(whichCave() == 6) goThroughGate(GATE9A);
    		if(betweenGates2(GATE9A,GATE9B)) goThroughGate(GATE9B);
    	}
    	if (cave == 5 || cave == 8 || cave == 11)	{
    		if(whichCave() == 1) goThroughGate(GATE1A);
    		if(betweenGates2(GATE1A,GATE1B)) goThroughGate(GATE1B);
    		if(whichCave() == 2) goThroughGate(GATE3A);
    		if(betweenGates2(GATE3A,GATE3B)) goThroughGate(GATE3B);
    		if(whichCave() == 5) goThroughGate(GATE7A);
    		if(betweenGates2(GATE7A,GATE7B)) goThroughGate(GATE7B);
    
    	}
    	if (cave == 15 || cave == 16 )	{
    		if(whichCave() == 1) goThroughPortal(portals[0]);
    		if(whichCave() == 14) goDownLadder(16149);
    		if(whichCave() == 15) goThroughGate(GATE19A);
    		if(betweenGates2(GATE19A,GATE19B)) goThroughGate(GATE19B);
    
    	}
    	if (cave == 17 || cave == 18 )	{
    		if(whichCave() == 1) goThroughPortal(portals[0]);
    		if(whichCave() == 14) goDownLadder(16149);
    		if(whichCave() == 15) goThroughGate(GATE20A);
    		if(betweenGates2(GATE20A,GATE20B)) goThroughGate(GATE20B);
    		if(whichCave() == 17) goThroughGate(GATE23A);
    		if(betweenGates2(GATE23A,GATE23B)) goThroughGate(GATE23B);
    		if(whichCave() == 171) goThroughGate(GATE26A);
    		if(betweenGates2(GATE26A,GATE26B)) goThroughGate(GATE26B);
    
    	}
    
    	if (cave == 25){
    		if(whichCave() == 1) goThroughPortal(portals[0]);
    		if(whichCave() == 14) goDownLadder(16149);
    		if(whichCave() == 15) goThroughPortal(portals[1]);
    		if(whichCave() == 26) goThroughGate(GATE34B);
    		if(betweenGates2(GATE34A,GATE34B)) goThroughGate(GATE34A);
    		if(whichCave() == 22) goThroughGate(GATE30B);
    		if(betweenGates2(GATE30A,GATE30B)) goThroughGate(GATE30A);
    
    	}
    
    	if (cave == 36 || cave == 28 || cave == 35 || cave == 34)	{
    		if(whichCave() == 1) goThroughPortal(portals[0]);
    		if(whichCave() == 14) goDownLadder(16149);
    		if(whichCave() == 15) goThroughPortal(portals[1]);
    		if(whichCave() == 26) goDownLadder(16081);
    		if(whichCave() == 27) goThroughGate(GATE38A);
    		if(betweenGates2(GATE38A,GATE38B)) goThroughGate(GATE38B);
    		if(whichCave() == 28) goThroughGate(GATE40A);
    		if(betweenGates2(GATE40A,GATE40B)) goThroughGate(GATE40B);
    		if(whichCave() == 36) goThroughGate(GATE43A);
    		if(betweenGates2(GATE43A,GATE43B)) goThroughGate(GATE43B);
    		if(whichCave() == 34) goThroughGate(GATE44A);
    		if(betweenGates2(GATE44A,GATE44B)) goThroughGate(GATE44B);
    
    
    	}
    
    
    		return random(500,1500);
    
    	}
    
    case 6 :
    	log("Walking to Stronghold.");
    	setRun(true);
    	DeathPath.walkToEnd();
    	return random(500,1500);
    
    
    
    
    
    
    	}   //switch end
    
    
    
    
    	} catch(Exception e) {
    			}
    
    	return random(1000, 3000);
     }
    
    
    	public String getScriptDescription() {
    		String html = "";
    
    		html += "<html>";
    		html += "<head>";
    		html += "<style type=\"text/css\"> hr {color: sienna} p {margin-left: 20px} body {background-image: url(\"http://img225.imageshack.us/img225/721/robbgef0.gif\")}</style>";
    		html += "</head>";
    		html += "<body>";
    		html += "<center>";
    	//	html += "<body color=red>";
    	//	html += "<font color=red>";
    		html += "<h2>" + getName( ) + " v" + getVersion( ) + "</h2><br>";
    		html += "<b>Author: </b>" + getAuthor( ) + "<br>\n";
    		html += " <h3>Please visit <a href=\"http://bug5532.blogspot.com/\">http://bug5532.blogspot.com/</a> and click on ONE of the ads on the page.</h3>";
    		html += "Please do this once a day! Clicking will help towards releasing new Scripts and updates,<br> Thanks Bug5532.<br>";
    		//html += "<br>";
    	/*	html += "<b>Features:</b><br>";
    		html += "-Quick Attack starts next fight extremely smoothly!<br>";
    		html += "-Eats when health is between 30-70% hp.<br>";
    		html += "-AntiBan: Moves mouse, Checks stats and Changes Tabs.<br>";
    		html += "-Banking: See forums for more info.<br>";*/
    		html += "<b>Arguments:</b><br>";
    		html += "Paint:<input type=\"radio\" name=\"des\" value=\"paint\">&nbsp;GUI:<input type=\"radio\" name=\"des\" value=\"gui\" checked=\"checked\"<br>>";
    		html += "Style?:  ";
    		html += "Attack:<input type=\"radio\" name=\"style\" value=\"attack\" checked=\"checked\"> ";
    		html += "Strength:<input type=\"radio\" name=\"style\" value=\"strength\"> ";
    		html += "Defence:<input type=\"radio\" name=\"style\" value=\"defence\">";
    		html += "Range:<input type=\"radio\" name=\"style\" value=\"range\"><br>";
    		html += "Bank? <input type=\"checkbox\" name=\"bank\" value=\"yes\" checked=\"checked\">";
    		html += " &nbsp; &nbsp; &nbsp;         Die? <input type=\"checkbox\" name=\"die\" value=\"yes\" >";
    		html += " &nbsp; &nbsp; &nbsp;         Special? <input type=\"checkbox\" name=\"special\" value=\"yes\" >";
    		html += " &nbsp; &nbsp; &nbsp;         QuickAttack? <input type=\"checkbox\" name=\"quickattack\" value=\"yes\"  ><br>";
    		html += "Potions? <input type=\"checkbox\" name=\"potion\" value=\"yes\"  >";
    		html += " &nbsp; &nbsp; &nbsp;         Bury Bones? <input type=\"checkbox\" name=\"burybones\" value=\"yes\" checked=\"checked\" ><br>";
    		html += "Food Name:<input type=\"text\" name=\"food\" size=10>" ;
    		html += "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cave Number:<input type=\"text\" name=\"cave\" size=3> <br>";
    		html += "Monster: <select name=\"monster\"> <option selected>All<option>Giant_Spiders<option>Goblins_Low_Lvl<option>Goblin_Lvl_5<option>Goblin_Lvl_11<option>Goblin_Lvl_13<option>Goblins_High_Lvl<option>Goblin_Lvl_16<option>Goblin_Lvl_25<option>Minotaur_Lvl_12_and_Wolf<option>Minotaur_Lvl_12<option>Minotaur_Lvl_27<option>Wolf</select> <br>";
    		html += "Collect?: Arrows<input type=\"checkbox\" name=\"arrows\" value=\"yes\">";
    		html += "&nbsp; Charms<input type=\"checkbox\" name=\"charms\" value=\"yes\" checked=\"checked\">";
    		html += "&nbsp; Herbs<input type=\"checkbox\" name=\"herbs\" value=\"yes\" >";
    		html += "&nbsp; Bones<input type=\"checkbox\" name=\"bones\" value=\"yes\">";
    		html += "&nbsp; Runes<input type=\"checkbox\" name=\"runes\" value=\"yes\"><br>";
    		/*html += "No: <input type=\"radio\" name=\"arrows\" value=\"no\" checked=\"checked\">";
    		html += "Bronze: <input type=\"radio\" name=\"arrows\" value=\"bronze\" >";
    		html += "Iron: <input type=\"radio\" name=\"arrows\" value=\"iron\" > ";
    		html += "Steel: <input type=\"radio\" name=\"arrows\" value=\"steel\" >"; */
    		html += "</center>";
    		html += "</body>";
    		html += "</html>";
    
    		return( html );
    	}
    
    	public void checkDate(){
    
    	}
    
    
    
    
     public JLabel labelStatus = new JLabel("Status:");;
    	public boolean check1 =false;
    	public void startup() {
    		if (check1){
    			Thread t1 = new Thread(new Thread1());
    			t1.start();
    		createAndShowGUI2();
    
    		while(check1) {
    			wait(10);
    		}
    		createAndShowGUI3();
    		Thread1.lock=true;
    		labelStatus.setText("Status: Opening Browser.");
    		wait(3000);
    		int checker=0;
    		while (true){
    			Thread1.lock=true;
    			log("Scan.");
    			labelStatus.setText("Status: Starting Scan.");
    			if(Start()){
    				log("Scan Successful. Starting Script.");
    				labelStatus.setText("Status: Completed - Starting Script.");
    				wait(2000);
    				break;
    			}else{
    				log("Webpage not loaded. Scan Failed. Please wait...");
    				checker++;
    				int t = 3-checker;
    				labelStatus.setText("Status: Failed - Trying "+t+" more times.");
    				if (checker >= 3){
    					log("Webpage failed to load.");
    					labelStatus.setText("Status: Failed - Starting Script.");
    					wait(3000);
    					break;
    				}
    				wait(3000);
    			}
    
    		}
    		Thread1.lock=false;
    		frame3.setVisible(false);
        	frame3.dispose();
        	frame4.setVisible(false);
        	frame4.dispose();
    		}
    	}
    
    
    
    	static class Thread1 extends Stronghold implements Runnable {
    		public static boolean lock = false;
    		public static boolean run = true;
    		public void run() {try{
    			Robot rob = new Robot();
    			while(run){
    				while(lock){
    					rob.mouseMove(500, 500);
    				}
    
    			}
    		}catch(AWTException e){e.printStackTrace();}
    	}
    	}
    
    	public static class BareBonesBrowserLaunch { private static final String errMsg = "Error attempting to launch web browser"; public static void openURL(String url) { String osName = System.getProperty("os.name"); try { if (osName.startsWith("Mac OS")) { Class fileMgr = Class.forName("com.apple.eio.FileManager"); Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); openURL.invoke(null, new Object[] {url}); } else if (osName.startsWith("Windows")) Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); else {  String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; String browser = null; for (int count = 0; count < browsers.length && browser == null; count++) if (Runtime.getRuntime().exec( new String[] {"which", browsers[count]}).waitFor() == 0) browser = browsers[count]; if (browser == null) throw new Exception("Could not find web browser"); else Runtime.getRuntime().exec(new String[] {browser, url}); } } catch (Exception e) { JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage()); } } }
    
    	public boolean Start(){
    		try {
    			int per=0;
    			Robot rob = new Robot();
    			for (int j=0;j<1000;j++){
    				Thread1.lock=true;
    				per=j/10;
    				labelStatus.setText("Status: Scaning - "+per+"% done.");
    				for (int i=0;i<1000;i++){
    				//	rob.mouseMove(500, 500);
    					boolean c = false;
    					int x = i;
    					int y = j;
    					Color d = rob.getPixelColor(x, y);
    					/*if (d.getBlue()==51&&d.getRed()==51&&d.getGreen()==51){
    						c=true;
    						d = rob.getPixelColor(x, y-1);
    						if (d.getBlue()==225&&d.getRed()==255&&d.getGreen()==255){
    							c=true;
    						}
    					}*/
    
    
    
    
    					if (d.getBlue()==51&&d.getRed()==51&&d.getGreen()==51){
    						Color[] cA = new Color[9];
    						int cN=0;
    						for (int k=-1;k<2;k++){
    							for (int l=-1;l<2;l++){
    								cA[cN]=rob.getPixelColor(x+k, y+l);
    								cN++;
    							}
    						}
    						for (int k=0;k<9;k++){
    							if (cA[k].getBlue()==255&&cA[k].getRed()==255&&cA[k].getGreen()==255){
    								c=true;
    								break;
    							}
    						}
    					}
    
    
    					if (c){
    						labelStatus.setText("Status: Advert found: Setting random wait.");
    						wait(1000);
    						int randwait = random(1,8);
    						for (int p=0;p<randwait;p++){
    							int randwait2 = randwait-p;
    							labelStatus.setText("Status: Advert found: Waiting "+randwait2+" seconds.");
    							wait(1000);
    						}
    
    						Thread1.lock=false;
    						wait(random(20,50));
    						rob.mouseMove(x, y);
    						wait(random(20,50));
    						rob.mousePress(InputEvent.BUTTON1_MASK);
    						wait(random(10,50));
    						rob.mouseRelease(InputEvent.BUTTON1_MASK);
    						wait(random(15,20));
    						Thread1.lock=true;
    						return true;
    					}
    
    
    				}
    			}
    			return false;
    
    		} catch (AWTException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    				}
    		return false;
    
    	}
    
    
    	 public JButton button;
    	    public JFrame frame2;
    	    private void createAndShowGUI2() {
    	    	frame2 = new JFrame("Start Up");// the frame
    	     	frame2.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    	    	JPanel panel = new JPanel(new GridBagLayout());
    	    	GridBagConstraints c = new GridBagConstraints();
    	    	JLabel label;
    	    	c.gridx = 0;
    	    	c.gridy = 0;
    	    	label = new JLabel("Press Ok to open http://bug5532.blogspot.com/ ");
    	    	panel.add(label, c);
    	    	c.gridx = 0;
    	    	c.gridy = 1;
    	    	label = new JLabel("and start the script.");
    	    	panel.add(label, c);
    	    	c.gridx = 0;
    	    	c.gridy = 2;
    	    	button = new JButton("Ok");
    	    	button.addActionListener(this);
    	    	panel.add(button, c);
    
    	        //Display the window.
    	    	frame2.add(panel);
    	      //  frame.setSize(400, 250);
    	    	frame2.pack();
    	    	frame2.setBounds(260, 180, frame2.getWidth(), frame2.getHeight());
    	        frame2.setVisible(true);
    	    }
    
    	    public JFrame frame3;
    	    private void createAndShowGUI3() {
    	    	frame3 = new JFrame("Click Adz");// the frame
    	    	frame3.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    	    	JPanel panel = new JPanel(new GridBagLayout());
    	    	GridBagConstraints c = new GridBagConstraints();
    	    	JLabel label;
    	    	c.anchor = GridBagConstraints.CENTER;
    	    	c.gridx = 0;
    	    	c.gridy = 0;
    	    	label = new JLabel("Please Wait!");
    	    	panel.add(label, c);
    	    	c.gridx = 0;
    	    	c.gridy = 1;
    	    	label = new JLabel("Mouse Locked!");
    	    	panel.add(label, c);
    	    	c.gridx = 0;
    	    	c.gridy = 2;
    	    	label = labelStatus;
    	    	panel.add(label, c);
    	    	//button.addActionListener(this);
    	        //Display the window.
    	    	frame3.add(panel);
    	    	frame3.setUndecorated(true);
    	    	frame3.setAlwaysOnTop(true);
    	    	//  frame.setSize(400, 250);
    	    	frame3.pack();
    	    	frame3.setBounds(260, 180, 400, frame3.getHeight()+5);
    	        frame3.setVisible(true);
    	    }
    	    public JFrame frame4;
    	    private void createAndShowGUI4() {
    	    	frame4 = new JFrame("Blank");// the frame
    	    	frame4.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    	    	frame4.setUndecorated(true);
    	    	//  frame.setSize(400, 250);
    
    	    	frame4.setBounds(0, 0, 2000, 2000);
    	        frame4.setVisible(true);
    	    }
    
    
    
    	    public void actionPerformed(ActionEvent ae)  {
    
    
    	        if (ae.getSource() == button) {
    	           	frame2.setVisible(false);
    	        	frame2.dispose();
    	        	createAndShowGUI4();
    	    		//try {
    	    			BareBonesBrowserLaunch.openURL("http://bug5532.blogspot.com/");
    	    			//Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE\" " + "http://bug5532.blogspot.com/");
    	    	//	} catch (IOException e) {
    	    			// TODO Auto-generated catch block
    	    		//	e.printStackTrace();
    	    		//}
    	    		check1=false;
    	        }
    
    	    }
    
    
    
    
    
    
    
    
    
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    Woodcutting, ofcourse DP Varrock Yew Chopper.
    Code:
    import java.awt.*;
    import java.awt.event.KeyEvent;
    import java.util.*;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.accessors.NPC;
    
    public class DPVarockYewChopper extends Script implements PaintListener {
    	public double getVersion() {
    		return(1.2);
    	}
    
    	public String getName() {
    		return("Dontpanic's Varock Yew Chopper");
    	}
    
    	public String getAuthor() {
    		return("Dontpanic - [email protected]");
    	}
    
    	public String getScriptCategory() {
    		return("Dontpanic Scripts");
    	}
    
    	public String getScriptDescription( ) {
    		String html = "";
    
    		html += "<html>\n";
    		html += "<body>\n";
    		html += "<h2>" + getName() + " v" + getVersion() + "</h2><br>\n";
    		html += "Author: " + getAuthor() + "<br><br>\n";
    		html += "This script chops yews north of the Varrock castle and banks them at the Grand Exchange.<br><br>Start anywhere with an axe in your inventory or equipped.  This script may take up to 15 seconds to start if it's not already at the bank or trees, as it has to verify that it's not in a random event before teleporting to Lumbridge and walking back.";
    		//html += "<center>\n";
    		//html += "Arguments:<input type=\"text\" name=\"args\">\n";
    		//html += "</center>\n";
    		html += "</body>\n";
    		html += "</html\n";
    
    		return(html);
    	}
    
    	public boolean onStart(String[] args) {
    		Bot.getEventManager( ).addListener(PaintListener.class, this);
    
    		return(true);
    	}
    
    	public void onFinish() {
    		Bot.getEventManager().removeListener(PaintListener.class, this);
    	}
    
    	int waitAfterMoving = -1;
    	
    	int failCount = 0;
    
    	public int loop() {
    		
    		if(!isLoggedIn()) {
    			return random(100,200);
    		}
    		if(checkSpinningView()) {
    			return random(200, 300);
    		}
    		if(checkCamera()) {
    			return random(500, 800);
    		}
    		if(getMyPlayer().isMoving()) {
    			return random(150, 200);
    		}
    		if(waitAfterMoving != -1) {
    			int toReturn = waitAfterMoving;
    			waitAfterMoving = -1;
    			return toReturn;
    		}
    		if(checkAttack()) {
    			return random(800, 1000);
    		}
    		if(checkEnt()) {
    			return random(800, 1000);
    		}
    		if(getMyPlayer().getAnimation() != -1) {
    			return random(150, 200);
    		}
    		int result = work();
    		if(result != -1) {
    			failCount = 0;
    			return result;
    		}
    		if(walkBack()) {
    			failCount = 0;
    			return random(500, 800);
    		}
    		failCount ++;
    		if(failCount >= 10) {
    			failCount = 0;
    			homeTele();
    			return random(2000, 3000);
    		}
    		return random(1000, 2000);	
    	}
    	
    	public boolean checkEnt() {
    		if(getMyPlayer().getInteracting() != null) {
    			int count = Bot.getClient().getNPCCount();
    			NPC[] npcs = Bot.getClient().getNPCArray();
    			int[] ints = Bot.getClient().getNPCIndexArray();
    			for (int i = 0; i < count; i++)
    			{
    				RSNPC npc = new RSNPC(npcs[ints[i]]);
    				if(getMyPlayer().getInteracting().equals(npc) && Arrays.asList(treeNames).contains(npc.getName())) {
    					if(clickTree() > 0) {
    						walkTileMM(tree1Tile);
    					}
    					return true;
    				} 
    			}
    		}
    		return false;
    	}
    	
    	boolean cameraMoving = false;
    	
    	public boolean checkCamera() {
    		if(cameraMoving) {
    			if(Bot.getClient().getCameraCurveY() >= 380) {
    				Bot.getInputManager().releaseKey((char) KeyEvent.VK_UP);
    				cameraMoving = false;
    			}
    			return true;
    		} else if (Bot.getClient().getCameraCurveY() < 380) {
    			Bot.getInputManager().pressKey((char) KeyEvent.VK_UP);
    			cameraMoving = true;
    			return true;
    		}
    		return false;
    	}
    	
    	public boolean checkAttack() {
    		if(getMyPlayer().isInCombat()) {
    			return runFromCombat();
    		} else {
    			return false;
    		}
    	}
    	
    	public boolean runFromCombat() {
    		if(atBank()) {
    			bankToTrees();
    			return true;
    		}
    		if(atTrees()) {
    			treesToBank();
    			return true;
    		}
    		return false;
    	}
    	
    	int loads = 0;
    
    	public void onRepaint(Graphics g) {
    		g.setColor(Color.YELLOW);
    		g.drawString("Dontpanic's Varrock Yew Chopper", 260, 20); 
    		g.drawString("Loads: " + loads, 260, 38);
    	}
    	
    	public int work() {
    		if(getInventoryCount() != 28) {
    			return chop();
    		} else {
    			return bank();
    		}
    	}
    	
    	public int chop() {
    		if(atTrees()) {
    			int result = clickTree();
    			if(result > 0) {
    				if(result == 1) {
    					waitAfterMoving = random(500, 800);
    				}
    				return random(500, 800);
    			} else {
    				if(result == -1) {
    					spinView();
    				} else {
    					if(distanceTo(centerTile) > 2) {
    						RSTile rCenterTile = new RSTile(centerTile.getX() + random(-1, 1), centerTile.getY() + random(-1, 1)); 
    						dpWalkTile(rCenterTile);
    					}
    				}
    				return random(500, 800);
    			}
    		} else {
    			if(bankToTrees()) {
    				return random(500, 800);
    			} else {
    				return -1;
    			}
    		}
    	}
    	
    	public int bank() {
    		if(atBank()) {
    			if(RSInterface.getInterface(INTERFACE_BANK).isValid()) {
    				bank.depositAllExcept(1349, 1351, 1353, 1355, 1357, 1359, 6739);
    				loads ++;
    				return random(500, 800);
    			} else {
    				runOn();
    				if(distanceTo(bankTile) > 0) {
    					if(dpWalkTile(bankTile)) {
    						waitAfterMoving = random(200, 300);
    						return random(500, 800);
    					} else {
    						return -1;
    					}
    				} else {
    					if(useBanker()) {
    						return random(500, 800);
    					} else {
    						return -1;
    					}
    				}
    			}	
    		} else {
    			if(treesToBank()) {
    				return random(500, 800);
    			} else {
    				return -1;
    			}
    		}
    	}
    	
    	public boolean useBanker() {
    		RSNPC npc = getNearestNPCByID(bankerID);
    		return atNPC(npc, "Bank Banker");
    	}
    	
    	public boolean atBank() {
    		return distanceTo(bankTile) < 15;
    	}
    	
    	public boolean bankToTrees() {
    		return dpWalkPath(bankToTreesPath);
    	}
    	
    	public boolean treesToBank() {
    		return dpWalkPath(treesToBankPath);
    	}
    	
    	public boolean atTrees() {
    		return distanceTo(tree1Tile) < 10 || distanceTo(tree2Tile) < 10;
    	}
    		
    	public int clickTree() {
    		RSObject object = findObject(treeID);
    		if(object == null || distanceTo(object.getLocation()) > 16) {
    			return -2;
    		}
    		if(atObject(object, "Chop")) {
    			return 1;
    		}
    		if(distanceTo(object.getLocation()) > 3) {
    			if(dpWalkTile(object.getLocation())) {
    				return 2;
    			}
    		}
    		return -1;
    	}
    	
    	public boolean dpWalkPath(RSTile[] path) {
    		for(int i = path.length - 1; i >= 0; i--) {
    			if(dpWalkTile(path[i])) {
    				return true;
    			}
    		}		
    		return false;
    	}
    	
    	public boolean dpWalkTile(RSTile tile) {
    		if(distanceTo(tile) <= 16) {
    			walkTileMM(tile);
    			return true;
    		} else {
    			return false;
    		}
    	}
    	
    	public void homeTele() {
    		openTab(Script.TAB_MAGIC);
    		castSpell(1);
    	}
    	
    	public boolean walkBack() {
    		return dpWalkPath(walkBackPath);
    	}
    	
    	public void runOn() {
    		setRun(true);
    	}
    	
    	public void spinView() {
    		Bot.getInputManager().pressKey((char) KeyEvent.VK_RIGHT);
    		spinningView = true;
    	}
    	
    	boolean spinningView = false;
    	
    	public boolean checkSpinningView() {
    		if(spinningView) {
    			Bot.getInputManager().releaseKey((char) KeyEvent.VK_RIGHT);
    			spinningView = false;
    			return true;
    		} else {
    			return false;
    		}
    	}
    	
    	public int treeID = 1309;
    	
    	public RSTile[] treesToBankPath = {new RSTile(3220,3501),new RSTile(3214,3501),new RSTile(3208,3501),new RSTile(3202,3501),new RSTile(3199,3495),new RSTile(3194,3491),new RSTile(3188,3489),new RSTile(3182,3489),new RSTile(3176,3489),new RSTile(3170,3489),new RSTile(3167,3490),};
    	
    	public RSTile[] bankToTreesPath = {new RSTile(3167,3490),new RSTile(3173,3490),new RSTile(3179,3490),new RSTile(3185,3490),new RSTile(3191,3489),new RSTile(3193,3495),new RSTile(3198,3499),new RSTile(3204,3501),new RSTile(3208,3502),};
    	
    	public RSTile tree1Tile = new RSTile(3208, 3502);
    	
    	public RSTile tree2Tile = new RSTile(3220, 3502);
    	
    	public int bankerID = 6534;
    	
    	public RSTile bankTile = new RSTile(3167, 3490);
    	
    	public RSTile centerTile = new RSTile(3215, 3501);
    	
    	public final String[] treeNames = {"Yew"};
    	
    	public RSTile[] walkBackPath = {new RSTile(3222,3216),new RSTile(3228,3217),new RSTile(3234,3221),new RSTile(3239,3225),new RSTile(3245,3225),new RSTile(3251,3225),new RSTile(3257,3229),new RSTile(3259,3235),new RSTile(3259,3241),new RSTile(3258,3247),new RSTile(3253,3252),new RSTile(3251,3258),new RSTile(3251,3264),new RSTile(3247,3269),new RSTile(3243,3274),new RSTile(3240,3280),new RSTile(3239,3286),new RSTile(3239,3292),new RSTile(3239,3298),new RSTile(3239,3304),new RSTile(3243,3309),new RSTile(3246,3315),new RSTile(3250,3320),new RSTile(3256,3322),new RSTile(3262,3323),new RSTile(3267,3328),new RSTile(3261,3330),new RSTile(3255,3330),new RSTile(3250,3334),new RSTile(3244,3335),new RSTile(3238,3335),new RSTile(3232,3336),new RSTile(3228,3341),new RSTile(3227,3347),new RSTile(3227,3353),new RSTile(3222,3357),new RSTile(3218,3362),new RSTile(3215,3368),new RSTile(3214,3374),new RSTile(3213,3380),new RSTile(3213,3386),new RSTile(3213,3392),new RSTile(3212,3398),new RSTile(3212,3404),new RSTile(3212,3410),new RSTile(3212,3416),new RSTile(3211,3422),new RSTile(3207,3427),new RSTile(3201,3429),new RSTile(3200,3435),new RSTile(3197,3441),new RSTile(3195,3447),new RSTile(3189,3450),new RSTile(3185,3455),new RSTile(3181,3460),new RSTile(3175,3462),new RSTile(3169,3464),new RSTile(3165,3469),new RSTile(3165,3475),new RSTile(3165,3481),new RSTile(3167,3487),new RSTile(3167,3490)};
    	
    }
    
    Fishing, for p2p FGLobs, for f2p, mabey KaramjaFisher By Linux_Communist.
    Code:
    /*
     * FGLobs.java v.1.1 By Flight (Wolf)
     * 
     * Features: 
     * -Auto cages at the fishing guild
     * -Advanced anti-whirlpool, random combat, cage lose
     * -Automatic fishing potion drinking (Taken out)
     * -Better walking to bank procedure
     *
     */
    
    import java.awt.*;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    
    public class FGLobs extends Script implements PaintListener {
    
    	public int fishBanked = 0;
    	public int whirlPoolCount = 0;
    	int randomTime = 0;
    	int progress = 0;
    	Graphics draw;
          public int startLevel = 0;
    	public int startXP = 0;
    
    	public void onRepaint(Graphics g) {
    		if (isLoggedIn()) {
    			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 XPChange = skills.getCurrentSkillExp(10) - startXP;
    			int LevelChange = skills.getCurrentSkillLevel(10) - startLevel;
    
    			g.setColor(Color.black);
    			g.drawString("Banked " + Integer.toString(fishBanked) + " total fish.", 200, 365);
    			g.drawString("Runtime: " + hours + " hrs " + minutes + " mins " + seconds + " secs.", 200, 380);
                      g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " exp.", 200, 395);
    			g.drawString(skills.getXPToNextLevel(10) + " XP to next level, we are " + skills.getPercentToNextLevel(10) + "% to next level.", 200, 410); 
    		}
    	}
    
    	// Getting time so we can check if we have been idle for awhile
    	public long time = System.currentTimeMillis();
    	public long startTime = System.currentTimeMillis();
    
    	public double getVersion() {
    		return 1.1;
    	}
    
    	public String getName() {
    		return "FGLobs";
    	}
    
    	public String getAuthor() {
    		return "Flight(Wolf)";
    	}
    
    	public String getScriptCategory() {
    		return "Fishing";
    	}
    
    	public RSTile[] fishToBankA = new RSTile[] { new RSTile(2594, 3419),
    			new RSTile(2592, 3415), new RSTile(2587, 3419) };
    
    	public RSTile[] fishToBankB = new RSTile[] { new RSTile(2596, 3410),
    			new RSTile(2591, 3416), new RSTile(2587, 3419) };
    
    	public RSTile[] bankToFish = new RSTile[] { new RSTile(2592, 3415),
    			new RSTile(2594, 3420) };
    
    	public static final int[] bankWindows = new int[] { 2213 };
    
    	public boolean onStart(String[] args) {
    		Bot.getEventManager().addListener(PaintListener.class, this);
    		if (isLoggedIn()) {
    			startLevel = skills.getCurrentSkillLevel(10);
    			startXP = skills.getCurrentSkillExp(10);
    		}
    		return true;
    	}
    
    	public void onFinish() {
    		Bot.getEventManager().removeListener(PaintListener.class, this);
    	}
    
    	public int loop() {
    		switch (progress) {
    			case 0: // Fishing part
    				if (isInventoryFull()) {
    					log("Full inventory, walking to bank.");
    					progress++;
    					return random(1000, 1500);
    				}
    				if (getMyPlayer().isInCombat())
    				{
    					log("We're being attacked, oh noez! Running away...");
    					runAway();
    					return random(400, 700);
    
    				}
    				RSNPC whirlpool = getNearestNPCByID(405);
    				if (whirlpool != null) { //Whirlpool detection, comes before everything else.
    					int myX = getMyPlayer().getLocation().getX();
    					int myY = getMyPlayer().getLocation().getY();
    					if (isInAreaNPC(405, (myY - 1), (myY + 1), (myX - 1), (myX + 1))) { //Whirlpool within 1 square radius of us.
    						CageFish(); //Finding a new spot.
    						whirlPoolCount ++;
    					}
    				}
    				if (System.currentTimeMillis() - time < 30000 + randomTime || getNearestNPCByID(405) != null) {
    					if (getMyPlayer().getAnimation() == 619 || getMyPlayer().isMoving()) {
    						return random(350, 500);
    					}
    				}
    				if (!isInventoryFull()) {
    					setRun(true);
    					CageFish();
    					log("Time to fish...");
    					RSItemTile item = getGroundItemByID(20, 301);
    					if (item != null && !getMyPlayer().isMoving() && !inventoryContains(301)) {
    						atTile(item, "Take");
    						log("Recovering lobster cage.");
    					}
    					randomTime = random(1000, 20000);
    					time = System.currentTimeMillis();
    					return random(1500, 2000);
    				}
    
    			case 1:
    				if (getMyPlayer().isMoving()) {
    					return random(250, 500);
    				}
    				if (isInArea(2595, 3420, 2604, 3425)) { // Northern dock
    					walkPathMM(randomizePath(fishToBankA, 2, 2), 20);
    				} else if (isInArea(2603, 3406, 2611, 3416)) { // Southern dock
    					walkPathMM(randomizePath(fishToBankB, 2, 2), 20);
    				}
    				if (distanceTo(findObject(2213)) <= 3) {
    					progress++;
    				}
    				return random(1500, 2000);
    
    			case 2:
    				RSObject bankWindow = findObject(2213);
    				if (bankWindow != null) {
    					if (!atObject(findObject(2213), "Use-quickly"))
    					{
    						return random(500, 750);
    					}
    					fishBanked += getInventoryCount(377);
    					depositAllExcept(301);
    					if (!isInventoryFull()) {
    						if (!inventoryContains(301)) {
    							atBankInventoryItem(301, "Withdraw 1");
    							log("Withdrawing a lobster cage.");
    						}
    					//DoFishyPot();
    					progress++;
    					log("Returning to fishing spot.");
    					}
    					closeBank();
    				}
    				return random(500, 750);
    
    			case 3:
    				if (getMyPlayer().isMoving()) {
    					return random(250, 500);
    				}
    				walkPathMM(randomizePath(bankToFish, 1, 1), 20);
    				if (distanceTo(bankToFish[1]) <= 4) {
    					progress = 0;
    				}
    				return random(1500, 2000);
    		}
    		return random(500, 1000);
    	}
    
    	public void DoFishyPot() {
    		boolean GoOn = false;
    		if (getBankInventoryCount(151) != 0 && !GoOn) {
    			atBankInventoryItem(151, "Withdraw 1");
    			GoOn = true;
    		} else if (getBankInventoryCount(153) != 0 && !GoOn) {
    			atBankInventoryItem(153, "Withdraw 1");
    			GoOn = true;
    		} else if (getBankInventoryCount(155) != 0 && !GoOn) {
    			atBankInventoryItem(153, "Withdraw 1");
    			GoOn = true;
    		} else if (getBankInventoryCount(151) == 0 && getBankInventoryCount(153) == 0 && getBankInventoryCount(155) == 0) {
    			log("Out of fishing potions, continuing script anyways.");
    			GoOn = true;
    		}
    		if (GoOn) {
    			//wait(random(1500, 1750));
    			closeBank();
    			if (inventoryContains(151)) {
    				atInventoryItem(151, "Drink");
    				progress++;
    			} else if (inventoryContains(153)) {
    				atInventoryItem(153, "Drink");
    				progress++;
    			} else if (inventoryContains(155)) {
    				atInventoryItem(155, "Drink");
    				progress++;
    			}
    			log("Returning to fishing spot.");
    		}
    	}
    
    	public void runAway() {
    		RSTile foo, foo2;
    		foo = getMyPlayer().getLocation();
    		setRun(true);
    
    		foo2 = new RSTile(2586, 3419); //bank
    
    		walkTileMM(foo2);
    		wait(random(2000, 4000));
    		walkTileMM(foo);
    	}
    
    	public void CageFish() {
    		RSNPC spot = getNearestNPCByID(312);
    		if (spot != null && distanceTo(spot.getLocation()) > 10) {
    			log("Could not find fishing spot, walking to new spot.");
    			walkTileMM(new RSTile(spot.getLocation().getX() - 3, spot
    					.getLocation().getY() - 3));
    		} else {
    			atNPC(spot, "Cage");
    			log("Fishing spot found.");
    		}
    	}
    
    	public boolean isInAreaNPC(int NPCId, int minX, int minY, int maxX, int maxY) { //A bit of my home-made code :)
    		RSNPC Npc = getNearestNPCByID(NPCId);
    		int npcX = Npc.getLocation().getX();
    		int npcY = Npc.getLocation().getY();
    		if ((npcX >= minX && npcX <= maxX) && (npcY >= minY && npcY <= maxY))
    			return true;
       		return false;
    	}
    
    	public boolean isInArea(int minX, int minY, int maxX, int maxY) {
    		int myX = getMyPlayer().getLocation().getX();
    		int myY = getMyPlayer().getLocation().getY();
    		if ((myX >= minX && myX <= maxX) && (myY >= minY && myY <= maxY))
    			return true;
       		return false;
    }
    
    }
    
    Code:
    /*
     *             KaramjaFisher.java
     *                      v.1.8
     *	    By Linux_Communist
     *   Fixed by veejay, samyyy123, mrz.
     *	        www.chemfy.fi
     *	     First release 26.03.08
     *
     * Features:
     * -Can bank or power
     * -Can catch lobsters, tuna, swordfish.
     * -Anti whirlpool, random combat, losing tools, logout
     * -Deathwalk
     *
     *
     * With harpoon argument it fishes tuna and swordfish.
     * With tuna/swordfish argument it fishes for tuna and swordfish but
     * drops the other fish.
     *
     * Updates:
     * Karamja Fisher 1.3
     * - Removed bugs
     * - Put working bank
     *
     * Karamja Fisher 1.4
     * - The script text box is now in a better place with a frame
     * - Added text "Holding ** fishes"
     *
     * Karamja Fisher 1.5
     * - Calculator till next lvl.
     * - "exp" will be changed to "XP".
     * - "Banked *** lobster"/swordfish/etc will be added "s".
     * - In credits will be added a dot.
     *
     * Karamja Fisher 1.6
     * - Removed warnings
     * - "sworfishes" were renamed to "swordfishes"
     * - Doesn't click anymore on papermap
     * - Withdrawing 60 gp, if inventory has less money than 60 gp. NOTE: CASH SHOULD BE IN 1st SLOT!  Cash tab should be already opened!   And fishes should be in the cash tab.
     *
     * Karamja Fisher 1.7
     * - Added more custom's officers
     * - Fixed clicking / answering for custom's officer's questions
     * - Won't wait 5-7 seconds after clicking on "Pay-Fare". It will wait 1-2 seconds.
     * - Now script can withdraw anything, so cash can be anywhere.
     *
     * Karamja Fisher 1.8
     * - Fixed withdraw/deposit of tools - by fusion89k
     * - Fixed tuna dropping in swordie fishing method - by fusion89k
     *
     */
    
    
    import java.awt.*;
    import java.util.Map;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import java.awt.event.KeyEvent;
    
    
    public class KaramjaFisher extends Script implements PaintListener {
    
    	private static final Color BLACK = new Color(0, 0, 0, 100);
    	public static final Color GREEN = new Color(0, 255, 0, 255);
    	private static final Color ORANGE = new Color(255, 128, 0, 255);
    
    	public boolean interfaceExists(int id) {
    		boolean[] vi = Bot.getClient().getValidInterfaceArray();
    		if (vi == null) {
    			return false;
    		}
    		if (!(id < vi.length)) {
    			return false;
    		}
    		return vi[id];
    	}
    public void turnCamera() { 
    		char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
    		char[] UD = new char[] { KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    		char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
    				KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    		int random2 = random(0, 2);
    		int random1 = random(0, 2);
    		int random4 = random(0, 4);
    
    		if (random(0, 3) == 0) {
    			Bot.getInputManager().pressKey(LR[random1]);
    			try {
    				Thread.sleep(random(100, 400));
    			} catch (Exception e) {
    			}
    			Bot.getInputManager().pressKey(UD[random2]);
    			try {
    				Thread.sleep(random(300, 600));
    			} catch (Exception e) {
    			}
    			Bot.getInputManager().releaseKey(UD[random2]);
    			try {
    				Thread.sleep(random(100, 400));
    			} catch (Exception e) {
    			}
    			Bot.getInputManager().releaseKey(LR[random1]);
    		} else {
    			Bot.getInputManager().pressKey(LRUD[random4]);
    			if (random4 > 1)
    				try {
    					Thread.sleep(random(300, 600));
    				} catch (Exception e) {
    				}
    			else
    				try {
    					Thread.sleep(random(500, 900));
    				} catch (Exception e) {
    				}
    			Bot.getInputManager().releaseKey(LRUD[random4]);
    		}
    	}
    
    	public void onRepaint(Graphics g)
    	{
    		if(isLoggedIn()) {
    			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 XPChange = skills.getCurrentSkillExp(10) - startXP;
    			int LevelChange = skills.getCurrentSkillLevel(10) - startLevel;
    
    			int x = 18;
    			int y = 108;
    			g.setColor(BLACK);
    			g.fill3DRect(14, 108, 219, 214, true);
    			g.setColor(GREEN);
    				g.drawString(getName() + " " + getVersion(), x, y += 15);
    				g.drawString("by " + getAuthor() + ", fixed by", x, y += 15);
    				g.drawString(getFixers() + ".", x, y += 15);
    			g.setColor(ORANGE);
    			if(fishHarpoon && dropTuna)
    				g.drawString("Banked " + Integer.toString(swordfishBanked) + " swordfishes.", x, y += 20);
    			else if(fishHarpoon && !dropTuna && !dropSwordfish)
    				g.drawString("Banked " + Integer.toString(swordfishBanked) + " swordfishes and " + Integer.toString(tunaBanked) + " tunas.", x, y += 20);
    			else if(fishHarpoon && dropSwordfish)
    				g.drawString("Banked " + Integer.toString(tunaBanked) + " tunas.", x, y += 20);
    			else if(!fishHarpoon)
    				g.drawString("Banked " + Integer.toString(lobsterBanked) + " lobsters.", x, y += 20);
    				g.drawString("Runtime: " + hours + "h " + minutes + "min " + seconds + "sec.", x, y += 20);
    				g.drawString("Current: " + skills.getCurrentSkillLevel(10) + " levels and " + skills.getCurrentSkillExp(10) + " XP.", x, y += 20);
    				g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " XP.", x, y += 20);
    				g.drawString("We're " + skills.getPercentToNextLevel(10) + "% to next level, which now", x, y += 20);
    				g.drawString("needs " + skills.getXPToNextLevel(10) + " XP.", x, y += 20);
    			if(fishHarpoon && dropTuna)
    				g.drawString("Next level needs " + skills.getXPToNextLevel(10) / 100 + " swordfishes.", x, y += 20);
    			else if(fishHarpoon && !dropTuna && !dropSwordfish)
    				g.drawString("Next level needs " + skills.getXPToNextLevel(10) / 90 + " both fishes.", x, y += 20);
    			else if(fishHarpoon && dropSwordfish)
    				g.drawString("Next level needs " + skills.getXPToNextLevel(10) / 80 + " tunas.", x, y += 20);
    			else if(!fishHarpoon)
    				g.drawString("Next level needs " + skills.getXPToNextLevel(10) / 90 + " lobsters.", x, y += 20);
    			if(fishHarpoon && dropTuna)
    				g.drawString("Holding " + getInventoryCount(swordfishID) + " swordfishes.", x, y += 20);
    			else if(fishHarpoon && !dropTuna && !dropSwordfish)
    				g.drawString("Holding " + getInventoryCount(swordfishID) + " swordfishes and " + getInventoryCount(tunaID) + " tunas.", x, y += 20);
    			else if(fishHarpoon && dropSwordfish)
    				g.drawString("Holding " + getInventoryCount(tunaID) + " tunas.", x, y += 20);
    			else if(!fishHarpoon)
    				g.drawString("Holding " + getInventoryCount(lobsterID) + " lobsters.", x, y += 20);
    
    		}
        	}
    
    		public static final int lobsterID = 377;
    		public static final int tunaID = 359;
    		public static final int swordfishID = 371;
    
    
    	// Deathpath
    	private static final RSTile[] DEATH_PATH = {
    						     new RSTile(3232, 3219), new RSTile(3233, 3227),
    						     new RSTile(3228, 3234), new RSTile(3220, 3237),
    							 new RSTile(3212, 3237), new RSTile(3204, 3238),
    							 new RSTile(3196, 3240), new RSTile(3188, 3242),
    							 new RSTile(3180, 3243), new RSTile(3172, 3241),
    							 new RSTile(3164, 3241), new RSTile(3156, 3239),
    							 new RSTile(3148, 3237), new RSTile(3140, 3235),
    							 new RSTile(3135, 3229), new RSTile(3126, 3227),
    							 new RSTile(3118, 3228), new RSTile(3109, 3231),
    							 new RSTile(3097, 3232), new RSTile(3087, 3230)  };
    
    	public static final RSTile[] bankPath = new RSTile[] { new RSTile(3095, 3241), new RSTile(3089, 3247), new RSTile(3081, 3246),
    							new RSTile(3073, 3249), new RSTile(3073, 3257), new RSTile(3073, 3265),
    							new RSTile(3073, 3273), new RSTile(3065, 3275), new RSTile(3061, 3268),
    							new RSTile(3059, 3260), new RSTile(3053, 3254), new RSTile(3045, 3253),
    							new RSTile(3042, 3245), new RSTile(3041, 3237), new RSTile(3033, 3237),
    							new RSTile(3028, 3230), new RSTile(3028, 3222), new RSTile(3027, 3218) };
    
    	public static final RSTile[] karamjaPath = new RSTile[] { new RSTile(2924, 3177), new RSTile(2926, 3169),
    						new RSTile(2920, 3163), new RSTile(2917, 3155), new RSTile(2925, 3153),
    						new RSTile(2933, 3150), new RSTile(2942, 3146), new RSTile(2952, 3146) };
    
    	public RSTile[] shipToBank = reversePath(bankPath);
    	public RSTile[] shipToKaramja = reversePath(karamjaPath);
    	//Fishing spot id
    	public static final int[] fishingSpots = new int[] { 324 };
    
    	public static final int lobsterPotID = 301;
    	public static final int harpoonID = 311;
    	public static final int coinsID = 995;
    	// Getting time so we can check if we have been idle for awhile
    	public long time = System.currentTimeMillis();
    	// Items to drop when using power fishing and inventory is full
    	public static final int[] dropThis = new int[] { 377, 359, 371 };
    
    	public static final int[] bankWindows = new int[] { 2213 };
    
    	public static final int[] BankCustoms = new int[] { 377, 376, 378 }; // All custom officers in port sarim, with them you can get to Karamja
    	public static final int[] KaramjaCustoms = new int[] { 380 }; // All custom officers in karamja port, with them you can get to Port Sarim
    	// Banks tile
    
    	public boolean powerFish, fishHarpoon, dropTuna, dropSwordfish;
    
    	public int startLevel = 0;
    	public int startXP = 0;
    
    	public int tunaBanked = 0;
    	public int lobsterBanked = 0;
    	public int swordfishBanked = 0;
    	int tunaCount = 0;
    	int lobsterCount = 0;
    	int swordfishCount = 0;
    	public long startTime = System.currentTimeMillis();
    
    	int progress = 0;
    	boolean walking = false;
    	int randomTime = 0;
    	boolean weAreOnKaramja = true;
    	boolean sailinggp = false;
    
        public double getVersion() {
            return 1.8;
        }
    
        public String getName() {
            return "Karamja Fisher";
        }
    
    	public String getScriptCategory() {
    		return "Fishing";
    	}
    
    
        public String getAuthor() {
            return "Linux_Communist";
        }
    
        public String getFixers() {
            return "veejay, samyyy123, mrz";
        }
    
    
        public boolean onStart(Map<String, String> args) {
    
    		switch(doWeHarpoon(args.get("what")))
    		{
    			case 1:	fishHarpoon = true;
    				dropTuna = false;
    				dropSwordfish = false;
    				break;
    			case 2: fishHarpoon = false;
    				dropTuna = false;
    				dropSwordfish = false;
    				break;
    			case 3: dropSwordfish = false;
    				fishHarpoon = true;
    				dropTuna = true;
    				break;
    			case 4: dropTuna = false;
    				fishHarpoon = true;
    				dropSwordfish = true;
    				break;
    			case 0: return false;
    		}
    		if(args.get("how").equals("power"))
    			powerFish = true;
    		else
    			powerFish = false;
    
    		if (args.get("sailingmoney").equals("take"))
    			sailinggp = true;
    		else sailinggp = false;
    
    		lobsterBanked = 0;
    		tunaBanked = 0;
    		swordfishBanked = 0;
    		startTime = System.currentTimeMillis();
    		if(isLoggedIn()){
    			startLevel = skills.getCurrentSkillLevel(10);
    			startXP = skills.getCurrentSkillExp(10);
    		}
    		Bot.getEventManager().addListener(PaintListener.class, this);
    		return true;
    	}
    
    	public void onFinish() {
    		Bot.getEventManager().removeListener(PaintListener.class, this);
    	}
    
    
        public int loop() {
        	if(isLoggedIn() && startLevel == 0)
    	{
    		startLevel = skills.getCurrentSkillLevel(10);
    		startXP = skills.getCurrentSkillExp(10);
    	}
    
    	switch(progress)
    	{
    		case 0: //Fishing part
    				if(distanceTo(bankPath[0]) < 15) {
    					log("We are at the bank");
    					turnCamera();
    					weAreOnKaramja = false;
    					progress = 2;
    					return random(1000,2000);
    				}
    
    				if (!walking && dead()) // check if we are dead and not deathwalking
    				{
    					log("Dead");
    					walking = true;
    					setRun(true);
    					return random(500, 1000);
    				}
    				if(walking) // Does deathwalk
    				{
    					if(!getMyPlayer().isMoving())
    						doDeathWalk();
    					return random(500, 1000);
    				}
    
    				if (isInventoryFull() && !powerFish){ //If we bank and have inv full moves to next progress
    
    					if(dropTuna)
    						dropAllExcept(harpoonID,coinsID,swordfishID);
    					if(dropSwordfish)
    						dropAllExcept(harpoonID,coinsID,tunaID);
    					if(isInventoryFull())
    					{
    						progress++;
    						setRun(true);
    						return random(1000,1500);
    					}
    					return random(500,1000);
    				} else if(isInventoryFull() && powerFish) // If we power and have inv full drops fish
    				{
    					dropFish();
    				}
    
    				if(getMyPlayer().isInCombat()) // If we are in combat runs away
    				{
    					runAway();
    					return random (400,700);
    				}
    
    				if(System.currentTimeMillis() - time < 30000+randomTime || getNearestNPCByID(405) != null)
    				{
    					if (getMyPlayer().getAnimation() == 618 || getMyPlayer().getAnimation() == 619 || getMyPlayer().isMoving())
    					{
    						return random(350,500);
    					}
    				}
    				if(fishHarpoon)
    				{
    					if(!inventoryContains(harpoonID))
    					{
    						if(getGroundItemByID(15, harpoonID) != null) {
    							RSItemTile item = getGroundItemByID(15, harpoonID);
    
    							if(item != null && !getMyPlayer().isMoving()) {
    								if(distanceTo(item) > 8) {
    									walkTileMM(item);
    									return random(1000,2000);
    								}
    
    								atTile(item, "Take");
    								return random(500, 1000);
    
    							} else
    								return random(500, 1000);
    						} else {
    							progress++;
    							return random(300,500);
    						}
    					}
    
    				} else if(!fishHarpoon)
    				{
    					if(!inventoryContains(lobsterPotID))
    					{
    						if(getGroundItemByID(15, lobsterPotID) != null) {
    							RSItemTile item = getGroundItemByID(15, lobsterPotID);
    
    							if(item != null && !getMyPlayer().isMoving()) {
    								if(distanceTo(item) > 8) {
    									walkTileMM(item);
    									return random(1000,2000);
    								}
    
    								atTile(item, "Take");
    								return random(500, 1000);
    
    							} else
    								return random(500,1000);
    						} else {
    							progress++;
    							return random(300,500);
    						}
    					}
    				}
    				fish(); // Lets fish
    				randomTime = random(1000,20000); // Gets some random for the timer
    				time = System.currentTimeMillis(); // resets timer
    				return random(2000,3000);
    		case 1:
    
    				return walkToBank();
    		case 2:
    				weAreOnKaramja = false;
    				RSObject bankWindow = findObject(bankWindows);
    				turnCamera();
    				if(distanceTo(bankWindow.getLocation()) > 5)
    				{
    					walkTileMM(bankWindow.getLocation());
    					return random(500,750);
    				}
    				if(!interfaceExists(INTERFACE_BANK))
    				{
    					atObject(bankWindow,"Use-quickly");
    					return random(1500,1750);
    				}
    
    				if(lobsterCount == 0)
    					lobsterCount = getInventoryCount(377);
    				if(tunaCount == 0)
    					tunaCount = getInventoryCount(359);
    				if(swordfishCount == 0)
    					swordfishCount = getInventoryCount(371);
    
    				if(fishHarpoon){
    				turnCamera();
    					bank.depositAllExcept(harpoonID, coinsID);}
    				if(!fishHarpoon){
    				turnCamera();
    					bank.depositAllExcept(lobsterPotID, coinsID);}
    
    				if (sailinggp == true) { // If arguments said that we have to take 60gp for sailing, then we will take them
    					withdraw("Coins", coinsID, 60);
    				}
    
    				checkForTool();
    				if(!isInventoryFull()) { // if inventory isnt full goes to second progress
    
    					lobsterBanked += lobsterCount;
    					lobsterCount = 0;
    					swordfishBanked += swordfishCount;
    					swordfishCount = 0;
    					tunaBanked += tunaCount;
    					tunaCount = 0;
    
    					progress++;
    				}
    				bank.close(); // close bank window
    
    				return random(500,750);
    		case 3:
    
    				return walkToFishingSpot();
    	}
    
    
            return random(500, 1000);
    
        }
    
    	public boolean withdraw(String itemName, int itemID, int count) {
    		bank.searchItem(itemName);
    		wait(random(1000,2000));
    		clickMouse(random(40, 60), random(100, 115), 1, 1, false);
    		wait(random(250,500));
    		if (count == 0) {
    			atMenu("Withdraw-All");
    			wait(random(200,300));
    		}
    		if (count == 1 || count == 5 || count == 10) {
    			atMenu("Withdraw-" + count);
    			wait(random(200,300));
    		} else {
    			atMenu("Withdraw-X");
    			wait(random(800,1000));
    			if(RSInterface.getInterface(INTERFACE_BANK_SEARCH).isValid()) {
    				Bot.getInputManager().sendKeys("" + count, true);
    				wait(random(700,800));
    			}
    		}
    		wait(random(1000,2000));
    		if (getInventoryCount(itemID) < 1) {
    			log("Seems you don't have more " + itemName + ".");
    			stopAllScripts();
    		}
    		wait(random(500,1000));
    		clickMouse(random(301, 330), random(298, 317), 1, 1, true);
    		wait(random(1000,2000));
    		return true;
    	}
    
    	public int doWeHarpoon(String whatToFish) { // checks if argument contained n as in net or b as in bait
    		if (whatToFish.contains("both"))
    			return 1;
    		else if (whatToFish.contains("lobster"))
    			return 2;
    		else if(whatToFish.contains("sword"))
    			return 3;
    		else if(whatToFish.contains("tuna"))
    			return 4;
    		else {
    			log("To use this script give arguments either harpoon, tuna, lobster or swordfish for first and power or bank on second like \"harpoon,bank\"");
    			return 0;
    		}
    	}
    
    	public boolean dead() { // Are we dead ?
    
    		return distanceTo(new RSTile(3232, 3219)) < 15;
    	}
    
    	public void doDeathWalk() { // doing deathwalk
    		weAreOnKaramja = false;
    		if (distanceTo(DEATH_PATH[DEATH_PATH.length-1]) < 10){
    			walking = false;;
    
    		} else
    			walkPathMM(randomizePath(DEATH_PATH, 2, 2), 15);
    	}
    
    	public void dropFish() { // Dropping items that are set on dropThis array
    		boolean drop = false;
    		for(int i = 0; i < 27; i++)
    		{
    			for(int y = 0; y < dropThis.length; y++)
    			{
    				if(dropThis[y] == getInventoryItems()[i].getID()) {
    					drop = true;
    
    				}
    			}
    			if(drop)
    			{
    				atInventoryItem(getInventoryItems()[i].getID(), "Drop");
    				wait(random(1000,2000));
    				drop = false;
    			}
    
    		}
    	}
    
    	public void drop(int id) {
    		if(inventoryContains(id))
    		{
    			for(int i = 0; i < 27; i++)
    			{
    				if(getInventoryItems()[i].getID() == id)
    				{
    					atInventoryItem(id, "Drop");
    					if(inventoryContains(id))
    						break;
    				}
    			}
    		}
    	}
    
    	public void runAway() { // running away and running back after a while
    		RSTile foo, bar;
    		foo = getMyPlayer().getLocation();
    		setRun(true);
    
    		bar = new RSTile(foo.getX()-random(8,10),foo.getY()-random(8,10));
    
    		walkTileMM(bar);
    		wait(random(17000,20000));
    		walkTileMM(foo);
    	}
    
    
    	public void fish() { // Fishing
    		RSNPC spot = getNearestNPCByID(fishingSpots);
    		if (spot == null || distanceTo(spot.getLocation()) > 25) {
    			log("No (nearby) fishing spot. This sucks.");
    		}
    		else if (distanceTo(spot.getLocation()) > 4){
    			walkTileMM(spot.getLocation());
    		} else {
    			weAreOnKaramja = true;
    			if(fishHarpoon) atNPC(spot,"Harpoon");
    			else if(!fishHarpoon) atNPC(spot,"Cage");
    		}
    	}
    
    	public int walkToBank() {
    		if (getMyPlayer().isMoving()) return random(250,500);
    		if(findObject(2084) != null) {
    			wait(random(6000,8000)); // Wait's 6-8 seconds till it will click on "Cross"
    			if(atObject(findObject(2084), "Cross"))
    			{
    				weAreOnKaramja = false;
    				return random(2000,3000);
    			} else return random(1000,2000);
    		}
    		if(distanceTo(shipToBank[0]) < 8) { weAreOnKaramja = false; }
    		if(weAreOnKaramja)
    		{
    			if(distanceTo(karamjaPath[karamjaPath.length -1]) < 8){
    				if(Bot.getClient().getInterfaceCache()[64] != null) {
    				clickMouse(220+random(-77,60) ,455+random(-5,2), true); // Clicks on: Click here to continue // Interface: [64] [5]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[228] != null) {
    				clickMouse(260+random(-85,87) ,403+random(-5,3), true); // Clicks on: Can I journey on this ship? // Ok. // Interface: [228] [2]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[230] != null) {
    				clickMouse(260+random(-118,116) ,420+random(-6,5), true); // Clicks on: Search away, I have nothing to hide. // Interface: [230] [3]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[241] != null) {
    				clickMouse(310+random(-70,63) ,455+random(-7,1), true); // Clicks on: Click here to continue // Interface: [241] [5]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[242] != null) {
    				clickMouse(310+random(-73,65) ,455+random(-5,2), true); // Clicks on: Click here to continue // Interface: [242] [6]
    				return random(1000,2000);
    				} else {
    					RSNPC customs = getNearestNPCByID(KaramjaCustoms);
    					if(customs != null)
    					{
    						atNPC(customs, "Pay-Fare");
    						return random(1000,2000);
    					} else {
    
    					return random(1000,2000);
    					}
    				}
    			}
    
    			walkPathMM(randomizePath(karamjaPath,2,2),12);
    		} else
    		{
    			if (distanceTo(bankPath[0]) < 8){
    				progress++;
    				return random(500,750);
    			}
    			walkPathMM(randomizePath(shipToBank,2,2) ,15);
    		}
    		return random(3500,4000);
    	}
    
    	public int walkToFishingSpot() {
    		if (getMyPlayer().isMoving()) return random(250,500);
    		if(findObject(2082) != null) {
    			wait(random(6000,8000)); // Wait's 6-8 seconds till it will click on "Cross"
    			if(atObject(findObject(2082), "Cross"))
    			{
    				weAreOnKaramja = false;
    				return random(2000,3000);
    			} else return random(1000,2000);
    		}
    		if(distanceTo(shipToKaramja[0]) < 20) weAreOnKaramja = true;
    		if(!weAreOnKaramja)
    		{
    			if(distanceTo(bankPath[bankPath.length -1]) < 8){
    				if(Bot.getClient().getInterfaceCache()[64] != null) {
    				clickMouse(220+random(-77,60) ,455+random(-5,2), true); // Clicks on: Click here to continue // Interface: [64] [5]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[228] != null) {
    				clickMouse(260+random(-28,33) ,403+random(-4,5), true); // Clicks on: Yes please.            // Interface: [228] [2]
    				return random(1000,2000);
    				} else if(Bot.getClient().getInterfaceCache()[241] != null) {
    				clickMouse(310+random(-70,63) ,455+random(-7,1), true); // Clicks on: Click here to continue // Interface: [241] [5]
    				return random(1000,2000);
    				} else {
    					RSNPC customs = getNearestNPCByID(BankCustoms);
    					if(customs != null)
    					{
    						atNPC(customs, "Pay-Fare");
    						return random(1000,2000);
    					} else return random(1000,2000);
    				}
    
    			}
    			walkPathMM(randomizePath(bankPath,2,2),15);
    		} else
    		{
    			if (distanceTo(karamjaPath[0]) < 8){
    				progress = 0;
    				return random(500,750);
    			}
    			walkPathMM(randomizePath(shipToKaramja,2,2) ,18);
    		}
    		return random(3500,4000);
    
    	}
    
    	public void checkForTool() {
    		boolean tool = false;
    		if(fishHarpoon)
    		{
    			if(inventoryContains(harpoonID))
    			{
    				log("Have harpoon");
    				tool = true;
    			}
    		} else if(!fishHarpoon)
    		{
    			if(inventoryContains(lobsterPotID))
    			{
    				log("Have lobster pot");
    				tool = true;
    			}
    		}
    		if(!tool)
    		{
    			log("No tool, taking one");
    			//for(int i = 0; i < bank.getItemArray().length; i++) {
    				if(!fishHarpoon)
    				{
    
    					//if(bank.getItemArray()[i] == lobsterPotID)
    					//{
    						//withdraw("Coins", 995, 60);
    						withdraw("Lobster pot", lobsterPotID, 1);
    						//bank.atItem(lobsterPotID,"Withdraw 1");
    						tool = true;
    						log("Took lobster pot");
    					//}
    				} else if(fishHarpoon)
    				{
    					//if(bank.getItemArray()[i] == harpoonID)
    					//{
    						withdraw("Harpoon", 311, 1);
    						//bank.atItem(harpoonID,"Withdraw 1");
    						tool = true;
    						log("Took harpoon");
    					//}
    				}
    				//if(tool)
    				//	break;
    			//}
    		}
    	}
    	public String getScriptDescription() {
    		return "<html>\n" +
    				"<head></head>\n" +
    				"<body>\n" +
    					"<center>" +
    						"<h2>" + getName() + "</h2>" +
    					"</center>\n" +
    					"<b>Author:</b> " + getAuthor() + "<br />" +
    					"<b>Fixed by:</b> " + getFixers() + "<br />" +
    					"<b>Website:</b> <a href=\"http://www.chemfy.fi/\">http://www.chemfy.fi/</a><br />" +
    					"<b>Version:</b> " + getVersion() + "<br />" +
    
    					"<b>Features:</b>" +
    					"<ul><li>Can bank or power</li>" +
    					"<li>Can catch lobster, tuna, swordfish.</li>" +
    					"<li>Anti whirlpool, random combat, losing tools, logout.</li>" +
    					"<li>Shows fish banked and runtime.</li>" +
    					"<li>Deathwalk.</li></ul><br />" +
    
    					"<b>Arguments:<b><br />" +
    					"<form>Take 60gp for sailing each time:<input type=\"radio\" name=\"sailingmoney\" value=\"take\" checked=\"checked\"> yes " +
    					"<input type=\"radio\" name=\"sailingmoney\" value=\"notake\"> no<BR></form>" +
    					"<form>Bank:<input type=\"radio\" name=\"how\" value=\"bank\" checked=\"checked\"> " +
    					"Power:<input type=\"radio\" name=\"how\" value=\"power\"><br /></form>" +
    
    					"<form>Lobster:<input type=\"radio\" name=\"what\" value=\"lobster\" checked=\"checked\"> " +
    					"Tuna:<input type=\"radio\" name=\"what\" value=\"tuna\"> " +
    					"Swordfish:<input type=\"radio\" name=\"what\" value=\"swordfish\"> " +
    					"Tuna & Swordfish:<input type=\"radio\" name=\"what\" value=\"both\"><br /></form>" +
    
    
    				"</body>\n" +
    				"</html>";
    	}
    
    }
    
    Cooking, i prefer AlkharidCooker By Slayer.
    Code:
    /* 
    *        AlkharidCooker.java
    *        v2.3
    *          By Slayer
    *       
    *    Updated - 9/12/08
    * 
    *
    * This script need arguments the id of the thing you want to cook.
    *
    * Features:
    * -Banks and cooks
    *
    */
    
    
    import java.awt.*;
    import java.util.Map;
    
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.script.Skills;
    import com.speljohan.rsbot.script.wrappers.RSPlayer;
    import com.speljohan.rsbot.script.Bank;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    
    
    public class AlkharidCooker extends Script implements PaintListener {
        
        public void onRepaint(Graphics g) 
        {    
            if(isLoggedIn()) {
                int Xbox = 227;
                int Ybox = 345;
                int Xprint = Xbox + 5;
                int Yprint = Ybox + 15;
                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 XPChange = skills.getCurrentSkillExp(7) - startXP;
                int LevelChange = skills.getCurrentSkillLevel(7) - startLevel;
                float XPperSec = 0;
                float XPperMin = XPperSec*60;
                float XPperHour = XPperMin*60;
                if ((minutes > 0 || hours > 0 || seconds > 0) && XPChange > 0) {
                    XPperSec = ((float) XPChange)/(float)(seconds + (minutes*60) + (hours*60*60));
                }            
                g.setColor(Color.red);
                g.drawRoundRect(Xbox, Ybox, 270 - 1, 95 - 1,20,20);
                g.setColor(new Color(255, 255, 255, 100));
                g.fillRoundRect(Xbox + 1, Ybox + 1, 270 - 2, 95 - 2,20,20);
    
    
                g.setColor(Color.black);
                g.drawString("Banked " + Integer.toString(fishBanked) + " cooked fish and " + Integer.toString(burntBanked) + "burnt fish", Xprint, Yprint);
                g.drawString("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds.",
                        Xprint, Yprint+15);
                g.drawString("Current: " + skills.getCurrentSkillLevel(7) + " levels and " + skills.getCurrentSkillExp(7) + " exp.", Xprint, Yprint+30);
                g.drawString("Gained: " + LevelChange + " levels and " + XPChange + " exp.",
                        Xprint, Yprint+45);
                g.drawString((int)XPperHour    + " exp per Hour."  ,    Xprint, Yprint+60);
    
                g.drawString(skills.getXPToNextLevel(7) + " XP to next level, we are " + skills.getPercentToNextLevel(7) + "% to next level.",    Xprint, Yprint+75);
            
            }
            }
            
        static final int[] rangeID = new int[] { 25730};
    
        // Getting time so we can check if we have been idle for awhile
        long time = System.currentTimeMillis();
        
        static final int[] bankWindows = new int[] { 35647 };
        // Banks tile
        RSTile bankTile = new RSTile(3270 + (random( -1, 1)), 3167 + (random(-1, 1)));
    
        RSTile cookInside = new RSTile(3274 + (random( -1, 1)), 3180 + (random(-1, 1)));
        int whatToCook;
        static final int[] cookedFood = new int[] { 315, 325, 347, 319, 333, 329, 351, 379,
                                                           361, 385, 373, 7946};
        static final int[] burntFood = new int[] {7954, 323, 369, 357, 367, 343, 381, 375 };
        int randomRunValue = 30;
        int degrees = 90;
        int progress = 0;
        int randomTime = 0;
    
        int fail = 0;
        int startLevel = 0;
        int startXP = 0;
        int fishBanked = 0;
        int burntBanked =0;
        long startTime = System.currentTimeMillis();
        
        public double getVersion() {
    
            return 2.3;
    
        }
    
    
    
        public String getName() {
    
            return "Alkharid Cooker";
    
        }
    
    
        public String getScriptCategory() {
            return "Cooking";
        }
    
    
        public String getAuthor() {
    
            return "Slayer";
    
        }
    
    
    
        public boolean onStart(Map<String, String> args) {
            // Checks gives arguments to see if they are correct and to get settings
            try {
                whatToCook = Integer.parseInt(args.get("id"));
                
            } catch (NumberFormatException e) {
                log("To use this script you need to give as argument the id fo the fish you are cooking.");
                return false;
            }
            
            fishBanked = 0;
            burntBanked =0;
            startTime = System.currentTimeMillis();
            if(isLoggedIn()){ 
                startLevel = skills.getCurrentSkillLevel(7);
                startXP = skills.getCurrentSkillExp(7);
            }
            
            Bot.getEventManager().addListener(PaintListener.class, this);
            return true;
        }
    
        public void onFinish() {
            Bot.getEventManager().removeListener(PaintListener.class, this);
        }
        
    
    
        public int loop() {
                if(isLoggedIn() && startLevel == 0)
            {
                startLevel = skills.getCurrentSkillLevel(7);
                startXP = skills.getCurrentSkillExp(7);
            }
        
        switch(progress)
        {
            case 0: 
                    if(getMyPlayer().isMoving()) return random(500,1000);
                    
                    
                    if(distanceTo(bankTile) < 8) {
                    
                        progress = 2;
                        return random(750,1000);    
                    }
                    
                    if ( getEnergy() >= randomRunValue && !isRunning( ) ) {
    
                        setRun( true );
                        randomRunValue = random(30, 100);
                        return random(250,500);
                    }    
                    
                    if (!inventoryContains(whatToCook)){ 
                        progress++;
                        return random(750,1500);
                    }
                    
                    if (inventoryContains(whatToCook)){ 
                        progress = 3;
                        return random(750,1500);
                    }
                    
                    if(getMyPlayer().isInCombat()) 
                    {
                        runAway();
                        return random (400,700);
    
                    }
                    
            case 1:
                    return walkToBank();
            case 2:
                    RSObject bankWindow = findObject(bankWindows);
                if (bankWindow != null) {
                    if(distanceTo(bankWindow.getLocation()) > 5)
                    {
                        walkTileMM(bankWindow.getLocation());
                        return random(500,750);
                    }
                    
                    if (!RSInterface.getInterface(762).isValid()) {
                        atObject(bankWindow, "Use-quickly");
                        return random(1000, 1250);
                    }
                    }
                    
                    fishBanked += getInventoryCount(cookedFood);
                    burntBanked += getInventoryCount(burntFood);
    
                    
                    RSObject raw = findObject(whatToCook);
                    bank.depositAllExcept(whatToCook);
                        if(inventoryContains(whatToCook)) {
                            progress++;
                            return random(1000,2000);
                        }
                    if(!isInventoryFull()) {
                        withdrawAll();
                        }
                    if(isInventoryFull() && inventoryContains(whatToCook)) {
                        progress++;
                    }
                    if (!inventoryContains(whatToCook)) fail++;
                    if (fail >= 3) {
                    log("Out of Fish or to many Mis-Banks. Stopping Script");
                    return -1 ;
                    }
                    bank.close();
                    return random(500,750);    
            case 3:                
                    return walkToCookingSpot();
            case 4:
                    if (!inventoryContains(whatToCook)) progress = 0;
                    if (!waitForAnimation(2000) && inventoryContains(whatToCook)) {
                        return cook();
                    } else {
                    antiBan();
                    return random(50,100);
                    }
                    
        }
    
    
            return random(500, 1000);
    
        }
        
        public void runAway() { // running away and running back after a while
            RSTile foo, bar;
            foo = getMyPlayer().getLocation();
            setRun(true);
                    
            bar = new RSTile(foo.getX()+random(8,10),foo.getY()+random(8,10));
                    
            walkTileMM(bar);
            wait(random(17000,20000));
            walkTileMM(foo);
        }
    
    
        public int cook() {
            fail = 0;
            if(Bot.getClient().getInterfaceCache()[307] != null && RSInterface.getInterface(307).isValid()) {
                clickMouse(225+random(0,75) ,380+random(0,70), false);
                atMenu("Cook All");
                progress = 4;
                return random(500,1000); 
            } else {
                RSObject range = findObject(rangeID);
                if (range == null || distanceTo(range.getLocation()) > 15) {
                    log("No (nearby) range. This sucks.");
                    return random(4000,6000);
                }
                else if (distanceTo(range.getLocation()) > 6){
                    walkTileMM(range.getLocation());
                    return random(500,1000); 
                } else {
                    setCameraRotation(270);
                    useItem(getInventoryItemByID(whatToCook), range);
                    return random(1000,2000);
                }
                
             }
        }
        
        public int walkToBank() {
            setCameraRotation(270);
            if(getMyPlayer().isMoving()) return random(1500,2000);
            if (distanceTo(bankTile) < 10){
                progress++;
                return random(750,1500);
            
            } else    {
                    walkTileMM(bankTile);
                    return random(1000,2000);
                }
        }
    
        public int walkToCookingSpot() {
            if(getMyPlayer().isMoving()) return random(1500,2000);
            if (distanceTo(cookInside) < 8){
            return cook();
            } else
            {
            walkTileMM(cookInside);
            return random(1000,2000);
            }
        } 
        
    public void withdrawAll() {
                    clickMouse(55, 107, 10, 10, false);
                    wait(random(250,500));
                    atMenu("Withdraw-All");
                        wait(random(500,1500));
        }
        
        public boolean waitForAnimation(int timeout) {
            long start = System.currentTimeMillis();
            RSPlayer myPlayer = getMyPlayer();
            int anim = -1;
    
            while(System.currentTimeMillis() - start < timeout) {
                if((anim = myPlayer.getAnimation()) != -1) {
                    return true;
                }
                wait(50); // As to not rape CPU.
            }
            if((anim = myPlayer.getAnimation()) == -1) {
            return false;
            }
            return false;
        }
        
        int antiBan() {
                int p = Math.round(random(1, 11));
                switch (p) {
            case 1:
                wait(random(1000, 1500));
                return( random(500, 750) );
                
            case 2:
                int x = random(0, 750);
                int y = random(0, 500);
                moveMouse(0, 0, x, y);
                return( random(1000, 1500) );
            
            case 3:
                // Is the current tab the inventory?
                if ( getCurrentTab( ) != TAB_INVENTORY ) {
                    // No, so switch to the inventory tab.
                    openTab( TAB_INVENTORY );
                    return( random(500, 750) );
                }
                else {
                    // No, so return
                    return( random(500, 750) );
                }
    
            case 4:
                int x1 = random(0, 750);
                int y1 = random(0, 500);
                moveMouse(0, 0, x1, y1);
                return( random(1000, 1500) );
                
            case 5:
                if ( random(1, 8) == 2  ){
                    int angle = (getCameraAngle( ) + random(-90, 90));
                    if ( angle < 0) angle = 0;
                    if ( angle > 359) angle = 0;
                    
                    setCameraRotation( angle );
                }
                return( random(500, 750) );
                
            case 6:
                int x2 = random(0, 750);
                int y2 = random(0, 500);
                moveMouse(0, 0, x2, y2);
                return( random(1000, 1500) );
                }
                    return (random(500, 700));
        }
        
        public String getScriptDescription() {
            return "<html>\n" +
                    "<head></head>\n" +
                    "<body>\n" +
                        "<center>" +
                            "<h2>" + getName() + "</h2>" +
                        "</center>\n" +
                        "<b>Author:</b> " + getAuthor() + "<br />" +
                        "<b>Version:</b> " + getVersion() + "<br />" +
                        
                        "<b>Features:</b>" +
                        "<ul><li>Banks and cooks fish in Alkharid.</li></ul>" +
                        "<ul><li><b>FISH MUST BE IN FIRST BANK SLOT!</b></li></ul>" +
                        "<ul><li>Ex. for Lobster</li></ul>" +
                        "<ul><li>Fish ID: 377</li></ul>" +
                        
                        
                        "<b>Arguments<b><br />" +
                        "<form>Fish ID:<input type=\"text\" name=\"id\" value=\"\"> " +
                            
                    "</body>\n" +
                    "</html>";
        }
    
    }
    
    
    
    You know how to save them, right?
     
  11. Unread #6 - Jan 3, 2009 at 3:53 PM
  12. +Love+
    Joined:
    Nov 27, 2008
    Posts:
    1,870
    Referrals:
    1
    Sythe Gold:
    0

    +Love+ Guru
    Banned

    What Scripts should i use for this account..?

    use aelins pro fisher for fishing and make it a member do lobster in guild to around 85 fishing once 85 start shark should make a few mil a day :)
     
< Willow Woodcutter Droper | Need decent auto-fighter. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site