Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author waao
- */
- import java.awt.*;
- import java.awt.event.*;
- import java.awt.image.BufferedImage;
- import javax.swing.*;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.lang.reflect.InvocationTargetException;
- import java.util.ArrayList;
- import java.util.LinkedList;
- import javax.swing.SwingUtilities;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Equipment;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSPath;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSTilePath;
- import org.rsbot.script.wrappers.RSWeb;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URL;
- @ScriptManifest(authors = {"waao"}, keywords = {"AIO", "Fighter", "Combat", "waao"}, name = "wFighter", description = "AIO Fighter, by waao",
- version = 1.6, website = "http://www.powerbot.org/community/topic/576777-wfighter-the-five-star-aio-fighter-wfighter/")
- public class wFighter extends Script implements PaintListener, MessageListener, MouseListener{
- ScriptManifest props = getClass().getAnnotation(ScriptManifest.class);
- //Summoning stuff
- private int pouchID;
- private int scrollID;
- private int yakID = 0; //The NPC ID of it
- private int uniID = 0; //The NPC ID of it
- private int unicornID = 12039; // pouch
- private int unicornScrollsID = 12434; //scroll
- private int bunyipID = 12029; //pouch
- private int packYakID = 12093;; //pouch
- private int packYakScrollsID = 12435; //scroll
- private int warTortoiseID = 12031;//pouch
- private int terrorBirdID = 12007;//pouch
- private int snailID = 12019;//pouch
- private int bullAntID = 12087;//pouch
- //loot ID's
- private int StarvedffigyID = 18778;
- private int NourishedeffigyID = 18779;
- private int SatedeffigyID = 18780;
- private int GorgedeffigyID = 18781;
- private int goldCharmID = 12158;
- private int greenCharmID = 12159;
- private int crimsonCharmID = 12160;
- private int blueCharmID = 12163;
- private int[] EasyClueID = {2677, 2678, 2679, 2680, 2681, 2682,2683,2684,2685,2686,2687,2688, 2689, 2690, 2691,2692,2693,2694,2695,
- 2696,2697,2698,2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,};
- private int[] HardClueID = {2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737,
- 2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783,
- 2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799};
- private int[] MediumClueID = {2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819,
- 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2731, 2733, 2735, 2737, 2739, 2741, 2743, 2745, 2747, 2749, 2751, 2753,
- 2755, 2757, 2758};
- private int[] bonesID = {526, 530, 532, 534, 536, 3179, 3181, 3183, 3185, 3186, 4812, 4830, 6729, 6812};
- private int regbonesID = 526;
- private int[] ashID = {592, 1502, 20264, 20266, 20268};
- private int[] rareLootID = {987, 985, 2366, 1249, 1149, 1215, 1615, 1631, 533, 2999, 258, 3001, 270, 454, 450, 2937, 1443, 372, 384, 9342,
- 1392, 574, 570, 452, 2362, 2363, 5315, 5316, 5289, 5304, 1516, 1216, 6686, 20667};
- private int[] yakTeleLootID = {};
- //Food IDs
- private int foodID;
- private final int CrayfishID = 13433;// 1
- private final int AnchoveysID = 319;// 2
- private final int ShrimpID = 315;// 3
- private final int SardineID = 325;// 4
- private final int HerringID = 347;// 5
- private final int MackeralID = 355;// 6
- private final int TroutID = 333;// 7
- private final int CodID = 339;// 8
- private final int PikeID = 351;// 9
- private final int SalmonID = 329;// 10
- private final int TunaID = 361;// 11
- private final int LobsterID = 379;// 12
- private final int BassID = 365;// 13
- private final int SwordfishID = 373;// 14
- private final int MonkfishID = 7946;// 15
- private final int SharkID = 385;// 16
- private final int CavefishID = 15266;// 17
- private final int SeaTurtleID = 397;// 18
- private final int MantaRayID = 391;// 19
- private final int RocktailID = 15272;// 20
- private final int BaronSharkID = 19948;// 21
- private final int summerPie = 7218;
- private final int halfPie = 7220;
- private final int MudPie = 7170;
- private final int GardenPie = 7178;
- private final int AdmiralPie = 7198;
- private final int MeatPie = 2327;
- private final int ApplePie = 2323;
- private final int RedberryPie = 2325;
- private final int wildPie = 7208;
- private final int fishPie = 7188;
- private final int Strawberry = 5504;
- private final int Peach = 6883;
- private final int Lemon = 2102;
- private final int Orange = 2108;
- private final int Papaya = 5972;
- private final int Banana = 1963;
- //Pots stuff
- private int vialID = 229;
- private int attPotion;
- private int attPotion3;
- private int attPotion2;
- private int attPotion1;
- private int strPotion;
- private int strPotion3;
- private int strPotion2;
- private int strPotion1;
- private int defPotion;
- private int rngPotion;
- private int[] summPotID = {12140, 12142, 12144, 12146};
- private int regAttID = 2428;
- private int regAtt3ID = 121;
- private int regAtt2ID = 123;
- private int regAtt1ID = 125;
- private int supAttID = 2436;
- private int supAtt3ID = 145;
- private int supAtt2ID = 147;
- private int supAtt1ID = 149;
- private int extremeAttID = 15308;
- private int extremeAtt3ID = 15309;
- private int extremeAtt2ID = 15310;
- private int extremeAtt1ID = 15311;
- private int regStrID = 113;
- private int regStr3ID = 115;
- private int regStr2ID = 117;
- private int regStr1ID = 119;
- private int supStrID = 2440;
- private int supStr3ID = 157;
- private int supStr2ID = 159;
- private int supStr1ID = 161;
- private int extremeStrID = 15312;
- private int extremeStr3ID = 15313;
- private int extremeStr2ID = 15314;
- private int extremeStr1ID = 15315;
- private int regDefID = 2432;
- private int supDefID = 2442;
- private int extremeDefID = 15316;
- private int regRngID = 2444;
- private int extremeRngID = 15324;
- private int ppotID4 = 2434;
- private int ppotID3 = 139;
- private int ppotID2 = 141;
- private int ppotID1 = 143;
- private int[] prayerPot = {2434, 139, 141, 143};
- private int antiPot4 = 2446;
- private int[] antiPot = {2446, 175, 177, 179};
- // Item ids
- private int[] deadID = {8837, 8838}; //downed creature id able to be mined
- private int[] pickaxeID = {1275, 15259, 1265, 1271, 1273, 1269, 20780, 20781, 20782, 20783, 20784, 20785, 20786};
- private int specID;
- private int excID = 14632;
- private int dClawsID = 14484;
- private int bgsID = 11696;
- private int zgsID = 11700;
- private int sgsID = 11698;
- private int agsID = 11694;
- private int korasiID = 18786;
- private int dds1ID = 1215;
- private int dds2ID = 1231;
- private int dds3ID = 5680;
- private int dds4ID = 5698;
- private wfighterGUI gui;
- private String selectedNPCName;
- private boolean ash;
- private boolean bury;
- private final int rockIDs[] = {1268,1266};
- //Bandits un noting
- RSTile storeTile = new RSTile(3176, 2987);
- private int storeID = 1917;
- boolean unNote;
- //variables
- public int TotalExp;
- public int TotalGP;
- private int hpexpGained = 0;
- private int AttexpGained = 0;
- private int StrexpGained = 0;
- private int RngexpGained = 0;
- private int DefexpGained = 0;
- private int MageexpGained = 0;
- private int attxpHour = 0;
- private int strxpHour = 0;
- private int defxpHour = 0;
- private int rngxpHour = 0;
- private int magexpHour = 0;
- private int hpxpHour = 0;
- private int startHpExp = 0;
- private int startAttExp = 0;
- private int startStrExp = 0;
- private int startDefExp = 0;
- private int startRngExp = 0;
- private int startMageExp = 0;
- private long startTime;
- private String status = "Loading...";
- private boolean exc;
- private boolean hellHounds;
- private boolean b2b;
- private boolean b2p;
- private int b2bID = 8014;
- private int b2pID = 8015;
- private int bananasID = 1963;
- private int peachesID = 6883;
- private int goldCharms;
- private int greenCharms;
- private int crimsonCharms;
- private int blueCharms;
- private int looting;
- private static int weaponID;
- private Long runTime;
- public boolean showOverall = false;
- public boolean showAttack = false;
- public boolean showStr = false;
- public boolean showDef = false;
- public boolean showRng = false;
- public boolean showMage = false;
- public boolean showHP = false;
- private int attExpTNL = 0;
- private int strExpTNL = 0;
- private int defExpTNL = 0;
- private int rngExpTNL = 0;
- private int mageExpTNL = 0;
- private int hpExpTNL = 0;
- private long timeTNL;
- public boolean spec;
- boolean pray;
- private String[] LootNames;
- private int[] LootPrices;
- RSTile randomTile = new RSTile(0000, 0000);
- //Hell hounds bankings stuff
- private int fallyBoothID = 11758;
- private int fTab = 8009;
- private final RSArea hellHoundsArea = new RSArea(new RSTile(2852, 9852), new RSTile(2871, 9815));
- private final RSArea fallyTeleArea = new RSArea(new RSTile(2962, 3385), new RSTile(2969, 3372));
- private final RSArea fallyTeleArea2 = new RSArea(new RSTile(2949, 3384), new RSTile(2956, 3379));
- private final RSArea inShortCut2Area = new RSArea(new RSTile(2936, 3362), new RSTile(2940, 3353));
- private final RSArea outShortCut2Area = new RSArea(new RSTile(2935, 3357), new RSTile(2932, 3353));
- private final RSArea topLadderArea = new RSArea(new RSTile(2882, 3402), new RSTile(2888, 3395));
- private final RSArea bottomLadderArea = new RSArea(new RSTile(2882, 9799), new RSTile(2886, 3396));
- private final RSArea inshortCutArea = new RSArea(new RSTile(2880, 9826), new RSTile(9884, 9811));//
- private final RSArea outshortCutArea = new RSArea(new RSTile(2876, 9814), new RSTile(2878, 9810));
- private final RSArea fallyBankArea = new RSArea(new RSTile(2943, 3373), new RSTile(2949, 3366));
- private static final RSTile[] tilesToBank = {new RSTile(2965, 3380), new RSTile(2962, 3380), new RSTile(2957, 3380),
- new RSTile(2953, 3380), new RSTile(2950, 3377), new RSTile(2947, 3375), new RSTile(2945, 3371)};
- private static final RSTile[] tilesToBank2 = {new RSTile(2950, 3377), new RSTile(2945, 3374), new RSTile(2945, 3370), };
- private static final RSTile[] tilesToinShortCut2 = {new RSTile(2945, 3371), new RSTile(2945, 3375), new RSTile(2941, 3375),
- new RSTile(2941, 3371), new RSTile(2940, 3368), new RSTile(2940, 3363), new RSTile(2938, 3359), new RSTile(2936, 3355)};
- RSTilePath pathToBank;
- RSTilePath pathToBank2;
- RSTilePath pathToinShortCut2;
- private int topLadder = 55404;
- private int bottomLadder = 32015;
- private int shortCut2 = 11844;
- private int shortCut = 9294;
- RSTile fallyBankTile = new RSTile(2946, 3369);
- RSTile hellHoundsTile = new RSTile(2870, 9833);
- RSTile shortCutTile = new RSTile(2881, 9813);
- RSTile inShortCut2Tile = new RSTile(2936, 3355);
- RSTile outShortCut2Tile = new RSTile(2934, 3355);
- RSTile topLadderTile = new RSTile(2884, 3400);
- private Curpaint SHOWING_TAB = Curpaint.button1BOX;
- private final Rectangle button1 = new Rectangle(401, 357, 99, 24);//overall
- private final Rectangle button2 = new Rectangle(24, 355, 76, 16);//attack
- private final Rectangle button3 = new Rectangle(23, 372, 77, 16);//str
- private final Rectangle button4 = new Rectangle(24, 390, 78, 19);//def
- private final Rectangle button5 = new Rectangle(24, 406, 77, 18);//Rng
- private final Rectangle button6 = new Rectangle(24, 443, 78, 17);//hp
- private final Rectangle button7 = new Rectangle(24, 424, 76, 19);//mage
- private enum Curpaint {
- button1BOX, button2BOX, button3BOX, button4BOX, button5BOX, button6BOX, button7BOX
- };
- BufferedImage normal = null;
- BufferedImage clicked = null;
- private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
- @SuppressWarnings("serial")
- private class MousePathPoint extends Point {
- private long finishTime;
- private double lastingTime;
- private int toColor(double d) {
- return Math.min(255, Math.max(0, (int) d));
- }
- public MousePathPoint(int x, int y, int lastingTime) {
- super(x, y);
- this.lastingTime = lastingTime;
- finishTime = System.currentTimeMillis() + lastingTime;
- }
- public boolean isUp() {
- return System.currentTimeMillis() > finishTime;
- }
- public Color getColor() {
- return new Color(200, 0, 0, toColor(256 * ((finishTime - System
- .currentTimeMillis()) / lastingTime)));
- }
- }
- @Override
- public boolean onStart() {
- startAttExp = skills.getCurrentExp(Skills.ATTACK);
- startStrExp = skills.getCurrentExp(Skills.STRENGTH);
- startDefExp = skills.getCurrentExp(Skills.DEFENSE);
- startRngExp = skills.getCurrentExp(Skills.RANGE);
- startMageExp = skills.getCurrentExp(Skills.MAGIC);
- startHpExp = skills.getCurrentExp(Skills.CONSTITUTION);
- try {
- final URL cursorURL = new URL(
- "http://i.imgur.com/w7HhD.png"); // This is the link of your mouse when it isn't clicked
- final URL cursor80URL = new URL(
- "http://i.imgur.com/w7HhD.png"); // This is the link of your mouse when it is clicked
- normal = ImageIO.read(cursorURL);
- clicked = ImageIO.read(cursor80URL);
- } catch (MalformedURLException e) {
- log("Unable to buffer cursor.");
- } catch (IOException e) {
- log("Unable to open cursor image.");
- }
- startTime = System.currentTimeMillis();
- weaponID = equipment.getItem(Equipment.WEAPON).getID();
- status = "Staring up";
- log(Color.GREEN,"Welcome to wFighter, a AIO fighter by waao");
- if (SwingUtilities.isEventDispatchThread()) {
- gui = new wfighterGUI();
- gui.setVisible(true);
- } else {
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- gui = new wfighterGUI();
- gui.setVisible(true);
- }
- });
- } catch (final InvocationTargetException ex) {
- } catch (final InterruptedException ex2) {
- }
- }
- while(gui.isVisible()) {
- sleep(random(50,2000));
- }
- return true;
- }
- public boolean atDoor() {
- RSObject door = objects.getNearest(1528);
- return door != null && door.isOnScreen();
- }
- public int loop() {
- String returnText = interfaces.get(906)
- .getComponent(221)
- .getText().toLowerCase();
- if (!game.isLoggedIn() || game.isWelcomeScreen() || ( returnText != null && returnText.equals("Logging In - Please Wait")))
- {
- sleep(1000,1500);
- return random(6000,7000);
- }
- mouse.setSpeed(random(7, 9));
- //npc's
- final RSNPC npc = npcs.getNearest(selectedNPCName);
- RSNPC rock = npcs.getNearest(rockIDs);
- RSNPC o = npcs.getNearest(storeID);
- //Ground item's
- RSGroundItem loot = groundItems.getNearest(LootNames);
- //Object's
- RSObject door = objects.getNearest(1528);
- RSObject sc2 = objects.getNearest(shortCut2);
- if(interfaces.canContinue()) {
- interfaces.clickContinue();
- }
- //clean invo
- if(inventory.contains(vialID)) {
- inventory.dropItem(vialID);
- }
- //turns on run
- setRun();
- //mines living rock creatures
- mine();
- //checboxes
- if(bury == true) {
- boneloot();
- sleep(random(600, 800));
- bones(); //bones = burry
- }
- if(pray == true) {
- prayerPot();
- if(!prayer.isQuickPrayerOn()) {
- if(hellHounds == false) {
- status = "Turning quick prayer ON";
- prayer.setQuickPrayer(true);
- }else {
- if(hellHounds == true) {
- if(hellHoundsArea.contains(getMyPlayer().getLocation())) {
- status = "Turning quick prayer ON";
- prayer.setQuickPrayer(true);
- }else {
- prayer.setQuickPrayer(false);
- }
- }
- }
- }
- }
- if(unNote == true) {
- if(!inventory.contains(foodID) && !inventory.contains(halfPie) && getMyPlayer().getHPPercent() < 60) {
- if(atDoor()) {
- door.interact("Open");
- sleep(random(400, 800));
- }
- if(o != null) {
- if(o.isOnScreen()) {
- if (store.isOpen()) {
- RSItem foods = store.getItem(foodID);
- if (foods != null) {
- store.buy(foodID, 10);
- sleep(random(400, 800));
- }else {
- int notedFoodID = foodID + 1;
- inventory.getItem(notedFoodID).interact("Sell 10");
- sleep(random(400, 800));
- }
- }else {
- o.interact("Trade");
- sleep(random(400, 800));
- }
- } else {
- walkStore();
- }
- }
- }
- }
- if(ash == true) {
- ashloot();
- sleep(random(600, 800));
- scatter();
- }
- if(exc == true) {
- excSpec();
- rewield();
- }
- if(b2b == true) {
- dob2b();
- }
- if(b2p == true) {
- dob2p();
- }
- if(hellHounds == true) {
- RSObject fallyBooth = objects.getNearest(fallyBoothID);
- if(!inventory.contains(foodID) || !inventory.containsOneOf(prayerPot)) {
- if(hellHoundsArea.contains(getMyPlayer().getLocation())) {
- fTele();
- sleep(random(600, 1000));
- }else if(fallyTeleArea.contains(getMyPlayer().getLocation())) {
- status = "Walking to bank";
- RSPath pathToBank = walking.newTilePath(tilesToBank);
- pathToBank.traverse();
- sleep(random(1000, 1500));
- }else if(fallyTeleArea2.contains(getMyPlayer().getLocation())) {
- status = "Walking to bank";
- RSPath pathToBank2 = walking.newTilePath(tilesToBank2);
- pathToBank2.traverse();
- sleep(random(1000, 1500));
- }else if(fallyBooth != null && fallyBooth.isOnScreen()) {
- doBank();
- sleep(random(600, 1000));
- }
- }
- if(inventory.contains(foodID) || inventory.contains(halfPie)) {
- if(fallyBankArea.contains(getMyPlayer().getLocation())) {
- status = "Walking to short cut";
- RSPath pathToinShortCut2 = walking.newTilePath(tilesToinShortCut2);
- pathToinShortCut2.traverse();
- }else if(inShortCut2Area.contains(getMyPlayer().getLocation())) {
- camera.turnTo(sc2);
- doShortCut2();
- }else if(outShortCut2Area.contains(getMyPlayer().getLocation())) {
- walkTopLadder();
- } else if(topLadderArea.contains(getMyPlayer().getLocation())) {
- doTopLadder();
- } else if(bottomLadderArea.contains(getMyPlayer().getLocation())) {
- walkShortCut();
- } else if(inshortCutArea.contains(getMyPlayer().getLocation())) {
- doPie();
- sleep(random(1000, 2000));
- doFloor();
- sleep(random(1500, 3000));
- } else if(outshortCutArea.contains(getMyPlayer().getLocation())) {
- walkHellHounds();
- }
- }
- }
- //auto retaliate
- retaliate();
- //pots
- attPot();
- strPot();
- defPot();
- rngPot();
- summPot();
- antiPot();
- //loot
- loot();
- lootGoldCharms();
- lootGreenCharms();
- lootCrimsonCharms();
- lootBlueCharms();
- lootGorgedEffigy();
- lootNourishedEffigy();
- lootStatedEffigy();
- lootStarvedEffigy();
- lootRare();
- AllClues();
- EasyClues();
- MedClues();
- HardClues();
- //summoning
- summonBunyip();
- summonUnicorn();
- summonPackYak();
- summonTort();
- summonTerrorBird();
- summonSnail();
- summonAnt();
- //unicornScroll();
- //yakScroll();
- //eating and healing
- eat();
- if(selectedNPCName == "Rock crab" && rock != null && npc != null && npc.isInCombat() && !getMyPlayer().isInCombat()) {
- status = "Walking to rock to find a crab";
- walking.walkTileMM(rock.getLocation());
- sleep(random(600, 1000));
- }
- if(!getMyPlayer().isInCombat()) {
- if(npc != null && !npc.isInCombat()){
- if(getMyPlayer().getHPPercent() > 65) {
- if(loot == null || calc.distanceTo(loot.getLocation()) > 10) {
- if(npc.isOnScreen() && calc.distanceTo(npc.getLocation()) < 7){
- npc.interact("Attack");
- status = "Attacking " + selectedNPCName;
- } else {
- if(!inshortCutArea.contains(getMyPlayer().getLocation())) {
- status = "Walking to: " + selectedNPCName;
- walking.walkTileMM(npc.getLocation());
- }
- camera.turnTo(npc);
- while(getMyPlayer().isMoving())
- sleep(random(300,600));
- }
- }
- }
- }
- }
- if(getMyPlayer().isInCombat()) {
- // if(spec == true) {
- // Spec();
- // sleep(random(600, 800));
- // rewield();
- // }
- //rewield();
- status = "Fighting";
- if(random(1, 15) == 10) {
- antiBan();
- }
- }
- if(!inventory.contains(foodID) && getMyPlayer().getHPPercent() < 40 && hellHounds == false) {
- walkRandom();
- sleep(random(600, 1000));
- env.saveScreenshot(true);
- sleep(random(600, 1000));
- stopScript(true);
- }
- return random(500, 1500);
- }
- //------------------------------------------METHODS-------------------------------------------------------------------
- ///////Hell houdns banking stuff/////
- private void fTele() {
- if(inventory.contains(fTab)) {
- status = "Teleporing to falador";
- RSItem f = inventory.getItem(fTab);
- f.interact("Break");
- sleep(random(1000, 2000));
- }
- }
- private void walkFallyBank() {
- status = "Walking to bank";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), fallyBankTile);
- while (calc.distanceTo(fallyBankTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void walkinShortCut2() {
- status = "Walking to short cut";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), inShortCut2Tile);
- while (calc.distanceTo(inShortCut2Tile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void walkTopLadder() {
- status = "Walking to taverly dungeon";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), topLadderTile);
- while (calc.distanceTo(topLadderTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void walkShortCut() {
- status = "Walking to short cut";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), shortCutTile);
- while (calc.distanceTo(shortCutTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void walkHellHounds() {
- status = "Walking to hell hounds";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), hellHoundsTile);
- while (calc.distanceTo(hellHoundsTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void doShortCut2() {
- RSObject w = objects.getNearest(shortCut2);
- if(w != null && w.isOnScreen()) {
- status = "Climbing-over wall";
- w.interact("Climb-over");
- sleep(200, 800);
- }
- }
- private void doTopLadder() {
- RSObject l = objects.getNearest(topLadder);
- if(l != null && l.isOnScreen()) {
- status = "Climbing into dungeon";
- l.interact("Climb-down");
- sleep(200, 800);
- }
- }
- private void doFloor() {
- RSObject f = objects.getNearest(shortCut);
- if(f != null && f.isOnScreen()) {
- status = "Jumping over wall";
- f.interact("Jump-over");
- sleep(200, 800);
- }
- }
- private void doPie() {
- if(skills.getCurrentLevel(Skills.AGILITY) <= skills.getRealLevel(Skills.AGILITY)) {
- status = "Eating summer pie";
- if(inventory.contains(summerPie)) {
- RSItem pie = inventory.getItem(summerPie);
- pie.interact("Eat");
- sleep(random(600, 1000));
- }
- }
- }
- private void doBank() {
- RSObject booth = objects.getNearest(fallyBoothID);
- camera.turnTo(booth);
- if (bank.isOpen()) {
- status = "Depositing";
- bank.depositAllExcept(fTab, attPotion, strPotion, defPotion, foodID, ppotID4);
- sleep(200, 300);
- status = "Withdrawing items";
- if(pray == false) {
- bank.withdraw(foodID, 20);
- bank.withdraw(antiPot4, 1);
- }
- if(pray == true) {
- bank.withdraw(ppotID4, 20);
- bank.withdraw(foodID, 1);
- bank.withdraw(antiPot4, 1);
- sleep(random(400, 600));
- }
- sleep(random(400, 600));
- bank.close();
- }
- else {
- status = "Opening bank";
- bank.open();
- sleep(random(200, 400));
- }
- }
- ////////////////////////////////////////
- //-----------------------------------------MISC----------------------------------------------------------------------
- private void bones() {
- if(inventory.containsOneOf(bonesID)) {
- final RSItem bones = inventory.getItem(bonesID);
- bones.interact("Bury");
- status = "Bury bones";
- }return;
- }
- private void scatter() {
- if(inventory.containsOneOf(ashID)) {
- final RSItem a = inventory.getItem(ashID);
- a.interact("Scatter");
- status = "Scattering ashes";
- }
- return;
- }
- private void dob2b() {
- if(!inventory.contains(bananasID) && inventory.contains(b2bID) && inventory.contains(regbonesID)) {
- final RSItem b = inventory.getItem(b2bID);
- b.interact("Break");
- status = "Breaking Bones to bananas tab";
- sleep(random(1000, 1500));
- }return;
- }
- private void dob2p() {
- if(!inventory.contains(peachesID) && inventory.contains(b2pID) && inventory.contains(regbonesID)) {
- final RSItem p = inventory.getItem(b2pID);
- p.interact("Break");
- status = "Breaking Bones to peaches tab";
- sleep(random(1000, 1500));
- }return;
- }
- //EATS
- private void eat() {
- if(inventory.contains(foodID)) {
- if (combat.getHealth() <= 70) {
- RSItem food = inventory.getItem(foodID);
- food.interact("Eat");
- status = "Healing";
- log("Low on HP eating");
- }
- }
- }
- //-------------------------------------------------POTIONS----------------------------------------------------------
- private void att4() {
- if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK)) {
- if (inventory.containsOneOf(attPotion)) {
- RSItem apot = inventory.getItem(attPotion);
- if (inventory.containsOneOf(attPotion)) {
- status = "Drinking attack Pot";
- apot.interact("Drink");
- } }
- }
- }
- private void att3() {
- if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK)) {
- if (inventory.containsOneOf(attPotion3)) {
- RSItem apot3 = inventory.getItem(attPotion3);
- if (inventory.containsOneOf(attPotion)) {
- status = "Drinking attack Pot";
- apot3.interact("Drink");
- } }
- }
- }
- //Attack potion method
- private void attPot() {
- if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion)) {
- RSItem att = inventory.getItem(attPotion);
- att.interact("Drink");
- status = "Drinking Potions";
- }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) &&
- inventory.contains(attPotion3)) {
- RSItem att3 = inventory.getItem(attPotion3);
- att3.interact("Drink");
- status = "Drinking Potions";
- }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion2)) {
- RSItem att2 = inventory.getItem(attPotion2);
- att2.interact("Drink");
- status = "Drinking Potions";
- }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion1)) {
- RSItem att1 = inventory.getItem(attPotion1);
- att1.interact("Drink");
- status = "Drinking Potions";
- }
- return;
- }
- //Strength potion method
- private void strPot() {
- if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion)) {
- RSItem strPot = inventory.getItem(strPotion);
- strPot.interact("Drink");
- status = "Drinking Potions";
- sleep(random(200, 400));
- }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH)&&
- inventory.contains(strPotion3)) {
- RSItem str3 = inventory.getItem(strPotion3);
- str3.interact("Drink");
- status = "Drinking Potions";
- }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion2)) {
- RSItem str2 = inventory.getItem(strPotion2);
- str2.interact("Drink");
- status = "Drinking Potions";
- }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion1)) {
- RSItem str1 = inventory.getItem(strPotion1);
- str1.interact("Drink");
- status = "Drinking Potions";
- }
- return;
- }
- //Defence potion method
- private void defPot() {
- if(skills.getCurrentLevel(Skills.DEFENSE) <= skills.getRealLevel(Skills.DEFENSE)&& inventory.contains(defPotion)) {
- RSItem defPot = inventory.getItem(defPotion);
- defPot.interact("Drink");
- status = "Drinking Potions";
- sleep(random(200, 400));
- }return;
- }
- //Ranging potion method
- private void rngPot() {
- if(skills.getCurrentLevel(Skills.RANGE) <= skills.getRealLevel(Skills.RANGE)&& inventory.contains(rngPotion)) {
- RSItem rngPot = inventory.getItem(rngPotion);
- rngPot.interact("Drink");
- status = "Drinking Potions";
- sleep(random(200, 400));
- }return;
- }
- //Summonng potion method
- private void summPot() {
- if(summoning.getSummoningPoints() < 10 && inventory.contains(pouchID)) {
- RSItem summPot = inventory.getItem(summPotID);
- summPot.interact("Drink");
- status = "Drinking summoing potion";
- sleep(random(200, 400));
- }return;
- }
- private void prayerPot() {
- if(prayer.getPrayerLeft() < 30) {
- if (inventory.containsOneOf(prayerPot)) {
- RSItem ppot = inventory.getItem(prayerPot);
- if (inventory.containsOneOf(prayerPot)) {
- status = "Drinking Prayer potion";
- ppot.interact("Drink");
- }
- }}}
- private void pPot() {
- if(prayer.getPrayerLeft() < 30) {
- if(inventory.contains(ppotID4)
- ) {
- RSItem p4 = inventory.getItem(ppotID4);
- p4.interact("Drink");
- }else if(inventory.contains(ppotID3)
- ) {
- RSItem p3 = inventory.getItem(ppotID3);
- p3.interact("Drink");
- }else if(inventory.contains(ppotID2)) {
- RSItem p2 = inventory.getItem(ppotID2);
- p2.interact("Drink");
- }else if(inventory.contains(ppotID1)) {
- RSItem p1 = inventory.getItem(ppotID1);
- p1.interact("Drink");
- }
- }
- }
- private void antiPot() {
- if(combat.isPoisoned()) {
- if (inventory.containsOneOf(antiPot)) {
- RSItem a = inventory.getItem(antiPot);
- if (inventory.containsOneOf(antiPot)) {
- status = "Drinking anti poision";
- a.interact("Drink");
- }
- }}}
- //
- //----------------------------------------------------END POTION METHODS-----------------------------------------------
- //
- //
- //-----------------------------------------------------SUMMONING METHODS----------------------------------------------
- //
- //uses unicorn special attack if low hp and high enough summ lvl and famil is out and enough spec
- private void unicornScroll() {
- RSNPC u = npcs.getNearest(uniID);
- if(getMyPlayer().getHPPercent() < 75 && summoning.isFamiliarSummoned() && u.isOnScreen() &&
- inventory.getCount(unicornScrollsID) >= 1) { //BROKEN need to know how to check current famil spec attck
- // summoning.doCast();
- status = "Casting, Healing aura";
- }return;
- }
- //Teleports loot to bank with yak
- private void yakScroll() {
- RSNPC yak = npcs.getNearest(yakID);
- if(inventory.isFull() && summoning.isFamiliarSummoned() && yak.isOnScreen() &&
- inventory.getCount(packYakScrollsID) >= 1) { //BROKEN need to know how to check current famil spec attck
- RSItem L = inventory.getItem(yakTeleLootID);
- summoning.doCast();
- L.interact("Use");
- yak.interact("Use"); //need to change this
- status = "Casting, Winter Storage";
- }
- }
- //summons unicorn
- private void summonUnicorn() {
- if (inventory.containsOneOf(unicornID)) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 69) {
- RSItem lobster = inventory.getItem(unicornID);
- lobster.interact("Summon");
- log("Summoned a Unicorn Stallion.");
- status = "Summoning unicorn stallion";
- }
- }
- return;
- }
- //summons bunyip
- private void summonBunyip() {
- if (inventory.containsOneOf(bunyipID)) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 69) {
- RSItem lobster = inventory.getItem(bunyipID);
- lobster.interact("Summon");
- log("Summoned a Bunyip.");
- status = "Summoning Bunyip";
- }
- }
- return;
- }
- //summons Pack yak
- private void summonPackYak() {
- if (inventory.getCount(packYakID) >= 1) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 96) {
- RSItem y = inventory.getItem(bunyipID);
- y.interact("Summon");
- log("Summoned a Pack Yak.");
- status = "Summoning Pack yak";
- }
- }
- return;
- }
- //summons war tortoise
- private void summonTort() {
- if (inventory.getCount(warTortoiseID) >= 1) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 67) {
- RSItem w = inventory.getItem(warTortoiseID);
- w.interact("Summon");
- log("Summoned a War Tortoise.");
- status = "Summoning war tortoise";
- }
- }
- return;
- }
- //summons snail
- private void summonSnail() {
- if (inventory.containsOneOf(snailID)) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 3) {
- RSItem a = inventory.getItem(snailID);
- a.interact("Summon");
- log("Summoned a Snail.");
- status = "Summoning snail";
- }
- }
- return;
- }
- //summons terror bird
- private void summonTerrorBird() {
- if (inventory.containsOneOf(terrorBirdID)) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 40) {
- RSItem t = inventory.getItem(terrorBirdID);
- t.interact("Summon");
- log("Summoned a Terror bird.");
- status = "Summoning Terror brid";
- }
- }
- return;
- }
- //summons bull ant
- private void summonAnt() {
- if (inventory.containsOneOf(bullAntID)) {
- if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 40) {
- RSItem t = inventory.getItem(bullAntID);
- t.interact("Summon");
- log("Summoned a Bull Ant.");
- status = "Summoning Bull Ant";
- }
- }
- return;
- }
- //
- //--------------------------------------------END OF SUMMONING METHODS-------------------------------------------
- //
- //
- //---------------------------------SPECIAL ATTACKS-----------------------------------------------
- //
- //uses enchanted excalibur to heal if its in equipment or equipts ifd needed
- private void excSpec() {
- if(equipment.containsOneOf(excID)) {
- if (getMyPlayer().getHPPercent() < 50 && combat.getSpecialBarEnergy() >= 100) {
- combat.setSpecialAttack(true);
- }//wLRCOFFICIAL BY WAAO
- }else{
- if(getMyPlayer().getHPPercent() < 50 && combat.getSpecialBarEnergy() >= 100 &&
- !equipment.containsOneOf(excID) && inventory.containsOneOf(excID)) {
- RSItem exc = inventory.getItem(excID);
- exc.interact("Wield");
- sleep(200, 400);
- status = "Healing with excalibur";
- }
- }
- return;
- }
- private void Spec() {
- RSItem spec = inventory.getItem(specID);
- if(combat.getSpecialBarEnergy() >= 60) {
- if(spec != null && equipment.containsOneOf(specID)) {
- combat.setSpecialAttack(true);
- }else{
- spec.interact("Wield");
- }
- }
- }
- private void rewield() {
- RSItem wep = inventory.getItem(weaponID);
- if(!equipment.containsOneOf(weaponID)) {
- if(combat.getSpecialBarEnergy() < 60) {
- if(inventory.contains(weaponID)) {
- status = "Re-wielding primary weapon";
- wep.interact("Wield");
- sleep(random(200, 600));
- }
- }
- }
- }
- //
- //---------------------------------END SPECIAL ATTACKS-----------------------------------------------
- //
- //
- //LOOTING METHODS
- //
- private int getPrice(final String lootName){
- for(int i = 0; i < LootNames.length; i++){
- if(LootNames[i].equals(lootName))
- return LootPrices[i];
- }
- return -1;
- }
- private void loot() {
- RSGroundItem loot = groundItems.getNearest(LootNames);
- if (loot != null) {
- if (!inventory.isFull()) {
- if (loot.isOnScreen()) {
- loot.interact("Take " + loot.getItem().getName());
- status = "Looting";
- sleep(random(3000, 600));
- } else {
- walking.walkTileMM(loot.getLocation());
- status = "Walking to loot";
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID)) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }
- }return;
- }
- private void lootRare() {
- RSGroundItem loot = groundItems.getNearest(rareLootID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootStarvedEffigy() {
- RSGroundItem loot = groundItems.getNearest(StarvedffigyID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootNourishedEffigy() {
- RSGroundItem loot = groundItems.getNearest(NourishedeffigyID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootStatedEffigy() {
- RSGroundItem loot = groundItems.getNearest(SatedeffigyID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootGorgedEffigy() {
- RSGroundItem loot = groundItems.getNearest(GorgedeffigyID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootGoldCharms() {
- RSGroundItem loot = groundItems.getNearest(goldCharmID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take Gold Charm");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootGreenCharms() {
- RSGroundItem loot = groundItems.getNearest(greenCharmID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take Green Charm");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootCrimsonCharms() {
- RSGroundItem loot = groundItems.getNearest(crimsonCharmID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take Crimson Charm");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootBlueCharms() {
- RSGroundItem loot = groundItems.getNearest(blueCharmID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take Blue Charm");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void EasyClues() {
- String NAME = "Clue scroll (easy)";//The exact name
- RSGroundItem g = groundItems.getNearest(NAME);
- if(g != null){
- g.interact("Take " + g.getItem().getName());
- }
- }
- private void MedClues() {
- String NAME = "Clue scroll (medium)";//The exact name
- RSGroundItem g = groundItems.getNearest(NAME);
- if(g != null){
- g.interact("Take " + g.getItem().getName());
- }
- }
- private void HardClues() {
- String NAME = "Clue scroll (hard)";//The exact name
- RSGroundItem g = groundItems.getNearest(NAME);
- if(g != null){
- g.interact("Take " + g.getItem().getName());
- }
- }
- private void AllClues() {
- String NAME = "Clue scroll ";//The exact name
- RSGroundItem g = groundItems.getNearest(NAME);
- if(g != null){
- g.interact("Take " + g.getItem().getName());
- }
- }
- private void lootEasyClue() {
- RSGroundItem loot = groundItems.getNearest(EasyClueID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootMediumClue() {
- RSGroundItem loot = groundItems.getNearest(MediumClueID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- private void lootHardClue() {
- RSGroundItem loot = groundItems.getNearest(HardClueID);
- if (!inventory.isFull()) {
- if (loot != null) {
- if (loot.isOnScreen()) {
- loot.interact("Take");
- status = "Looting";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(loot.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to loot";
- }
- }
- }else {
- if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
- RSItem f = inventory.getItem(foodID);
- f.interact("Eat");
- status = "Eating for loot space";
- }
- }return;
- }
- //loots bones
- private void boneloot() {
- RSGroundItem b = groundItems.getNearest(bonesID);
- if (!inventory.isFull()) {
- if (b != null) {
- if(calc.distanceTo(b.getLocation()) < 8) {
- if (b.isOnScreen()) {
- b.interact("Take " + b.getItem().getName());
- sleep(1000, 1200);
- status = "Looting bones";
- } else {
- walking.walkTileMM(b.getLocation(), 2, 2);
- sleep(800, 1000);
- status = "Walking to bones";
- }
- }
- }
- }
- }
- //loots ashes
- private void ashloot() {
- RSGroundItem a = groundItems.getNearest(ashID);
- if (!inventory.isFull()) {
- if(calc.distanceTo(a.getLocation()) < 8) {
- if (a != null) {
- if (a.isOnScreen()) {
- a.interact("Take");
- status = "Looting ashes";
- sleep(1000, 1200);
- } else {
- walking.walkTileMM(a.getLocation(), 1, 1);
- status = "Walking to ashes";
- sleep(800, 1000);
- }
- }
- }}
- }
- //
- //END LOOTING METHODS
- //
- //turns on run
- public void setRun() {
- if(walking.getEnergy() > 40 && !walking.isRunEnabled())
- {
- status = "Turning run ON";
- walking.setRun(true);
- }
- }
- private void mine() {
- RSNPC rock = npcs.getNearest(deadID);
- if (rock != null) {
- if(rock.isOnScreen()) {
- if (inventory.containsOneOf(pickaxeID)) {
- rock.interact("Mine");
- status = "Mining dead rock creature";
- sleep(200, 400);
- }
- }
- }
- }
- private void retaliate() {
- if(combat.isAutoRetaliateEnabled() == false) {
- status = "You need auto retaliate ON";
- log(Color.red,"Please start with auto retaliate enabled");
- stopScript(true);
- }
- return;
- }
- private void walkRandom() {
- status = "Walking random";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), randomTile);
- while (calc.distanceTo(randomTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- private void walkStore() {
- status = "Walking to store";
- final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), storeTile);
- while (calc.distanceTo(storeTile) > 4) {
- walkWeb.step();
- sleep(200, 800);
- }
- }
- // Credits to float for getClosestNPCs method and related
- private int[] LootAmount;
- private int getTotalLootCount(){
- int count = 0;
- for(int i = 0; i < LootNames.length; i++) {
- count += LootPrices[i] * LootAmount[i];
- }
- return count;
- }
- private int getTotalPriceCount(){
- int count = 0;
- for(int i = 0; i < LootNames.length; i++) {
- count += LootPrices[i];
- }
- return count;
- }
- private RSNPC[] getClosestNPCs() {
- final ArrayList<RSNPC> array = new ArrayList<RSNPC>();
- final RSNPC[] allNPC = npcs.getAll(new Filter<RSNPC>() {
- @Override
- public boolean accept(final RSNPC npc) {
- return npc != null && npc.getLevel() > 0;
- }
- }); int k = 0;
- tag: for (int emtF = k; emtF < allNPC.length; emtF++) {
- for(int i = 0; i < array.size(); i++){
- if(array.get(i).getName().equals(allNPC[emtF].getName())){
- k++;
- continue tag;
- }
- }
- array.add(allNPC[emtF]);
- }
- final RSNPC[] npcList = new RSNPC[array.size()];
- for (int i = 0; i < array.size(); i++) {
- npcList[i] = array.get(i);
- }
- return npcList;
- }
- private String[] getItems(){
- final ArrayList<String> array = new ArrayList<String>();
- for(final RSItem invItem : inventory.getItems(true)){
- if(invItem != null && invItem.getID() != -1
- && !array.contains(invItem.getName())){
- array.add(invItem.getName());
- }
- }
- for(final RSGroundItem gItem : groundItems.getAll()){
- if(gItem != null && gItem.getItem().getID() != -1
- && !array.contains(gItem.getItem().getName())){
- array.add(gItem.getItem().getName());
- }
- }
- return array.toArray(new String[array.size()]);
- }
- @Override
- public void onFinish() {
- status = "Taking screen shot";
- env.saveScreenshot(true);
- status = "Shutting down";
- log("If you belive the bot shut down because of a bug please report.");
- log(Color.RED,"wFighter stopped.");
- log(Color.GREEN,"Thanks for using wFighter!");
- }
- private void antiBan() {
- int r = random(0, 15);
- switch (r) {
- case 3:
- mouse.move(120, 0);
- log(Color.ORANGE,"Antiban activated, mouse moves accross screen.");
- sleep(random(500, 800));
- break;
- case 4:
- camera.setPitch(random(360, 0));
- sleep(random(450, 650));
- log(Color.ORANGE,"Antiban activated, camera sets random angle.");
- break;
- case 5:
- camera.setPitch(random(0, 280));
- sleep(random(450, 650));
- log(Color.ORANGE,"Antiban activated, camera sets random angle.");
- break;
- case 7:
- mouse.moveSlightly();
- log(Color.ORANGE,"Antiban activated, mouse moves randomly.");
- break;
- case 11:
- mouse.moveOffScreen();
- log(Color.ORANGE,"Antiban activated, mouse moves off screen.");
- break;
- case 16:
- camera.setPitch(random(0, 360));
- sleep(random(450, 650));
- log(Color.ORANGE,"Antiban activated, camera sets random angle.");
- break;
- case 17:
- mouse.move(60, 260);
- log(Color.ORANGE,"Antiban activated, mouse randomly.");
- sleep(random(500, 800));
- break;
- case 18:
- mouse.moveRandomly(0, 360);
- log(Color.ORANGE,"Antiban activated, mouse randomly.");
- sleep(random(500, 800));
- break;
- }
- }
- public final void messageReceived(final MessageEvent e) {
- final String msg = e.getMessage();
- if (msg.contains("advanced a")) {
- log(Color.GREEN,"Congratulations you advanced a level with wFighter!");
- } if (msg.contains("the next Runescape")) {
- log(Color.RED,"System update, Running away and loggin out to prevent death.");
- walkRandom();
- stopScript(true);
- }
- if (msg.contains("Your resistance to dragon fire has run out.")){
- log(Color.RED,"Drinking antifire");
- if (inventory.getItemID("Super antifire")!=-1)
- inventory.getItem(inventory.getItemID("Super antifire")).doClick(true);
- }
- }
- @SuppressWarnings("serial")
- public class wfighterGUI extends JFrame {
- private static final long serialVersionUID = 1L;
- private final ArrayList<String> currentSelected = new ArrayList<String>();
- public wfighterGUI() {
- initComponents();
- }
- private void checkBox6ActionPerformed(ActionEvent e) {
- }
- private void checkBox4ActionPerformed(ActionEvent e) {
- }
- private void StartActionPerformed(ActionEvent e) {
- LootNames = new String[currentSelected.size()];
- LootPrices = new int[currentSelected.size()];
- for (int i = 0; i < currentSelected.size(); i++) {
- LootNames[i] = currentSelected.get(i).split(" : ")[0];
- LootPrices[i] = Integer.parseInt(currentSelected.get(i)
- .replace("GP", "").split(" : ")[1]);
- }
- for (int i = 0; i < currentSelected.size(); i++) {
- log("Item: " + currentSelected.get(i).split(" : ")[0]
- + ", Price: " + currentSelected.get(i).split(" : ")[1]);
- }
- LootAmount = new int[LootNames.length];
- for(int i = 0; i < LootAmount.length; i++)
- LootAmount[i] = 0;
- //checkboxes
- if(checkBox9.isSelected()) {
- hellHounds = true;
- }else {
- hellHounds = false;
- }
- if(prayer.isSelected()) {
- pray = true;
- }else {
- pray = false;
- }
- if(note.isSelected()) {
- }else {
- unNote = false;
- }
- if(checkBox6.isSelected()) {
- bury = true;
- }else{
- bury = false;
- }
- if(checkBox5.isSelected()) {
- ash = true;
- }else{
- ash = false;
- }
- if(checkBox4.isSelected()) {
- exc = true;
- }else{
- exc = false;
- }
- if(checkBox2.isSelected()) {
- b2p = true;
- }else{
- b2p = false;
- }
- if(checkBox3.isSelected()) {
- b2b = true;
- }else{
- b2b = false;
- }
- //FOOD
- final String chosenFood = comboBox1.getSelectedItem().toString();
- if (chosenFood.equals("Summer Pie")) {
- foodID = summerPie;
- } else if (chosenFood.equals("Mud Pie")) {
- foodID = MudPie;
- } else if (chosenFood.equals("Redberry Pie")) {
- foodID = RedberryPie;
- } else if (chosenFood.equals("Admiral Pie")) {
- foodID = AdmiralPie;
- } else if (chosenFood.equals("Meat Pie")) {
- foodID = MeatPie;
- } else if (chosenFood.equals("Apple Pie")) {
- foodID = ApplePie;
- } else if (chosenFood.equals("Fish Pie")) {
- foodID = fishPie;
- } else if (chosenFood.equals("Garden Pie")) {
- foodID = GardenPie;
- } else if (chosenFood.equals("Strawberry")) {
- foodID = Strawberry;
- } else if (chosenFood.equals("Peaches")) {
- foodID = Peach;
- } else if (chosenFood.equals("Banana")) {
- foodID = Banana;
- } else if (chosenFood.equals("Papaya")) {
- foodID = Papaya;
- } else if (chosenFood.equals("Lemon")) {
- foodID = Lemon;
- } else if (chosenFood.equals("Orange")) {
- foodID = Orange;
- }
- if (chosenFood.equals("Anchoveys")) {
- foodID = AnchoveysID;
- } else if (chosenFood.equals("Shrimp")) {
- foodID = ShrimpID;
- } else if (chosenFood.equals("Crayfish")) {
- foodID = CrayfishID;
- } else if (chosenFood.equals("Sardine")) {
- foodID = SardineID;
- } else if (chosenFood.equals("Herring")) {
- foodID = HerringID;
- } else if (chosenFood.equals("Mackeral")) {
- foodID = MackeralID;
- } else if (chosenFood.equals("Trout")) {
- foodID = TroutID;
- } else if (chosenFood.equals("Cod")) {
- foodID = CodID;
- } else if (chosenFood.equals("Pike")) {
- foodID = PikeID;
- } else if (chosenFood.equals("Salmon")) {
- foodID = SalmonID;
- } else if (chosenFood.equals("Tuna")) {
- foodID = TunaID;
- } else if (chosenFood.equals("Lobster")) {
- foodID = LobsterID;
- } else if (chosenFood.equals("Swordfish")) {
- foodID = SwordfishID;
- } else if (chosenFood.equals("Bass")) {
- foodID = BassID;
- } else if (chosenFood.equals("Monkfish")) {
- foodID = MonkfishID;
- } else if (chosenFood.equals("Shark")) {
- foodID = SharkID;
- } else if (chosenFood.equals("Cavefish")) {
- foodID = CavefishID;
- } else if (chosenFood.equals("Sea Turtle")) {
- foodID = SeaTurtleID;
- } else if (chosenFood.equals("Manta Ray")) {
- foodID = MantaRayID;
- } else if (chosenFood.equals("Rocktail")) {
- foodID = RocktailID;
- } else if (chosenFood.equals("Baron Shark")) {
- foodID = BaronSharkID;
- } else if (chosenFood.equals("Lobster")) {
- foodID = LobsterID;
- } else if (chosenFood.equals("Wild Pie")) {
- foodID = wildPie;
- }
- //SPECIAL ATTACK WEPS
- String specWep = SpecialAtt.getSelectedItem().toString();
- if(specWep.equals("None")) {
- spec = false;
- }
- else if(specWep.equals("Dragon Dagger")) {
- specID = dds1ID;
- spec = true;
- }else if(specWep.equals("Dragon Dagger(p)")) {
- specID = dds2ID;
- spec = true;
- }
- else if(specWep.equals("Dragon Dagger+")) {
- specID = dds3ID;
- spec = true;
- }
- else if(specWep.equals("Dragon Dagger++")) {
- specID = dds4ID;
- spec = true;
- }
- else if(specWep.equals("Korasi Sword")) {
- specID = korasiID;
- spec = true;
- }else if(specWep.equals("Bandos Godsword")) {
- specID = bgsID;
- spec = true;
- }else if(specWep.equals("Zamorak Godsword")) {
- specID = zgsID;
- spec = true;
- }else if(specWep.equals("Saradomin Godsword")) {
- specID = sgsID;
- spec = true;
- }else if(specWep.equals("Armadyl Godsword")) {
- specID = agsID;
- spec = true;
- }else if(specWep.equals("Dragon Claws")) {
- specID = dClawsID;
- spec = true;
- }else if(specWep.equals("Enchanted Excalibur")) {
- specID = excID;
- spec = true;
- }
- //POTIONS
- String attPot = comboBox2.getSelectedItem().toString();
- if(attPot.equals("Attack Potion")) {
- attPotion = regAttID;
- attPotion3 = regAtt3ID;
- attPotion2 = regAtt2ID;
- attPotion1 = regAtt1ID;
- }
- else if(attPot.equals("None")) {
- }
- else if(attPot.equals("Super Att Potion")) {
- attPotion = supAttID;
- attPotion3 = supAtt3ID;
- attPotion2 = supAtt2ID;
- attPotion1 = supAtt1ID;
- }else if(attPot.equals("Extreme Att Potion")) {
- attPotion = extremeAttID;
- attPotion3 = extremeAtt3ID;
- attPotion2 = extremeAtt2ID;
- attPotion1 = extremeAtt1ID;
- }
- String strPot = comboBox3.getSelectedItem().toString();
- if(strPot.equals("Strength Potion")) {
- strPotion = regStrID;
- strPotion3 = regStr3ID;
- strPotion2 = regStr2ID;
- strPotion1 = regStr1ID;
- }else if(strPot.equals("None")) {
- }
- else if(strPot.equals("Super Str Potion")) {
- strPotion = supStrID;
- strPotion3 = supStr3ID;
- strPotion2 = supStr2ID;
- strPotion1 = supStr1ID;
- }else if(strPot.equals("Extreme Str Potion")) {
- strPotion = extremeStrID;
- strPotion3 = extremeStr3ID;
- strPotion2 = extremeStr2ID;
- strPotion1 = extremeStr1ID;
- }
- String defPot = comboBox3.getSelectedItem().toString();
- if(defPot.equals("Defence Potion")) {
- defPotion = regDefID;
- }else if(defPot.equals("None")) {
- }
- else if(defPot.equals("Super Def Potion")) {
- defPotion = supDefID;
- }else if(defPot.equals("Extreme Def Potion")) {
- defPotion = extremeDefID;
- }
- String rngPot = comboBox4.getSelectedItem().toString();
- if(rngPot.equals("Ranging Potion")) {
- rngPotion = regRngID;
- }else if(rngPot.equals("None")) {
- }
- else if(rngPot.equals("Extreme Rng Potion")) {
- rngPotion = extremeRngID;
- }
- //POUCHES
- String pouch = comboBox5.getSelectedItem().toString();
- if(pouch.equals("None")) {
- }
- else if(pouch.equals("Unicorn Stallion")) {
- pouchID = unicornID;
- }else if(pouch.equals("Pack Yak")){
- pouchID = packYakID;
- }else if(pouch.equals("Bunyip")){
- pouchID = bunyipID;
- }else if(pouch.equals("War Tortoise")){
- pouchID = bunyipID;
- }else if(pouch.equals("Bull Ant")){
- pouchID = bullAntID;
- }else if(pouch.equals("Terror Bird")){
- pouchID = terrorBirdID;
- }else if(pouch.equals("Thorny Snail")){
- pouchID = snailID;
- }else if(pouch.equals("Bull Ant")){
- pouchID = bullAntID;
- }
- String scrolls = comboBox6.getSelectedItem().toString();
- if(scrolls.equals("None")) {
- }else if(scrolls.equals("Healing Aurora(Unicorn)")) {
- scrollID = unicornScrollsID;
- }else if(scrolls.equals("Winter Storage(Pack Yak)")) {
- scrollID = packYakScrollsID;
- }
- gui.setVisible(false);
- }
- private void button2ActionPerformed(final java.awt.event.ActionEvent evt) {//refresh
- list1.setModel(new javax.swing.AbstractListModel() {//Re-builds the list
- String[] strings = getList();
- public int getSize() { return strings.length; }
- public Object getElementAt(final int i) { return strings[i]; }
- });
- }
- private void button1ActionPerformed(final java.awt.event.ActionEvent evt) {//select
- if(list1.getSelectedValue() == null){//If no value is selected you will get a nullpointer, this stops it
- log(Color.RED, "Please select an NPC first!");
- return;
- }
- selectedNPCName = list1.getSelectedValue().toString().replace("Name: ", "").split(",")[0];
- log("NPC set to: " + selectedNPCName);
- }
- private void updateList1() {
- list2.setModel(new AbstractListModel() {
- //String[] values = getPrices(getItems());
- String[] values = getItems();
- public int getSize() {
- return values.length;
- }
- public Object getElementAt(final int i) {
- return values[i];
- }
- });
- }
- private void updateList2() {
- list3.setModel(new AbstractListModel() {
- String[] values = currentSelected
- .toArray(new String[currentSelected.size()]);
- public int getSize() {
- return values.length;
- }
- public Object getElementAt(final int i) {
- return values[i];
- }
- });
- }
- private void updateProgBar(final boolean visible){
- button5.setVisible(visible);
- textField1.setVisible(visible);
- label6.setVisible(visible);
- progressBar1.setVisible(!visible);
- }
- private void loadItem(final String itemName) {
- if (itemName != null && itemName.replaceAll(" ", "").length() > 0) {
- updateProgBar(false);
- new Thread(new Runnable() {
- @Override
- public void run() {
- try {
- final int price = grandExchange.lookup(itemName)
- .getGuidePrice();
- if (price > 0) {
- currentSelected.add(itemName + " : " + price
- + "GP");
- updateList2();
- textField1.setText("");
- updateProgBar(true);
- return;
- }
- updateProgBar(true);
- } catch (final Exception err) {
- JOptionPane.showMessageDialog(null,
- "Error loading item!", "Error",
- JOptionPane.ERROR_MESSAGE);
- textField1.setText("");
- updateProgBar(true);
- }
- }
- }).start();
- }
- }
- private void button4ActionPerformed(final ActionEvent e) {
- if(list3.getSelectedValue() != null) {
- for(int i = 0; i < currentSelected.size(); i++)
- if(currentSelected.get(i).equals(list3.getSelectedValue())){
- currentSelected.remove(i);
- updateList2();
- }
- }
- }
- private void button5ActionPerformed(final ActionEvent e) {
- if (textField1.getText() != null
- && textField1.getText().replaceAll(" ", "").length() > 0) {
- loadItem(textField1.getText().trim());
- }
- }
- private void button3ActionPerformed(final ActionEvent e) {
- if (list2.getSelectedValue() != null) {
- loadItem(String.valueOf(list2.getSelectedValue()).trim());
- }
- }
- private String[] getList(){//Gets all the npcs, and then creates a sentence saying there name, id & cbLvl
- final RSNPC[] allNPC = getClosestNPCs();
- final String[] str = new String[allNPC.length];
- for (int i = 0; i < allNPC.length; i++) {
- str[i] = "Name: " + allNPC[i].getName() + "," +
- " CBLvl: " + allNPC[i].getLevel() + "," +
- " ID: " + allNPC[i].getID();
- }
- return str;
- }
- private void initComponents() {
- label2 = new JLabel();
- label1 = new JLabel();
- Start = new JButton();
- label3 = new JLabel();
- scrollPane1 = new JScrollPane();
- list1 = new JList();
- button1 = new JButton();
- button2 = new JButton();
- label4 = new JLabel();
- checkBox1 = new JCheckBox();
- scrollPane2 = new JScrollPane();
- list2 = new JList();
- button3 = new JButton();
- button4 = new JButton();
- scrollPane3 = new JScrollPane();
- list3 = new JList();
- label5 = new JLabel();
- label6 = new JLabel();
- textField1 = new JTextField();
- button5 = new JButton();
- label7 = new JLabel();
- label8 = new JLabel();
- comboBox1 = new JComboBox();
- checkBox2 = new JCheckBox();
- checkBox3 = new JCheckBox();
- checkBox4 = new JCheckBox();
- comboBox2 = new JComboBox();
- label9 = new JLabel();
- comboBox3 = new JComboBox();
- comboBox4 = new JComboBox();
- comboBox5 = new JComboBox();
- comboBox6 = new JComboBox();
- label10 = new JLabel();
- label11 = new JLabel();
- label12 = new JLabel();
- label13 = new JLabel();
- label15 = new JLabel();
- label14 = new JLabel();
- label16 = new JLabel();
- label17 = new JLabel();
- comboBox7 = new JComboBox();
- comboBox8 = new JComboBox();
- checkBox5 = new JCheckBox();
- checkBox6 = new JCheckBox();
- checkBox7 = new JCheckBox();
- checkBox8 = new JCheckBox();
- label20 = new JLabel();
- label21 = new JLabel();
- SpecialAtt = new JComboBox();
- progressBar1 = new JProgressBar();
- prayer = new JCheckBox();
- note = new JCheckBox();
- checkBox9 = new JCheckBox();
- //======== this ========
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- //---- label2 ----
- label2.setText("wFighter");
- label2.setFont(new Font("Tempus Sans ITC", Font.BOLD, 18));
- contentPane.add(label2);
- label2.setBounds(345, 10, 100, 25);
- //---- label1 ----
- label1.setText(" by waao");
- contentPane.add(label1);
- label1.setBounds(365, 35, 44, 20);
- //---- Start ----
- Start.setText("Start");
- Start.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartActionPerformed(e);
- StartActionPerformed(e);
- StartActionPerformed(e);
- }
- });
- contentPane.add(Start);
- Start.setBounds(45, 375, 605, 18);
- //---- label3 ----
- label3.setText("Monster");
- label3.setFont(label3.getFont().deriveFont(label3.getFont().getStyle() | Font.BOLD));
- contentPane.add(label3);
- label3.setBounds(new Rectangle(new Point(65, 65), label3.getPreferredSize()));
- //======== scrollPane1 ========
- {
- scrollPane1.setViewportView(list1);
- }
- contentPane.add(scrollPane1);
- scrollPane1.setBounds(15, 90, 135, scrollPane1.getPreferredSize().height);
- //---- button1 ----
- button1.setText("Select");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- contentPane.add(button1);
- button1.setBounds(15, 235, 135, button1.getPreferredSize().height);
- //---- button2 ----
- button2.setText("Refresh");
- button2.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button2ActionPerformed(e);
- }
- });
- contentPane.add(button2);
- button2.setBounds(15, 265, 135, button2.getPreferredSize().height);
- //---- label4 ----
- label4.setText("Loot");
- label4.setFont(label4.getFont().deriveFont(label4.getFont().getStyle() | Font.BOLD));
- contentPane.add(label4);
- label4.setBounds(new Rectangle(new Point(275, 65), label4.getPreferredSize()));
- //---- checkBox1 ----
- checkBox1.setText("Enable Looting");
- contentPane.add(checkBox1);
- checkBox1.setBounds(new Rectangle(new Point(205, 85), checkBox1.getPreferredSize()));
- //======== scrollPane2 ========
- {
- scrollPane2.setViewportView(list2);
- }
- contentPane.add(scrollPane2);
- scrollPane2.setBounds(205, 115, 95, scrollPane2.getPreferredSize().height);
- //---- button3 ----
- button3.setText(">>>>");
- button3.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button3ActionPerformed(e);
- }
- });
- contentPane.add(button3);
- button3.setBounds(new Rectangle(new Point(310, 150), button3.getPreferredSize()));
- //---- button4 ----
- button4.setText("<<<<");
- button4.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button4ActionPerformed(e);
- }
- });
- contentPane.add(button4);
- button4.setBounds(new Rectangle(new Point(310, 180), button4.getPreferredSize()));
- //======== scrollPane3 ========
- {
- scrollPane3.setViewportView(list3);
- }
- contentPane.add(scrollPane3);
- scrollPane3.setBounds(385, 120, 105, 130);
- //---- label5 ----
- label5.setText("Added");
- label5.setFont(label5.getFont().deriveFont(label5.getFont().getStyle() & ~Font.BOLD));
- contentPane.add(label5);
- label5.setBounds(new Rectangle(new Point(415, 90), label5.getPreferredSize()));
- //---- label6 ----
- label6.setText("Search:");
- contentPane.add(label6);
- label6.setBounds(new Rectangle(new Point(225, 255), label6.getPreferredSize()));
- //---- textField1 ----
- textField1.setText("Must be exact name");
- contentPane.add(textField1);
- textField1.setBounds(270, 250, 110, textField1.getPreferredSize().height);
- //---- button5 ----
- button5.setText("Go");
- button5.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button5ActionPerformed(e);
- }
- });
- contentPane.add(button5);
- button5.setBounds(new Rectangle(new Point(385, 250), button5.getPreferredSize()));
- //---- label7 ----
- label7.setText("Healing");
- label7.setFont(label7.getFont().deriveFont(label7.getFont().getStyle() | Font.BOLD));
- contentPane.add(label7);
- label7.setBounds(new Rectangle(new Point(565, 60), label7.getPreferredSize()));
- //---- label8 ----
- label8.setText("Food:");
- contentPane.add(label8);
- label8.setBounds(new Rectangle(new Point(520, 90), label8.getPreferredSize()));
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Summer Pie",
- "Admiral Pie", "Meat Pie", "Apple Pie", "Mud Pie",
- "Redberry Pie", "Wild Pie", "Fish Pie", "Garden Pie",
- "Strawberry", "Lemon", "Orange", "Papaya", "Banana",
- "Peaches", "Crayfish", "Anchovies", "Shrimp", "Sardine",
- "Herring", "Mackerel", "Trout", "Cod", "Pike", "Salmon",
- "Tuna", "Lobster", "Bass", "Swordfish", "Monkfish",
- "Shark", "Cavefish", "Sea Turtle", "Manta Ray", "Rocktail",
- "Baron Shark"
- }));
- contentPane.add(comboBox1);
- comboBox1.setBounds(570, 85, 105, comboBox1.getPreferredSize().height);
- //---- checkBox2 ----
- checkBox2.setText("Bones to peaches");
- contentPane.add(checkBox2);
- checkBox2.setBounds(new Rectangle(new Point(510, 120), checkBox2.getPreferredSize()));
- //---- checkBox3 ----
- checkBox3.setText("Bones to bananas");
- contentPane.add(checkBox3);
- checkBox3.setBounds(new Rectangle(new Point(510, 145), checkBox3.getPreferredSize()));
- //---- checkBox4 ----
- checkBox4.setText("Enchanted Excalibur");
- contentPane.add(checkBox4);
- checkBox4.setBounds(new Rectangle(new Point(510, 170), checkBox4.getPreferredSize()));
- //---- comboBox2 ----
- comboBox2.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Attack Potion",
- "Super Att Potion",
- "Extreme Att Potion "
- }));
- contentPane.add(comboBox2);
- comboBox2.setBounds(570, 220, 122, 20);
- //---- label9 ----
- label9.setText("Potions");
- label9.setFont(label9.getFont().deriveFont(label9.getFont().getStyle() | Font.BOLD));
- contentPane.add(label9);
- label9.setBounds(555, 200, 42, 14);
- //---- comboBox3 ----
- comboBox3.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Strength Potion",
- "Super Str Potion",
- "Extreme Str Potion "
- }));
- contentPane.add(comboBox3);
- comboBox3.setBounds(570, 250, 121, 20);
- //---- comboBox4 ----
- comboBox4.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Defence Potion",
- "Super Def Potion",
- "Extreme Def Potion "
- }));
- contentPane.add(comboBox4);
- comboBox4.setBounds(570, 275, 121, 20);
- //---- comboBox5 ----
- comboBox5.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Ranging Potion",
- "Super Rng Potion",
- "Extreme Rng Potion"
- }));
- contentPane.add(comboBox5);
- comboBox5.setBounds(570, 300, 120, 20);
- //---- comboBox6 ----
- comboBox6.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Magic Potion",
- "Extreme Magic Potion"
- }));
- contentPane.add(comboBox6);
- comboBox6.setBounds(new Rectangle(new Point(570, 325), comboBox6.getPreferredSize()));
- //---- label10 ----
- label10.setText("Attack:");
- contentPane.add(label10);
- label10.setBounds(510, 225, 35, 14);
- //---- label11 ----
- label11.setText("Strength:");
- contentPane.add(label11);
- label11.setBounds(510, 250, 46, 20);
- //---- label12 ----
- label12.setText("Defence:");
- contentPane.add(label12);
- label12.setBounds(510, 280, 44, 14);
- //---- label13 ----
- label13.setText("Range:");
- contentPane.add(label13);
- label13.setBounds(510, 305, 35, 14);
- //---- label15 ----
- label15.setText("Mage:");
- contentPane.add(label15);
- label15.setBounds(new Rectangle(new Point(510, 330), label15.getPreferredSize()));
- //---- label14 ----
- label14.setText("Summoning");
- label14.setFont(label14.getFont().deriveFont(label14.getFont().getStyle() | Font.BOLD));
- contentPane.add(label14);
- label14.setBounds(45, 295, 67, 14);
- //---- label16 ----
- label16.setText("Familiar:");
- contentPane.add(label16);
- label16.setBounds(20, 315, 40, 14);
- //---- label17 ----
- label17.setText("Scrolls:");
- contentPane.add(label17);
- label17.setBounds(20, 340, 34, 14);
- //---- comboBox7 ----
- comboBox7.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Bunyip",
- "Unicorn Stallion",
- "Snail",
- "Bull Ant",
- "Spirit Terror Bird",
- "War Tortoise",
- "Pack Yak"
- }));
- contentPane.add(comboBox7);
- comboBox7.setBounds(65, 315, 103, 20);
- //---- comboBox8 ----
- comboBox8.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Healing Aurora(Unicorn)",
- "Winter Storage(Pack Yak)"
- }));
- contentPane.add(comboBox8);
- comboBox8.setBounds(65, 340, 140, 20);
- //---- checkBox5 ----
- checkBox5.setText("Scatter ashes");
- checkBox5.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- checkBox4ActionPerformed(e);
- }
- });
- contentPane.add(checkBox5);
- checkBox5.setBounds(new Rectangle(new Point(255, 310), checkBox5.getPreferredSize()));
- //---- checkBox6 ----
- checkBox6.setText("Burry Bones");
- checkBox6.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- checkBox6ActionPerformed(e);
- }
- });
- contentPane.add(checkBox6);
- checkBox6.setBounds(new Rectangle(new Point(255, 335), checkBox6.getPreferredSize()));
- //---- checkBox7 ----
- checkBox7.setText("High Alch Loot");
- contentPane.add(checkBox7);
- checkBox7.setBounds(new Rectangle(new Point(355, 310), checkBox7.getPreferredSize()));
- //---- checkBox8 ----
- checkBox8.setText("Low Alch Loot");
- contentPane.add(checkBox8);
- checkBox8.setBounds(new Rectangle(new Point(355, 335), checkBox8.getPreferredSize()));
- //---- checkBox9 ----
- checkBox9.setText("Banking(Taverly dungeon Hell hounds)");
- contentPane.add(checkBox9);
- checkBox9.setBounds(new Rectangle(new Point(255, 285), checkBox9.getPreferredSize()));
- //---- label20 ----
- label20.setText("Special Attack");
- label20.setFont(label20.getFont().deriveFont(label20.getFont().getStyle() | Font.BOLD));
- contentPane.add(label20);
- label20.setBounds(70, 0, 81, 14);
- //---- label21 ----
- label21.setText("Spec Wepon:");
- contentPane.add(label21);
- label21.setBounds(10, 25, 64, 14);
- //---- SpecialAtt ----
- SpecialAtt.setModel(new DefaultComboBoxModel(new String[] {
- "None",
- "Dragon Dagger",
- "Dragon Dagger+",
- "Dragon Dagger++",
- "Korasi Sword",
- "Bandos Godsword",
- "Zamorak Godsword",
- "Saradomin Godsword",
- "Armadyl Godsword",
- "Dragon Claws",
- "Enchanted Excalibur"
- }));
- contentPane.add(SpecialAtt);
- SpecialAtt.setBounds(95, 25, 126, 20);
- contentPane.add(progressBar1);
- progressBar1.setBounds(270, 250, 110, 20);
- //---- prayer ----
- prayer.setText("Quick Prayer");
- contentPane.add(prayer);
- prayer.setBounds(new Rectangle(new Point(255, 355), prayer.getPreferredSize()));
- //---- note ----
- note.setText("un-note food (Bandits)");
- contentPane.add(note);
- note.setBounds(new Rectangle(new Point(355, 355), note.getPreferredSize()));
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- updateProgBar(false);
- updateList1();
- updateList2();
- updateProgBar(true);
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JLabel label2;
- private JLabel label1;
- private JButton Start;
- private JLabel label3;
- private JScrollPane scrollPane1;
- private JList list1;
- private JButton button1;
- private JButton button2;
- private JLabel label4;
- private JCheckBox checkBox1;
- private JScrollPane scrollPane2;
- private JList list2;
- private JButton button3;
- private JButton button4;
- private JScrollPane scrollPane3;
- private JList list3;
- private JLabel label5;
- private JLabel label6;
- private JTextField textField1;
- private JButton button5;
- private JLabel label7;
- private JLabel label8;
- private JComboBox comboBox1;
- private JCheckBox checkBox2;
- private JCheckBox checkBox3;
- private JCheckBox checkBox4;
- private JComboBox comboBox2;
- private JLabel label9;
- private JComboBox comboBox3;
- private JComboBox comboBox4;
- private JComboBox comboBox5;
- private JComboBox comboBox6;
- private JLabel label10;
- private JLabel label11;
- private JLabel label12;
- private JLabel label13;
- private JLabel label15;
- private JLabel label14;
- private JLabel label16;
- private JLabel label17;
- private JComboBox comboBox7;
- private JComboBox comboBox8;
- private JCheckBox checkBox5;
- private JCheckBox checkBox6;
- private JCheckBox checkBox7;
- private JCheckBox checkBox8;
- private JLabel label20;
- private JLabel label21;
- private JComboBox SpecialAtt;
- private JProgressBar progressBar1;
- private JCheckBox prayer;
- private JCheckBox note;
- private JCheckBox checkBox9;
- }
- //paint
- public void mouseClicked(MouseEvent e) {
- if (button1.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button1BOX;
- } else if (button2.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button2BOX;
- } else if (button3.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button3BOX;
- } else if (button4.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button4BOX;
- }else if (button5.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button5BOX;
- }else if (button6.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button6BOX;
- }else if (button7.contains(e.getPoint())) {
- SHOWING_TAB = Curpaint.button7BOX;
- }
- }
- @Override
- public void mouseEntered(MouseEvent e) {
- }
- @Override
- public void mouseExited(MouseEvent e) {
- }
- @Override
- public void mousePressed(MouseEvent e) {
- }
- @Override
- public void mouseReleased(MouseEvent e) {
- }
- private void drawTile(Graphics render, RSTile tile, Color color,
- boolean drawCardinalDirections) {
- Point southwest = calc.tileToScreen(tile, 0, 0, 0);
- Point southeast = calc.tileToScreen(
- new RSTile(tile.getX() + 1, tile.getY()), 0, 0, 0);
- Point northwest = calc.tileToScreen(new RSTile(tile.getX(),
- tile.getY() + 1), 0, 0, 0);
- Point northeast = calc.tileToScreen(
- new RSTile(tile.getX() + 1, tile.getY() + 1), 0, 0, 0);
- if (calc.pointOnScreen(southwest) && calc.pointOnScreen(southeast)
- && calc.pointOnScreen(northwest)
- && calc.pointOnScreen(northeast)) {
- render.setColor(Color.GREEN);
- render.drawPolygon(new int[] { (int) northwest.getX(),
- (int) northeast.getX(), (int) southeast.getX(),
- (int) southwest.getX() },
- new int[] { (int) northwest.getY(), (int) northeast.getY(),
- (int) southeast.getY(), (int) southwest.getY() }, 4);
- render.setColor(color);
- render.fillPolygon(new int[] { (int) northwest.getX(),
- (int) northeast.getX(), (int) southeast.getX(),
- (int) southwest.getX() },
- new int[] { (int) northwest.getY(), (int) northeast.getY(),
- (int) southeast.getY(), (int) southwest.getY() }, 4);
- if (drawCardinalDirections) {
- render.setColor(Color.WHITE);
- }
- }
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Font font1 = new Font("Arial", 0, 12);
- private final Color color1 = new Color(0, 0, 0);
- private final Image img1 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintOverall.png");
- private final Image img2 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintAttack.png");
- private final Image img3 = getImage("http://img29.imageshack.us/img29/4227/waaopaintstrength.png");
- private final Image img4 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintDefence.png");
- private final Image img5 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintRange.png");
- private final Image img6 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintMagic.png");
- private final Image img7 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintHitpoints.png");
- private final Image img8 = getImage("http://img202.imageshack.us/img202/5171/10perc.png");
- private final Image img9 = getImage("http://img560.imageshack.us/img560/8610/20perc.png");
- private final Image img10 = getImage("http://img703.imageshack.us/img703/120/30perc.png");
- private final Image img11 = getImage("http://img703.imageshack.us/img703/120/30perc.png");
- private final Image img12 = getImage("http://img233.imageshack.us/img233/3317/50perc.png");
- public void onRepaint(Graphics g1) {
- final RSNPC npc = npcs.getNearest(selectedNPCName);
- if(npc != null && npc.isOnScreen()) {
- drawTile(g1, npc.getLocation(), new Color(0, 0,
- 200, 70), true);
- }
- hpexpGained = skills.getCurrentExp(Skills.CONSTITUTION) - startHpExp;
- AttexpGained = skills.getCurrentExp(Skills.ATTACK) - startAttExp;
- StrexpGained = skills.getCurrentExp(Skills.STRENGTH) - startStrExp;
- DefexpGained = skills.getCurrentExp(Skills.DEFENSE) - startDefExp;
- RngexpGained = skills.getCurrentExp(Skills.RANGE) - startRngExp;
- MageexpGained = skills.getCurrentExp(Skills.MAGIC) - startMageExp;
- timeTNL = (long) ((double) attExpTNL / (double) attxpHour * 3600000);
- // attExpTNL = skills.getExpToNextLevel(Skills.ATTACK);
- //strExpTNL = skills.getExpToNextLevel(Skills.STRENGTH);
- //defExpTNL = skills.getExpToNextLevel(Skills.DEFENSE);
- // rngExpTNL = skills.getExpToNextLevel(Skills.RANGE);
- // mageExpTNL = skills.getExpToNextLevel(Skills.MAGIC);
- // hpExpTNL = skills.getExpToNextLevel(Skills.CONSTITUTION);
- TotalExp = hpexpGained + AttexpGained + StrexpGained + DefexpGained + RngexpGained + MageexpGained;
- TotalGP = getTotalLootCount();
- goldCharms = inventory.getCount(true, goldCharmID);
- greenCharms = inventory.getCount(true, greenCharmID);
- crimsonCharms = inventory.getCount(true, crimsonCharmID);
- blueCharms = inventory.getCount(true, blueCharmID);
- 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;
- attxpHour = (int) ((AttexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- strxpHour = (int) ((StrexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- defxpHour = (int) ((DefexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- rngxpHour = (int) ((RngexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- magexpHour = (int) ((MageexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- hpxpHour = (int) ((hpexpGained) * 3600000D / (System
- .currentTimeMillis() - startTime));
- final Point p = mouse.getLocation();
- final long mpt = System.currentTimeMillis()- mouse.getPressTime();
- if (mouse.getPressTime() == -1 || mpt >= 1000) {
- g1.drawImage(normal, p.x - 8, p.y - 8, null);
- }
- if (mpt < 2050) {
- g1.drawImage(normal, p.x - 8, p.y - 8, null);
- }
- //mouse paint
- while (!mousePath.isEmpty() && mousePath.peek().isUp())
- mousePath.remove();
- Point clientCursor = mouse.getLocation();
- MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y,
- 1000); //1000 = lasting time/MS
- if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
- mousePath.add(mpp);
- MousePathPoint lastPoint = null;
- for (MousePathPoint a : mousePath) {
- if (lastPoint != null) {
- g1.setColor(a.getColor());
- g1.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
- }
- lastPoint = a;
- }
- switch (SHOWING_TAB) {
- case button1BOX:
- g1.drawImage(img1, -1, 297, null);
- g1.setFont(font1);
- g1.setColor(color1);
- g1.drawString(status, 194, 449);
- g1.drawString("" + TotalExp, 269, 399);
- g1.drawString("", 240, 425);
- g1.drawString(hours + ":" + minutes + ":" + seconds, 249, 377);
- g1.drawString("" + goldCharms, 455, 407);
- g1.drawString("" + greenCharms, 466, 422);
- g1.drawString("" + crimsonCharms, 476, 442);
- g1.drawString("" + blueCharms, 455, 458);
- break;
- case button2BOX:
- g1.drawImage(img2, -1, 297, null);
- g1.drawString("" + AttexpGained, 260, 369);
- g1.drawString("" + attxpHour , 251, 392);
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 10) {
- g1.drawImage(img8, 151, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 20) {
- g1.drawImage(img9, 184, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 30) {
- g1.drawImage(img10, 216, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 40) {
- g1.drawImage(img11, 248, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 50) {
- g1.drawImage(img12, 282, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 60) {
- g1.drawImage(img12, 318, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 70) {
- g1.drawImage(img12, 354, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 80) {
- g1.drawImage(img12, 390, 420, null);
- }
- if(skills.getPercentToNextLevel(Skills.ATTACK) > 90) {
- g1.drawImage(img12, 426, 420, null);
- }
- break;
- case button3BOX:
- g1.drawImage(img3, -1, 297, null);
- g1.drawString("" + StrexpGained, 260, 369);
- g1.drawString("" + strxpHour , 251, 392);
- // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.STRENGTH, StrexpGained, startTime)), 219, 412);
- break;
- case button4BOX:
- g1.drawImage(img4, -1, 297, null);
- g1.drawString("" + DefexpGained, 260, 369);
- g1.drawString("" + defxpHour , 251, 392);
- //g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.DEFENSE, DefexpGained, startTime)), 219, 412);
- break;
- case button5BOX:
- g1.drawImage(img5, -1, 297, null);
- g1.drawString("" + RngexpGained, 260, 369);
- g1.drawString("" + rngxpHour , 251, 392);
- // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.RANGE, RngexpGained, startTime)), 219, 412);
- break;
- case button6BOX:
- g1.drawImage(img7, -1, 297, null);
- g1.drawString("" + hpexpGained, 260, 369);
- g1.drawString("" + hpxpHour , 251, 392);
- // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.CONSTITUTION, hpexpGained, startTime)), 219, 412);
- break;
- case button7BOX:
- g1.drawImage(img6, -1, 297, null);
- g1.drawString("" + MageexpGained, 260, 369);
- g1.drawString("" + magexpHour , 251, 392);
- // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.MAGIC, MageexpGained, startTime)), 219, 412);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement