Advertisement
waao

wFighter.java

Aug 14th, 2011
3,376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @author waao
  3.  */
  4. import java.awt.*;
  5. import java.awt.event.*;
  6. import java.awt.image.BufferedImage;
  7.  
  8. import javax.swing.*;
  9.  
  10. import java.awt.Color;
  11. import java.awt.Container;
  12. import java.awt.Graphics;
  13. import java.awt.Point;
  14. import java.lang.reflect.InvocationTargetException;
  15. import java.util.ArrayList;
  16. import java.util.LinkedList;
  17.  
  18. import javax.swing.SwingUtilities;
  19.  
  20. import org.rsbot.event.events.MessageEvent;
  21. import org.rsbot.event.listeners.MessageListener;
  22. import org.rsbot.event.listeners.PaintListener;
  23. import org.rsbot.script.Script;
  24. import org.rsbot.script.ScriptManifest;
  25. import org.rsbot.script.methods.Equipment;
  26. import org.rsbot.script.methods.Skills;
  27. import org.rsbot.script.util.Filter;
  28. import org.rsbot.script.wrappers.RSArea;
  29. import org.rsbot.script.wrappers.RSGroundItem;
  30. import org.rsbot.script.wrappers.RSItem;
  31. import org.rsbot.script.wrappers.RSNPC;
  32. import org.rsbot.script.wrappers.RSObject;
  33. import org.rsbot.script.wrappers.RSPath;
  34. import org.rsbot.script.wrappers.RSTile;
  35. import org.rsbot.script.wrappers.RSTilePath;
  36. import org.rsbot.script.wrappers.RSWeb;
  37.  
  38. import javax.imageio.ImageIO;
  39. import java.io.IOException;
  40. import java.net.MalformedURLException;
  41. import java.net.URL;
  42.  
  43.  
  44.  
  45. @ScriptManifest(authors = {"waao"}, keywords = {"AIO", "Fighter", "Combat", "waao"}, name = "wFighter", description = "AIO Fighter, by waao",
  46.         version = 1.6, website = "http://www.powerbot.org/community/topic/576777-wfighter-the-five-star-aio-fighter-wfighter/")
  47.  
  48. public class wFighter extends Script implements PaintListener, MessageListener, MouseListener{
  49.     ScriptManifest props = getClass().getAnnotation(ScriptManifest.class);
  50.    
  51.          
  52.      
  53.     //Summoning stuff
  54.     private int pouchID;
  55.     private int scrollID;
  56.    
  57.     private int yakID = 0; //The NPC ID of it
  58.     private int uniID = 0; //The NPC ID of it
  59.    
  60.     private int unicornID = 12039; // pouch
  61.     private int unicornScrollsID = 12434; //scroll
  62.     private int bunyipID = 12029; //pouch
  63.     private int packYakID = 12093;; //pouch
  64.     private int packYakScrollsID = 12435; //scroll
  65.     private int warTortoiseID = 12031;//pouch
  66.     private int terrorBirdID = 12007;//pouch
  67.     private int snailID = 12019;//pouch
  68.     private int bullAntID = 12087;//pouch
  69.    
  70.    
  71.     //loot ID's
  72.    
  73.     private int StarvedffigyID = 18778;
  74.     private int NourishedeffigyID = 18779;
  75.     private int SatedeffigyID = 18780;
  76.     private int GorgedeffigyID = 18781;
  77.     private int goldCharmID = 12158;
  78.     private int greenCharmID = 12159;
  79.     private int crimsonCharmID = 12160;
  80.     private int blueCharmID = 12163;
  81.     private int[] EasyClueID = {2677, 2678, 2679, 2680, 2681, 2682,2683,2684,2685,2686,2687,2688, 2689, 2690, 2691,2692,2693,2694,2695,
  82.             2696,2697,2698,2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,};
  83.     private int[] HardClueID = {2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737,
  84.             2738, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783,
  85.             2784, 2785, 2786, 2787, 2788, 2789, 2790, 2791, 2792, 2793, 2794, 2795, 2796, 2797, 2798, 2799};
  86.     private int[] MediumClueID = {2801, 2802, 2803, 2804, 2805, 2806, 2807, 2808, 2809, 2811, 2812, 2813, 2814, 2815, 2816, 2817, 2818, 2819,
  87.             2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2731, 2733, 2735, 2737, 2739, 2741, 2743, 2745, 2747, 2749, 2751, 2753,
  88.             2755, 2757, 2758};
  89.     private int[] bonesID = {526, 530, 532, 534, 536, 3179, 3181, 3183, 3185, 3186, 4812, 4830, 6729, 6812};
  90.     private int regbonesID = 526;
  91.     private int[] ashID = {592, 1502, 20264, 20266, 20268};
  92.     private int[] rareLootID = {987, 985, 2366, 1249, 1149, 1215, 1615, 1631, 533, 2999, 258, 3001, 270, 454, 450, 2937, 1443, 372, 384, 9342,
  93.             1392, 574, 570, 452, 2362, 2363, 5315, 5316, 5289, 5304, 1516, 1216, 6686, 20667};
  94.     private int[] yakTeleLootID = {};
  95.     //Food IDs
  96.     private int foodID;
  97.    
  98.     private final int CrayfishID = 13433;// 1
  99.     private final int AnchoveysID = 319;// 2
  100.     private final int ShrimpID = 315;// 3
  101.     private final int SardineID = 325;// 4
  102.     private final int HerringID = 347;// 5
  103.     private final int MackeralID = 355;// 6
  104.     private final int TroutID = 333;// 7
  105.     private final int CodID = 339;// 8
  106.     private final int PikeID = 351;// 9
  107.     private final int SalmonID = 329;// 10
  108.     private final int TunaID = 361;// 11
  109.     private final int LobsterID = 379;// 12
  110.     private final int BassID = 365;// 13
  111.     private final int SwordfishID = 373;// 14
  112.     private final int MonkfishID = 7946;// 15
  113.     private final int SharkID = 385;// 16
  114.     private final int CavefishID = 15266;// 17
  115.     private final int SeaTurtleID = 397;// 18
  116.     private final int MantaRayID = 391;// 19
  117.     private final int RocktailID = 15272;// 20
  118.     private final int BaronSharkID = 19948;// 21
  119.     private final int summerPie = 7218;
  120.     private final int halfPie = 7220;
  121.     private final int MudPie = 7170;
  122.     private final int GardenPie = 7178;
  123.     private final int AdmiralPie = 7198;
  124.     private final int MeatPie = 2327;
  125.     private final int ApplePie = 2323;
  126.     private final int RedberryPie = 2325;
  127.     private final int wildPie = 7208;
  128.     private final int fishPie = 7188;
  129.     private final int Strawberry = 5504;
  130.     private final int Peach = 6883;
  131.     private final int Lemon = 2102;
  132.     private final int Orange = 2108;
  133.     private final int Papaya = 5972;
  134.     private final int Banana = 1963;
  135.  
  136.    
  137.     //Pots stuff
  138.     private int vialID = 229;
  139.     private int attPotion;
  140.     private int attPotion3;
  141.     private int attPotion2;
  142.     private int attPotion1;
  143.    
  144.     private int strPotion;
  145.     private int strPotion3;
  146.     private int strPotion2;
  147.     private int strPotion1;
  148.    
  149.     private int defPotion;
  150.     private int rngPotion;
  151.     private int[] summPotID = {12140, 12142, 12144, 12146};
  152.    
  153.     private int regAttID = 2428;
  154.     private int regAtt3ID = 121;
  155.     private int regAtt2ID = 123;
  156.     private int regAtt1ID = 125;
  157.    
  158.     private int supAttID = 2436;
  159.     private int supAtt3ID = 145;
  160.     private int supAtt2ID = 147;
  161.     private int supAtt1ID = 149;
  162.    
  163.     private int extremeAttID = 15308;
  164.     private int extremeAtt3ID = 15309;
  165.     private int extremeAtt2ID = 15310;
  166.     private int extremeAtt1ID = 15311;
  167.    
  168.     private int regStrID = 113;
  169.     private int regStr3ID = 115;
  170.     private int regStr2ID = 117;
  171.     private int regStr1ID = 119;
  172.    
  173.     private int supStrID = 2440;
  174.     private int supStr3ID = 157;
  175.     private int supStr2ID = 159;
  176.     private int supStr1ID = 161;
  177.    
  178.     private int extremeStrID = 15312;
  179.     private int extremeStr3ID = 15313;
  180.     private int extremeStr2ID = 15314;
  181.     private int extremeStr1ID = 15315;
  182.    
  183.     private int regDefID = 2432;
  184.     private int supDefID = 2442;
  185.     private int extremeDefID = 15316;
  186.    
  187.     private int regRngID = 2444;
  188.     private int extremeRngID = 15324;
  189.    
  190.     private int ppotID4 = 2434;
  191.     private int ppotID3 = 139;
  192.     private int ppotID2 = 141;
  193.     private int ppotID1 = 143;
  194.     private int[] prayerPot = {2434, 139, 141, 143};
  195.    
  196.     private int antiPot4 = 2446;
  197.     private int[] antiPot = {2446, 175, 177, 179};
  198.    
  199.     // Item ids
  200.     private int[] deadID = {8837, 8838}; //downed creature id able to be mined
  201.     private int[] pickaxeID = {1275, 15259, 1265, 1271, 1273, 1269, 20780, 20781, 20782, 20783, 20784, 20785, 20786};
  202.     private int specID;
  203.     private int excID = 14632;
  204.     private int dClawsID = 14484;
  205.     private int bgsID = 11696;
  206.     private int zgsID = 11700;
  207.     private int sgsID = 11698;
  208.     private int agsID = 11694;
  209.     private int korasiID = 18786;
  210.     private int dds1ID = 1215;
  211.     private int dds2ID = 1231;
  212.     private int dds3ID = 5680;
  213.     private int dds4ID = 5698;
  214.    
  215.      private wfighterGUI gui;
  216.      private String selectedNPCName;
  217.      private boolean ash;
  218.      private boolean bury;
  219.      private final int rockIDs[] = {1268,1266};
  220.      
  221.      //Bandits un noting
  222.      RSTile storeTile = new RSTile(3176, 2987);
  223.      private int storeID = 1917;
  224.      boolean unNote;
  225.    //variables
  226.      
  227.  
  228.     public int TotalExp;
  229.     public int TotalGP;
  230.     private int hpexpGained = 0;
  231.     private int AttexpGained = 0;
  232.     private int StrexpGained = 0;
  233.     private int RngexpGained = 0;
  234.     private int DefexpGained = 0;
  235.     private int MageexpGained = 0;
  236.     private int attxpHour = 0;
  237.     private int strxpHour = 0;
  238.     private int defxpHour = 0;
  239.     private int rngxpHour = 0;
  240.     private int magexpHour = 0;
  241.     private int hpxpHour = 0;
  242.     private int startHpExp = 0;
  243.     private int startAttExp = 0;
  244.     private int startStrExp = 0;
  245.     private int startDefExp = 0;
  246.     private int startRngExp = 0;
  247.     private int startMageExp = 0;
  248.     private long startTime;
  249.     private String status = "Loading...";
  250.     private boolean exc;
  251.     private boolean hellHounds;
  252.     private boolean b2b;
  253.     private boolean b2p;
  254.     private int b2bID = 8014;
  255.     private int b2pID = 8015;
  256.     private int bananasID = 1963;
  257.     private int peachesID = 6883;
  258.     private int goldCharms;
  259.     private int greenCharms;
  260.     private int crimsonCharms;
  261.     private int blueCharms;
  262.     private int looting;
  263.     private static int weaponID;
  264.     private Long runTime;
  265.     public boolean showOverall = false;
  266.     public boolean showAttack = false;
  267.     public boolean showStr = false;
  268.     public boolean showDef = false;
  269.     public boolean showRng = false;
  270.     public boolean showMage = false;
  271.     public boolean showHP = false;
  272.     private int attExpTNL = 0;
  273.     private int strExpTNL = 0;
  274.     private int defExpTNL = 0;
  275.     private int rngExpTNL = 0;
  276.     private int mageExpTNL = 0;
  277.     private int hpExpTNL = 0;
  278.     private long timeTNL;
  279.     public boolean spec;
  280.     boolean pray;
  281.     private String[] LootNames;
  282.     private int[] LootPrices;
  283.     RSTile randomTile = new RSTile(0000, 0000);
  284.     //Hell hounds bankings stuff
  285.     private int fallyBoothID = 11758;
  286.     private int fTab = 8009;
  287.     private final RSArea hellHoundsArea = new RSArea(new RSTile(2852, 9852), new RSTile(2871, 9815));
  288.     private final RSArea fallyTeleArea = new RSArea(new RSTile(2962, 3385), new RSTile(2969, 3372));
  289.     private final RSArea fallyTeleArea2 = new RSArea(new RSTile(2949, 3384), new RSTile(2956, 3379));
  290.     private final RSArea inShortCut2Area = new RSArea(new RSTile(2936, 3362), new RSTile(2940, 3353));
  291.     private final RSArea outShortCut2Area = new RSArea(new RSTile(2935, 3357), new RSTile(2932, 3353));
  292.     private final RSArea topLadderArea = new RSArea(new RSTile(2882, 3402), new RSTile(2888, 3395));
  293.     private final RSArea bottomLadderArea = new RSArea(new RSTile(2882, 9799), new RSTile(2886, 3396));
  294.     private final RSArea inshortCutArea = new RSArea(new RSTile(2880, 9826), new RSTile(9884, 9811));//
  295.     private final RSArea outshortCutArea = new RSArea(new RSTile(2876, 9814), new RSTile(2878, 9810));
  296.     private final RSArea fallyBankArea = new RSArea(new RSTile(2943, 3373), new RSTile(2949, 3366));
  297.    
  298.     private static final RSTile[] tilesToBank = {new RSTile(2965, 3380), new RSTile(2962, 3380), new RSTile(2957, 3380),
  299.         new RSTile(2953, 3380), new RSTile(2950, 3377), new RSTile(2947, 3375), new RSTile(2945, 3371)};
  300.  
  301.     private static final RSTile[] tilesToBank2 = {new RSTile(2950, 3377), new RSTile(2945, 3374), new RSTile(2945, 3370),   };
  302.  
  303.    
  304.     private static final RSTile[] tilesToinShortCut2 = {new RSTile(2945, 3371), new RSTile(2945, 3375), new RSTile(2941, 3375),
  305.         new RSTile(2941, 3371), new RSTile(2940, 3368), new RSTile(2940, 3363), new RSTile(2938, 3359), new RSTile(2936, 3355)};
  306.  
  307.     RSTilePath pathToBank;
  308.     RSTilePath pathToBank2;
  309.     RSTilePath pathToinShortCut2;
  310.    
  311.     private int topLadder = 55404;
  312.     private int bottomLadder = 32015;
  313.     private int shortCut2 = 11844;
  314.     private int shortCut = 9294;
  315.     RSTile fallyBankTile = new RSTile(2946, 3369);
  316.     RSTile hellHoundsTile = new RSTile(2870, 9833);
  317.     RSTile shortCutTile = new RSTile(2881, 9813);
  318.     RSTile inShortCut2Tile = new RSTile(2936, 3355);
  319.     RSTile outShortCut2Tile = new RSTile(2934, 3355);
  320.     RSTile topLadderTile = new RSTile(2884, 3400);
  321.     private Curpaint SHOWING_TAB = Curpaint.button1BOX;
  322.     private final Rectangle button1 = new Rectangle(401, 357, 99, 24);//overall
  323.     private final Rectangle button2 = new Rectangle(24, 355, 76, 16);//attack
  324.     private final Rectangle button3 = new Rectangle(23, 372, 77, 16);//str
  325.     private final Rectangle button4 = new Rectangle(24, 390, 78, 19);//def
  326.     private final Rectangle button5 = new Rectangle(24, 406, 77, 18);//Rng
  327.     private final Rectangle button6 = new Rectangle(24, 443, 78, 17);//hp
  328.     private final Rectangle button7 = new Rectangle(24, 424, 76, 19);//mage
  329.     private enum Curpaint {
  330.     button1BOX, button2BOX, button3BOX, button4BOX, button5BOX, button6BOX, button7BOX
  331.  
  332.         };
  333.         BufferedImage normal = null;
  334.         BufferedImage clicked = null;
  335.      
  336.        
  337.         private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
  338.  
  339.          @SuppressWarnings("serial")
  340.           private class MousePathPoint extends Point {
  341.            
  342.             private long finishTime;
  343.             private double lastingTime;
  344.  
  345.             private int toColor(double d) {
  346.               return Math.min(255, Math.max(0, (int) d));
  347.             }
  348.  
  349.             public MousePathPoint(int x, int y, int lastingTime) {
  350.               super(x, y);
  351.               this.lastingTime = lastingTime;
  352.               finishTime = System.currentTimeMillis() + lastingTime;
  353.             }
  354.  
  355.             public boolean isUp() {
  356.               return System.currentTimeMillis() > finishTime;
  357.             }
  358.          
  359.             public Color getColor() {
  360.               return new Color(200, 0, 0, toColor(256 * ((finishTime - System
  361.                   .currentTimeMillis()) / lastingTime)));
  362.             }
  363.           }
  364.    
  365.     @Override
  366.     public boolean onStart() {
  367.  
  368.        
  369.          startAttExp = skills.getCurrentExp(Skills.ATTACK);
  370.          startStrExp = skills.getCurrentExp(Skills.STRENGTH);
  371.          startDefExp = skills.getCurrentExp(Skills.DEFENSE);
  372.          startRngExp = skills.getCurrentExp(Skills.RANGE);
  373.          startMageExp = skills.getCurrentExp(Skills.MAGIC);
  374.          startHpExp = skills.getCurrentExp(Skills.CONSTITUTION);           
  375.            
  376.          try {
  377.              final URL cursorURL = new URL(
  378.                      "http://i.imgur.com/w7HhD.png"); // This is the link of your mouse when it isn't clicked
  379.              final URL cursor80URL = new URL(
  380.                      "http://i.imgur.com/w7HhD.png"); // This is the link of your mouse when it is clicked
  381.              normal = ImageIO.read(cursorURL);
  382.              clicked = ImageIO.read(cursor80URL);
  383.          } catch (MalformedURLException e) {
  384.              log("Unable to buffer cursor.");
  385.          } catch (IOException e) {
  386.              log("Unable to open cursor image.");
  387.          }
  388.         startTime = System.currentTimeMillis();
  389.         weaponID = equipment.getItem(Equipment.WEAPON).getID();
  390.         status = "Staring up";
  391.         log(Color.GREEN,"Welcome to wFighter, a AIO fighter by waao");
  392.        
  393.         if (SwingUtilities.isEventDispatchThread()) {
  394.             gui = new wfighterGUI();
  395.             gui.setVisible(true);
  396.         } else {
  397.             try {
  398.                 SwingUtilities.invokeAndWait(new Runnable() {
  399.                     @Override
  400.                     public void run() {
  401.                         gui = new wfighterGUI();
  402.                         gui.setVisible(true);
  403.                     }
  404.                 });
  405.             } catch (final InvocationTargetException ex) {
  406.             } catch (final InterruptedException ex2) {
  407.             }
  408.         }
  409.         while(gui.isVisible()) {
  410.             sleep(random(50,2000));
  411.         }
  412.         return true;
  413.     }
  414.  
  415.     public boolean atDoor() {
  416.         RSObject door = objects.getNearest(1528);
  417.         return door != null && door.isOnScreen();
  418. }
  419.    
  420.     public int loop() {
  421.        
  422.          String returnText = interfaces.get(906)
  423.          .getComponent(221)
  424.           .getText().toLowerCase();
  425.   if (!game.isLoggedIn() || game.isWelcomeScreen() || ( returnText != null && returnText.equals("Logging In - Please Wait")))
  426.   {
  427.           sleep(1000,1500);
  428.           return random(6000,7000);
  429.   }  
  430.                
  431.     mouse.setSpeed(random(7, 9));
  432.    
  433.     //npc's
  434.     final RSNPC npc = npcs.getNearest(selectedNPCName);
  435.     RSNPC rock = npcs.getNearest(rockIDs);
  436.     RSNPC o = npcs.getNearest(storeID);
  437.     //Ground item's
  438.     RSGroundItem loot = groundItems.getNearest(LootNames);
  439.     //Object's
  440.     RSObject door = objects.getNearest(1528);
  441.     RSObject sc2 = objects.getNearest(shortCut2);
  442.      
  443.     if(interfaces.canContinue()) {
  444.         interfaces.clickContinue();
  445.     }
  446.    
  447.     //clean invo
  448.     if(inventory.contains(vialID)) {
  449.         inventory.dropItem(vialID);
  450.     }
  451.     //turns on run
  452.         setRun();
  453.    
  454.         //mines living rock creatures
  455.         mine();
  456.        
  457.         //checboxes
  458.         if(bury == true) {
  459.         boneloot();
  460.         sleep(random(600, 800));
  461.         bones(); //bones = burry
  462.         }
  463.        
  464.         if(pray == true) {
  465.              prayerPot();
  466.             if(!prayer.isQuickPrayerOn()) {
  467.                 if(hellHounds == false) {
  468.                     status = "Turning quick prayer ON";
  469.                 prayer.setQuickPrayer(true);
  470.                 }else {
  471.                     if(hellHounds == true) {
  472.                         if(hellHoundsArea.contains(getMyPlayer().getLocation())) {
  473.                         status = "Turning quick prayer ON";
  474.                         prayer.setQuickPrayer(true);
  475.                         }else {
  476.                             prayer.setQuickPrayer(false);
  477.                         }
  478.                     }
  479.                 }
  480.             }
  481.         }
  482.    
  483.         if(unNote == true) {
  484.             if(!inventory.contains(foodID) && !inventory.contains(halfPie) && getMyPlayer().getHPPercent() < 60) {
  485.                 if(atDoor()) {
  486.                     door.interact("Open");
  487.                      sleep(random(400, 800));
  488.                      
  489.                 }
  490.                 if(o != null) {
  491.                     if(o.isOnScreen()) {
  492.                          if (store.isOpen()) {
  493.                              RSItem foods = store.getItem(foodID);
  494.                              if (foods != null) {
  495.                                      store.buy(foodID, 10);
  496.                                      sleep(random(400, 800));
  497.                        
  498.                     }else {
  499.                         int notedFoodID = foodID + 1;
  500.                    
  501.                          inventory.getItem(notedFoodID).interact("Sell 10");
  502.                          sleep(random(400, 800));
  503.                     }
  504.                    
  505.                 }else {
  506.                     o.interact("Trade");
  507.                     sleep(random(400, 800));
  508.                 }
  509.             } else {
  510.                 walkStore();
  511.             }
  512.         }
  513.             }
  514.         }
  515.         if(ash == true) {
  516.         ashloot(); 
  517.         sleep(random(600, 800));
  518.         scatter();
  519.         }
  520.        
  521.         if(exc == true) {      
  522.             excSpec();
  523.             rewield();
  524.         }
  525.        
  526.         if(b2b == true) {
  527.             dob2b();
  528.            
  529.         }
  530.        
  531.         if(b2p == true) {
  532.             dob2p();
  533.         }
  534.        
  535.           if(hellHounds == true) {
  536.  
  537.               RSObject fallyBooth = objects.getNearest(fallyBoothID);            
  538.             if(!inventory.contains(foodID) || !inventory.containsOneOf(prayerPot)) {
  539.                
  540.                 if(hellHoundsArea.contains(getMyPlayer().getLocation())) {
  541.                     fTele();
  542.                     sleep(random(600, 1000));
  543.                
  544.                 }else if(fallyTeleArea.contains(getMyPlayer().getLocation())) {
  545.                     status = "Walking to bank";
  546.                     RSPath pathToBank = walking.newTilePath(tilesToBank);
  547.                     pathToBank.traverse();
  548.                     sleep(random(1000, 1500));
  549.                 }else if(fallyTeleArea2.contains(getMyPlayer().getLocation())) {
  550.                     status = "Walking to bank";
  551.                     RSPath pathToBank2 = walking.newTilePath(tilesToBank2);
  552.                     pathToBank2.traverse();
  553.                     sleep(random(1000, 1500));
  554.                 }else if(fallyBooth != null && fallyBooth.isOnScreen()) {
  555.                     doBank();
  556.                     sleep(random(600, 1000));
  557.                 }
  558.         }
  559.            
  560.             if(inventory.contains(foodID) || inventory.contains(halfPie)) {
  561.                
  562.             if(fallyBankArea.contains(getMyPlayer().getLocation())) {
  563.                 status = "Walking to short cut";
  564.                 RSPath pathToinShortCut2 = walking.newTilePath(tilesToinShortCut2);
  565.                 pathToinShortCut2.traverse();
  566.             }else if(inShortCut2Area.contains(getMyPlayer().getLocation())) {
  567.                 camera.turnTo(sc2);
  568.             doShortCut2();
  569.             }else if(outShortCut2Area.contains(getMyPlayer().getLocation())) {
  570.                 walkTopLadder();
  571.           } else if(topLadderArea.contains(getMyPlayer().getLocation())) {
  572.               doTopLadder();
  573.           } else if(bottomLadderArea.contains(getMyPlayer().getLocation())) {
  574.               walkShortCut();
  575.           } else if(inshortCutArea.contains(getMyPlayer().getLocation())) {
  576.               doPie();
  577.               sleep(random(1000, 2000));
  578.               doFloor();
  579.               sleep(random(1500, 3000));
  580.           } else if(outshortCutArea.contains(getMyPlayer().getLocation())) {
  581.               walkHellHounds();
  582.           }
  583.            
  584.            
  585.             }
  586.            
  587.            
  588.           }
  589.        
  590.    
  591.        
  592.        
  593.         //auto retaliate
  594.         retaliate();
  595.        
  596.         //pots
  597.          attPot();
  598.          strPot();
  599.          defPot();
  600.          rngPot();
  601.          summPot();
  602.          antiPot();
  603.          
  604.          //loot    
  605.         loot();
  606.         lootGoldCharms();
  607.         lootGreenCharms();
  608.         lootCrimsonCharms();
  609.         lootBlueCharms();
  610.         lootGorgedEffigy();
  611.         lootNourishedEffigy();
  612.         lootStatedEffigy();
  613.         lootStarvedEffigy();
  614.         lootRare();
  615.         AllClues();
  616.         EasyClues();
  617.         MedClues();
  618.         HardClues();
  619.        
  620.          //summoning
  621.          summonBunyip();
  622.          summonUnicorn();
  623.          summonPackYak();
  624.          summonTort();
  625.          summonTerrorBird();
  626.          summonSnail();
  627.          summonAnt();
  628.          //unicornScroll();
  629.          //yakScroll();
  630.        
  631.          
  632.          //eating and healing
  633.         eat();                 
  634.        
  635.        
  636.        
  637.        
  638.         if(selectedNPCName == "Rock crab" && rock != null && npc != null && npc.isInCombat() && !getMyPlayer().isInCombat()) {
  639.             status = "Walking to rock to find a crab";
  640.             walking.walkTileMM(rock.getLocation());
  641.             sleep(random(600, 1000));
  642.            
  643.         }
  644.        
  645.         if(!getMyPlayer().isInCombat()) {
  646.         if(npc != null && !npc.isInCombat()){
  647.             if(getMyPlayer().getHPPercent() > 65) {
  648.                
  649.                 if(loot == null || calc.distanceTo(loot.getLocation()) > 10) {
  650.             if(npc.isOnScreen() && calc.distanceTo(npc.getLocation()) < 7){
  651.            
  652.                 npc.interact("Attack");
  653.                  status = "Attacking " + selectedNPCName;
  654.            
  655.             } else {
  656.                
  657.                       if(!inshortCutArea.contains(getMyPlayer().getLocation())) {
  658.                           status = "Walking to: " + selectedNPCName;
  659.                     walking.walkTileMM(npc.getLocation());
  660.                       }
  661.                     camera.turnTo(npc);
  662.                     while(getMyPlayer().isMoving())
  663.                         sleep(random(300,600));
  664.            
  665.            
  666.         }
  667.        }
  668.         }
  669.         }
  670.         }
  671.         if(getMyPlayer().isInCombat()) {
  672.             // if(spec == true) {
  673.                 // Spec();
  674.             //   sleep(random(600, 800));
  675.             //  rewield();
  676.         //  }
  677.            
  678.             //rewield();
  679.             status = "Fighting";                                   
  680.             if(random(1, 15) == 10) {
  681.                 antiBan();
  682.                 }
  683.         }
  684.        
  685.         if(!inventory.contains(foodID) && getMyPlayer().getHPPercent() < 40 && hellHounds == false) {
  686.             walkRandom();
  687.             sleep(random(600, 1000));
  688.             env.saveScreenshot(true);
  689.             sleep(random(600, 1000));
  690.             stopScript(true);
  691.         }
  692.      
  693.         return random(500, 1500);
  694.     }
  695.  
  696.    
  697.     //------------------------------------------METHODS-------------------------------------------------------------------
  698.  
  699.     ///////Hell houdns banking stuff/////
  700.    
  701.      private void fTele() {
  702.          if(inventory.contains(fTab)) {
  703.              status = "Teleporing to falador";
  704.              RSItem f = inventory.getItem(fTab);
  705.              f.interact("Break");
  706.              sleep(random(1000, 2000));
  707.          }
  708.        
  709.     }
  710.          
  711.          private void walkFallyBank() {
  712.              status = "Walking to bank";
  713.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), fallyBankTile);
  714.                 while (calc.distanceTo(fallyBankTile) > 4) {
  715.                     walkWeb.step();
  716.                     sleep(200, 800);
  717.                 }
  718.          }
  719.          
  720.          private void walkinShortCut2() {
  721.              status = "Walking to short cut";
  722.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), inShortCut2Tile);
  723.                 while (calc.distanceTo(inShortCut2Tile) > 4) {
  724.                     walkWeb.step();
  725.                     sleep(200, 800);
  726.                 }
  727.          }
  728.          
  729.          private void walkTopLadder() {
  730.              status = "Walking to taverly dungeon";
  731.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), topLadderTile);
  732.                 while (calc.distanceTo(topLadderTile) > 4) {
  733.                     walkWeb.step();
  734.                     sleep(200, 800);
  735.                 }
  736.          }
  737.          
  738.          private void walkShortCut() {
  739.              status = "Walking to short cut";
  740.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), shortCutTile);
  741.                 while (calc.distanceTo(shortCutTile) > 4) {
  742.                     walkWeb.step();
  743.                     sleep(200, 800);
  744.                 }
  745.          }
  746.          
  747.          private void walkHellHounds() {
  748.              status = "Walking to hell hounds";
  749.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), hellHoundsTile);
  750.                 while (calc.distanceTo(hellHoundsTile) > 4) {
  751.                     walkWeb.step();
  752.                     sleep(200, 800);
  753.                 }
  754.          }
  755.          
  756.          private void doShortCut2() {
  757.              RSObject w = objects.getNearest(shortCut2);
  758.              if(w != null && w.isOnScreen()) {
  759.        
  760.                  status = "Climbing-over wall";
  761.                  w.interact("Climb-over");
  762.                  sleep(200, 800);
  763.              }
  764.          }
  765.          
  766.          private void doTopLadder() {
  767.              RSObject l = objects.getNearest(topLadder);
  768.              if(l != null && l.isOnScreen()) {
  769.                  status = "Climbing into dungeon";
  770.                  l.interact("Climb-down");
  771.                  sleep(200, 800);
  772.              }
  773.          }
  774.          
  775.          private void doFloor() {
  776.              RSObject f = objects.getNearest(shortCut);
  777.              if(f != null && f.isOnScreen()) {
  778.                  status = "Jumping over wall";
  779.                  f.interact("Jump-over");
  780.                  sleep(200, 800);
  781.              }
  782.          }
  783.          
  784.          private void doPie() {  
  785.              if(skills.getCurrentLevel(Skills.AGILITY) <= skills.getRealLevel(Skills.AGILITY)) {
  786.                  status = "Eating summer pie";
  787.                   if(inventory.contains(summerPie)) {
  788.               RSItem pie = inventory.getItem(summerPie);
  789.           pie.interact("Eat");
  790.           sleep(random(600, 1000));
  791.                   }      
  792.          }
  793.          }
  794.          
  795.          private void doBank() {
  796.              RSObject booth = objects.getNearest(fallyBoothID);
  797.              camera.turnTo(booth);
  798.              if (bank.isOpen()) {                
  799.                  status = "Depositing";
  800.                 bank.depositAllExcept(fTab, attPotion, strPotion, defPotion, foodID, ppotID4);
  801.                 sleep(200, 300);
  802.                 status = "Withdrawing items";
  803.                 if(pray == false) {
  804.                bank.withdraw(foodID, 20);
  805.                bank.withdraw(antiPot4, 1);
  806.                 }
  807.                if(pray == true) {
  808.                    bank.withdraw(ppotID4, 20);
  809.                    bank.withdraw(foodID, 1);
  810.                    bank.withdraw(antiPot4, 1);
  811.                    sleep(random(400, 600));
  812.                }
  813.                 sleep(random(400, 600));
  814.                 bank.close();
  815.         }
  816.         else {
  817.             status = "Opening bank";
  818.                 bank.open();
  819.                 sleep(random(200, 400));
  820.         }
  821.     }
  822.          
  823.     ////////////////////////////////////////
  824.     //-----------------------------------------MISC----------------------------------------------------------------------
  825.        
  826.          
  827.     private void bones() {     
  828.             if(inventory.containsOneOf(bonesID)) {
  829.                 final RSItem bones = inventory.getItem(bonesID);
  830.                 bones.interact("Bury");
  831.                 status = "Bury bones";
  832.             }return;
  833.                
  834.     }
  835.    
  836.  
  837.     private void scatter() {
  838.        
  839.             if(inventory.containsOneOf(ashID)) {
  840.                 final RSItem a = inventory.getItem(ashID);
  841.                 a.interact("Scatter");
  842.                 status = "Scattering ashes";
  843.             }
  844.            
  845.         return;
  846.     }
  847.    
  848.     private void dob2b() {
  849.         if(!inventory.contains(bananasID) && inventory.contains(b2bID) && inventory.contains(regbonesID)) {
  850.             final RSItem b = inventory.getItem(b2bID);
  851.             b.interact("Break");
  852.             status = "Breaking Bones to bananas tab";
  853.             sleep(random(1000, 1500));
  854.         }return;
  855.     }
  856.    
  857.     private void dob2p() {
  858.         if(!inventory.contains(peachesID) && inventory.contains(b2pID) && inventory.contains(regbonesID)) {
  859.             final RSItem p = inventory.getItem(b2pID);
  860.             p.interact("Break");
  861.             status = "Breaking Bones to peaches tab";
  862.             sleep(random(1000, 1500));
  863.         }return;
  864.     }
  865.    
  866.     //EATS
  867.      private void eat() {
  868.          if(inventory.contains(foodID)) {
  869.             if (combat.getHealth() <= 70) {
  870.              
  871.              RSItem food = inventory.getItem(foodID);
  872.             food.interact("Eat");
  873.             status = "Healing";
  874.             log("Low on HP eating");
  875.            
  876. }
  877.          }
  878. }
  879.      
  880.  //-------------------------------------------------POTIONS----------------------------------------------------------
  881.    
  882.      private void att4() {
  883.          if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK)) {
  884.          if (inventory.containsOneOf(attPotion)) {
  885.              RSItem apot = inventory.getItem(attPotion);
  886.              if (inventory.containsOneOf(attPotion)) {
  887.                  status = "Drinking attack Pot";
  888.              apot.interact("Drink");
  889.                  }                        }
  890.              }
  891.      }
  892.      private void att3() {
  893.          if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK)) {
  894.          if (inventory.containsOneOf(attPotion3)) {
  895.              RSItem apot3 = inventory.getItem(attPotion3);
  896.              if (inventory.containsOneOf(attPotion)) {
  897.                  status = "Drinking attack Pot";
  898.              apot3.interact("Drink");
  899.                  }                        }
  900.              }
  901.      }
  902.     //Attack potion method
  903.      private void attPot() {
  904.          if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion)) {
  905.              RSItem att = inventory.getItem(attPotion);
  906.              att.interact("Drink");
  907.              status = "Drinking Potions";
  908.          }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) &&
  909.                  inventory.contains(attPotion3)) {
  910.              RSItem att3 = inventory.getItem(attPotion3);
  911.              att3.interact("Drink");
  912.              status = "Drinking Potions";
  913.              
  914.              
  915.          }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion2)) {
  916.              RSItem att2 = inventory.getItem(attPotion2);
  917.              att2.interact("Drink");
  918.              status = "Drinking Potions";
  919.              
  920.              
  921.          }else if(skills.getCurrentLevel(Skills.ATTACK) <= skills.getRealLevel(Skills.ATTACK) && inventory.contains(attPotion1)) {
  922.              RSItem att1 = inventory.getItem(attPotion1);
  923.              att1.interact("Drink");
  924.              status = "Drinking Potions";
  925.              
  926.              
  927.          }
  928.                  return;
  929.      }
  930.      
  931.      //Strength potion method
  932.       private void strPot() {
  933.       if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion)) {
  934.          RSItem strPot = inventory.getItem(strPotion);
  935.       strPot.interact("Drink");
  936.       status = "Drinking Potions";
  937.          sleep(random(200, 400));      
  938.       }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH)&&
  939.                  inventory.contains(strPotion3)) {
  940.              RSItem str3 = inventory.getItem(strPotion3);
  941.              str3.interact("Drink");
  942.              status = "Drinking Potions";
  943.              
  944.              
  945.          }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion2)) {
  946.              RSItem str2 = inventory.getItem(strPotion2);
  947.              str2.interact("Drink");
  948.              status = "Drinking Potions";
  949.              
  950.              
  951.          }else if(skills.getCurrentLevel(Skills.STRENGTH) <= skills.getRealLevel(Skills.STRENGTH) && inventory.contains(strPotion1)) {
  952.              RSItem str1 = inventory.getItem(strPotion1);
  953.              str1.interact("Drink");
  954.              status = "Drinking Potions";
  955.              
  956.              
  957.          }
  958.      
  959.      
  960.       return;
  961.          
  962.          
  963.       }
  964.      
  965.      //Defence potion method
  966.       private void defPot() {
  967.       if(skills.getCurrentLevel(Skills.DEFENSE) <= skills.getRealLevel(Skills.DEFENSE)&& inventory.contains(defPotion)) {
  968.          RSItem defPot = inventory.getItem(defPotion);
  969.          defPot.interact("Drink");
  970.          status = "Drinking Potions";
  971.          sleep(random(200, 400));
  972.       }return;
  973.          
  974.          
  975.      }
  976.      
  977.      //Ranging potion method
  978.       private void rngPot() {
  979.          if(skills.getCurrentLevel(Skills.RANGE) <= skills.getRealLevel(Skills.RANGE)&& inventory.contains(rngPotion)) {
  980.          RSItem rngPot = inventory.getItem(rngPotion);
  981.          rngPot.interact("Drink");
  982.         status = "Drinking Potions";
  983.          sleep(random(200, 400));
  984.       }return;
  985.          
  986.          
  987.       }
  988.  
  989.     //Summonng potion method
  990.       private void summPot() {
  991.         if(summoning.getSummoningPoints() < 10 && inventory.contains(pouchID)) {
  992.          RSItem summPot = inventory.getItem(summPotID);
  993.          summPot.interact("Drink");
  994.         status = "Drinking summoing potion";
  995.          sleep(random(200, 400));
  996.       }return;
  997.          
  998.          
  999.       }
  1000.      
  1001.       private void prayerPot() {
  1002.           if(prayer.getPrayerLeft() < 30) {
  1003.           if (inventory.containsOneOf(prayerPot)) {
  1004.               RSItem ppot = inventory.getItem(prayerPot);
  1005.               if (inventory.containsOneOf(prayerPot)) {
  1006.                   status = "Drinking Prayer potion";
  1007.               ppot.interact("Drink");
  1008.                   }                        
  1009.               }}}
  1010.      
  1011.       private void pPot() {
  1012.           if(prayer.getPrayerLeft() < 30) {
  1013.             if(inventory.contains(ppotID4)
  1014.                      ) {
  1015.                  RSItem p4 = inventory.getItem(ppotID4);
  1016.                  p4.interact("Drink"); 
  1017.           }else if(inventory.contains(ppotID3)
  1018.                      ) {
  1019.                  RSItem p3 = inventory.getItem(ppotID3);
  1020.                  p3.interact("Drink");
  1021.              }else if(inventory.contains(ppotID2)) {
  1022.                  RSItem p2 = inventory.getItem(ppotID2);
  1023.                  p2.interact("Drink");
  1024.              }else if(inventory.contains(ppotID1)) {
  1025.                  RSItem p1 = inventory.getItem(ppotID1);
  1026.                  p1.interact("Drink");   
  1027.              }
  1028.           }
  1029.           }
  1030.      
  1031.      
  1032.       private void antiPot() {
  1033.           if(combat.isPoisoned()) {
  1034.           if (inventory.containsOneOf(antiPot)) {
  1035.               RSItem a = inventory.getItem(antiPot);
  1036.               if (inventory.containsOneOf(antiPot)) {
  1037.                   status = "Drinking anti poision";
  1038.               a.interact("Drink");
  1039.                   }                        
  1040.               }}}
  1041.      
  1042.      
  1043.      //
  1044.      //----------------------------------------------------END POTION METHODS-----------------------------------------------
  1045.      //
  1046.      
  1047.      
  1048.      
  1049.      //
  1050.      //-----------------------------------------------------SUMMONING METHODS----------------------------------------------
  1051.      //
  1052.      
  1053.      
  1054.      //uses unicorn special attack if low hp and high enough summ lvl and famil is out and enough spec
  1055.       private void unicornScroll() {
  1056.          RSNPC u = npcs.getNearest(uniID);
  1057.       if(getMyPlayer().getHPPercent() < 75 && summoning.isFamiliarSummoned() && u.isOnScreen() &&
  1058.              inventory.getCount(unicornScrollsID) >= 1) { //BROKEN need to know how to check current famil spec attck
  1059.                      //  summoning.doCast();
  1060.           status = "Casting, Healing aura";
  1061.          }return;
  1062.       }
  1063.  
  1064.      //Teleports loot to bank with yak
  1065.       private void yakScroll() {
  1066.       RSNPC yak = npcs.getNearest(yakID);
  1067.       if(inventory.isFull() && summoning.isFamiliarSummoned() && yak.isOnScreen() &&
  1068.          inventory.getCount(packYakScrollsID) >= 1) { //BROKEN need to know how to check current famil spec attck
  1069.      RSItem L = inventory.getItem(yakTeleLootID);
  1070.     summoning.doCast();
  1071.         L.interact("Use");
  1072.     yak.interact("Use"); //need to change this
  1073.     status = "Casting, Winter Storage";
  1074.            
  1075.     }
  1076.          
  1077.       }
  1078.      
  1079.      //summons unicorn
  1080.      private void summonUnicorn() {
  1081.          if (inventory.containsOneOf(unicornID)) {
  1082.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 69) {
  1083.  
  1084.                  RSItem lobster = inventory.getItem(unicornID);
  1085.                  lobster.interact("Summon");
  1086.                  log("Summoned a Unicorn Stallion.");
  1087.                  status = "Summoning unicorn stallion";
  1088.              }
  1089.            }
  1090.          return;
  1091.       }
  1092.      
  1093.      //summons bunyip
  1094.      private void summonBunyip() {
  1095.          if (inventory.containsOneOf(bunyipID)) {
  1096.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 69) {
  1097.  
  1098.                  RSItem lobster = inventory.getItem(bunyipID);
  1099.                  lobster.interact("Summon");
  1100.                  log("Summoned a Bunyip.");
  1101.                  status = "Summoning Bunyip";
  1102.              }
  1103.            }
  1104.          return;
  1105.       }
  1106.      
  1107.      //summons Pack yak
  1108.      private void summonPackYak() {
  1109.          if (inventory.getCount(packYakID) >= 1) {
  1110.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 96) {
  1111.  
  1112.                  RSItem y = inventory.getItem(bunyipID);
  1113.                 y.interact("Summon");
  1114.                  log("Summoned a Pack Yak.");
  1115.                  status = "Summoning Pack yak";
  1116.              }
  1117.            }
  1118.          return;
  1119.       }
  1120.      
  1121.      //summons war tortoise
  1122.      private void summonTort() {
  1123.          if (inventory.getCount(warTortoiseID) >= 1) {
  1124.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 67) {
  1125.  
  1126.                  RSItem w = inventory.getItem(warTortoiseID);
  1127.                  w.interact("Summon");
  1128.                  log("Summoned a War Tortoise.");
  1129.                  status = "Summoning war tortoise";
  1130.              }
  1131.            }
  1132.          return;
  1133.       }
  1134.      
  1135.      //summons snail
  1136.      private void summonSnail() {
  1137.          if (inventory.containsOneOf(snailID)) {
  1138.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 3) {
  1139.  
  1140.                  RSItem a = inventory.getItem(snailID);
  1141.                  a.interact("Summon");
  1142.                  log("Summoned a Snail.");       
  1143.                  status = "Summoning snail";
  1144.              }
  1145.                  }
  1146.          return;
  1147.       }
  1148.      
  1149.      //summons terror bird
  1150.      private void summonTerrorBird() {
  1151.          if (inventory.containsOneOf(terrorBirdID)) {
  1152.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 40) {
  1153.  
  1154.                  RSItem t = inventory.getItem(terrorBirdID);
  1155.                  t.interact("Summon");
  1156.                  log("Summoned a Terror bird.");
  1157.                  status = "Summoning Terror brid";
  1158.              }
  1159.            }
  1160.          return;
  1161.       }
  1162.      
  1163.      //summons bull ant
  1164.      private void summonAnt() {
  1165.          if (inventory.containsOneOf(bullAntID)) {
  1166.              if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 40) {
  1167.  
  1168.                  RSItem t = inventory.getItem(bullAntID);
  1169.                  t.interact("Summon");
  1170.                  log("Summoned a Bull Ant.");
  1171.                  status = "Summoning Bull Ant";
  1172.              }
  1173.            }
  1174.          return;
  1175.       }
  1176.      
  1177.      //
  1178.      //--------------------------------------------END OF SUMMONING METHODS-------------------------------------------
  1179.      //
  1180.      
  1181.      
  1182.      
  1183.      //
  1184.      //---------------------------------SPECIAL ATTACKS-----------------------------------------------
  1185.      //
  1186.      
  1187.      
  1188.      //uses enchanted excalibur to heal if its in equipment or equipts ifd needed
  1189.      private void excSpec() {
  1190.             if(equipment.containsOneOf(excID)) {
  1191.               if (getMyPlayer().getHPPercent() < 50 && combat.getSpecialBarEnergy() >= 100) {
  1192.               combat.setSpecialAttack(true);
  1193.               }//wLRCOFFICIAL  BY WAAO
  1194.             }else{
  1195.                 if(getMyPlayer().getHPPercent() < 50 && combat.getSpecialBarEnergy() >= 100 &&
  1196.            
  1197.                          !equipment.containsOneOf(excID) && inventory.containsOneOf(excID)) {
  1198.                      RSItem exc = inventory.getItem(excID);
  1199.                          exc.interact("Wield");
  1200.                      sleep(200, 400);
  1201.                      status = "Healing with excalibur";
  1202.                 }
  1203.             }
  1204.             return;
  1205.           }
  1206.      
  1207.          
  1208.          
  1209.      private void Spec() {
  1210.          RSItem spec = inventory.getItem(specID);
  1211.          if(combat.getSpecialBarEnergy() >= 60) {
  1212.          if(spec != null && equipment.containsOneOf(specID)) {
  1213.            
  1214.              combat.setSpecialAttack(true);
  1215.              
  1216.          }else{
  1217.                      
  1218.              spec.interact("Wield");
  1219.            
  1220.          }
  1221.          }
  1222.      }
  1223.      
  1224.      private void rewield() {
  1225.          RSItem wep = inventory.getItem(weaponID);
  1226.          
  1227.          if(!equipment.containsOneOf(weaponID)) {
  1228.              if(combat.getSpecialBarEnergy() < 60) {
  1229.                  
  1230.              if(inventory.contains(weaponID)) {
  1231.                
  1232.              status = "Re-wielding primary weapon";
  1233.              wep.interact("Wield");
  1234.              sleep(random(200, 600));
  1235.          }
  1236.          }
  1237.              }       
  1238.          
  1239.      }
  1240.      
  1241.      
  1242.      //
  1243.      //---------------------------------END SPECIAL ATTACKS-----------------------------------------------
  1244.      //
  1245.      
  1246.      
  1247.      
  1248.  
  1249.      //
  1250.      //LOOTING METHODS
  1251.      //
  1252.              
  1253.          
  1254.      private int getPrice(final String lootName){
  1255.          for(int i = 0; i < LootNames.length; i++){
  1256.          if(LootNames[i].equals(lootName))
  1257.          return LootPrices[i];
  1258.          }
  1259.          return -1;
  1260.          }
  1261.      
  1262.      private void loot() {
  1263.          
  1264.                 RSGroundItem loot = groundItems.getNearest(LootNames);
  1265.                
  1266.                 if (loot != null) {
  1267.                     if (!inventory.isFull()) {
  1268.                     if (loot.isOnScreen()) {
  1269.                        
  1270.                         loot.interact("Take " + loot.getItem().getName());
  1271.                         status = "Looting";
  1272.                         sleep(random(3000, 600));
  1273.                        
  1274.                     } else {
  1275.                         walking.walkTileMM(loot.getLocation());
  1276.                         status = "Walking to loot";
  1277.                     }
  1278.                
  1279.             }else {
  1280.                 if(inventory.isFull() && inventory.contains(foodID)) {
  1281.                     RSItem f = inventory.getItem(foodID);
  1282.                     f.interact("Eat");
  1283.                     status = "Eating for loot space";
  1284.                 }
  1285.             }
  1286.            
  1287.             }return;
  1288.      }
  1289.      
  1290.      private void lootRare() {
  1291.          RSGroundItem loot = groundItems.getNearest(rareLootID);
  1292.          if (!inventory.isFull()) {
  1293.              
  1294.                 if (loot != null) {
  1295.                     if (loot.isOnScreen()) {
  1296.                         loot.interact("Take");
  1297.                         status = "Looting";
  1298.                         sleep(1000, 1200);
  1299.                        
  1300.                        
  1301.                     } else {
  1302.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1303.                         sleep(800, 1000);
  1304.                         status = "Walking to loot";
  1305.                     }
  1306.                 }
  1307.             }else {
  1308.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1309.                     RSItem f = inventory.getItem(foodID);
  1310.                     f.interact("Eat");
  1311.                     status = "Eating for loot space";
  1312.                 }
  1313.            
  1314.             }return;
  1315.      }
  1316.      
  1317.      private void lootStarvedEffigy() {
  1318.          RSGroundItem loot = groundItems.getNearest(StarvedffigyID);
  1319.          if (!inventory.isFull()) {
  1320.              
  1321.                 if (loot != null) {
  1322.                     if (loot.isOnScreen()) {
  1323.                         loot.interact("Take");
  1324.                         status = "Looting";
  1325.                         sleep(1000, 1200);
  1326.                        
  1327.                        
  1328.                     } else {
  1329.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1330.                         sleep(800, 1000);
  1331.                         status = "Walking to loot";
  1332.                     }
  1333.                 }
  1334.             }else {
  1335.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1336.                     RSItem f = inventory.getItem(foodID);
  1337.                     f.interact("Eat");
  1338.                     status = "Eating for loot space";
  1339.                 }
  1340.            
  1341.             }return;
  1342.      }
  1343.      
  1344.      private void lootNourishedEffigy() {
  1345.          RSGroundItem loot = groundItems.getNearest(NourishedeffigyID);
  1346.          if (!inventory.isFull()) {
  1347.              
  1348.                 if (loot != null) {
  1349.                     if (loot.isOnScreen()) {
  1350.                         loot.interact("Take");
  1351.                         status = "Looting";
  1352.                         sleep(1000, 1200);
  1353.                        
  1354.                        
  1355.                     } else {
  1356.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1357.                         sleep(800, 1000);
  1358.                         status = "Walking to loot";
  1359.                     }
  1360.                 }
  1361.             }else {
  1362.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1363.                     RSItem f = inventory.getItem(foodID);
  1364.                     f.interact("Eat");
  1365.                     status = "Eating for loot space";
  1366.                 }
  1367.            
  1368.             }return;
  1369.      }
  1370.      
  1371.      private void lootStatedEffigy() {
  1372.          RSGroundItem loot = groundItems.getNearest(SatedeffigyID);
  1373.          if (!inventory.isFull()) {
  1374.              
  1375.                 if (loot != null) {
  1376.                     if (loot.isOnScreen()) {
  1377.                         loot.interact("Take");
  1378.                         status = "Looting";
  1379.                         sleep(1000, 1200);
  1380.                        
  1381.                        
  1382.                     } else {
  1383.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1384.                         sleep(800, 1000);
  1385.                         status = "Walking to loot";
  1386.                     }
  1387.                 }
  1388.             }else {
  1389.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1390.                     RSItem f = inventory.getItem(foodID);
  1391.                     f.interact("Eat");
  1392.                     status = "Eating for loot space";
  1393.                 }
  1394.            
  1395.             }return;
  1396.      }
  1397.      
  1398.      private void lootGorgedEffigy() {
  1399.          RSGroundItem loot = groundItems.getNearest(GorgedeffigyID);
  1400.          if (!inventory.isFull()) {
  1401.              
  1402.                 if (loot != null) {
  1403.                     if (loot.isOnScreen()) {
  1404.                         loot.interact("Take");
  1405.                         status = "Looting";
  1406.                         sleep(1000, 1200);
  1407.                        
  1408.                        
  1409.                     } else {
  1410.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1411.                         sleep(800, 1000);
  1412.                         status = "Walking to loot";
  1413.                     }
  1414.                 }
  1415.             }else {
  1416.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1417.                     RSItem f = inventory.getItem(foodID);
  1418.                     f.interact("Eat");
  1419.                     status = "Eating for loot space";
  1420.                 }
  1421.            
  1422.             }return;
  1423.      }
  1424.      
  1425.      private void lootGoldCharms() {
  1426.          RSGroundItem loot = groundItems.getNearest(goldCharmID);
  1427.          if (!inventory.isFull()) {
  1428.              
  1429.                 if (loot != null) {
  1430.                     if (loot.isOnScreen()) {
  1431.                         loot.interact("Take Gold Charm");
  1432.                         status = "Looting";
  1433.                         sleep(1000, 1200);
  1434.                        
  1435.                        
  1436.                     } else {
  1437.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1438.                         sleep(800, 1000);
  1439.                         status = "Walking to loot";
  1440.                     }
  1441.                 }
  1442.             }else {
  1443.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1444.                     RSItem f = inventory.getItem(foodID);
  1445.                     f.interact("Eat");
  1446.                     status = "Eating for loot space";
  1447.                 }
  1448.            
  1449.             }return;
  1450.      }
  1451.      
  1452.      private void lootGreenCharms() {
  1453.          RSGroundItem loot = groundItems.getNearest(greenCharmID);
  1454.        
  1455.          if (!inventory.isFull()) {
  1456.                
  1457.                 if (loot != null) {
  1458.                     if (loot.isOnScreen()) {
  1459.                         loot.interact("Take Green Charm");
  1460.                         status = "Looting";
  1461.                         sleep(1000, 1200);
  1462.                        
  1463.                     } else {
  1464.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1465.                         sleep(800, 1000);
  1466.                         status = "Walking to loot";
  1467.                     }
  1468.                 }
  1469.             }else {
  1470.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1471.                     RSItem f = inventory.getItem(foodID);
  1472.                     f.interact("Eat");
  1473.                     status = "Eating for loot space";
  1474.                 }
  1475.            
  1476.             }return;
  1477.      }
  1478.      private void lootCrimsonCharms() {
  1479.          RSGroundItem loot = groundItems.getNearest(crimsonCharmID);
  1480.          if (!inventory.isFull()) {
  1481.            
  1482.                 if (loot != null) {
  1483.                     if (loot.isOnScreen()) {
  1484.                         loot.interact("Take Crimson Charm");
  1485.                         status = "Looting";
  1486.                         sleep(1000, 1200);
  1487.                        
  1488.                     } else {
  1489.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1490.                         sleep(800, 1000);
  1491.                         status = "Walking to loot";
  1492.                     }
  1493.                 }
  1494.             }else {
  1495.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1496.                     RSItem f = inventory.getItem(foodID);
  1497.                     f.interact("Eat");
  1498.                     status = "Eating for loot space";
  1499.                 }
  1500.            
  1501.             }return;
  1502.      }
  1503.      private void lootBlueCharms() {
  1504.          RSGroundItem loot = groundItems.getNearest(blueCharmID);
  1505.          if (!inventory.isFull()) {
  1506.              
  1507.                 if (loot != null) {
  1508.                     if (loot.isOnScreen()) {
  1509.                         loot.interact("Take Blue Charm");
  1510.                         status = "Looting";
  1511.                         sleep(1000, 1200);
  1512.                        
  1513.                     } else {
  1514.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1515.                         sleep(800, 1000);
  1516.                         status = "Walking to loot";
  1517.                     }
  1518.                 }
  1519.             }else {
  1520.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1521.                     RSItem f = inventory.getItem(foodID);
  1522.                     f.interact("Eat");
  1523.                     status = "Eating for loot space";
  1524.                 }
  1525.            
  1526.             }return;
  1527.      }
  1528.      
  1529.      private void EasyClues() {
  1530.      String NAME = "Clue scroll (easy)";//The exact name
  1531.      RSGroundItem g = groundItems.getNearest(NAME);
  1532.      if(g != null){
  1533.          g.interact("Take " + g.getItem().getName());
  1534.      }
  1535.      }
  1536.      
  1537.      private void MedClues() {
  1538.          String NAME = "Clue scroll (medium)";//The exact name
  1539.          RSGroundItem g = groundItems.getNearest(NAME);
  1540.          if(g != null){
  1541.              g.interact("Take " + g.getItem().getName());
  1542.          }
  1543.          }
  1544.      
  1545.      private void HardClues() {
  1546.          String NAME = "Clue scroll (hard)";//The exact name
  1547.          RSGroundItem g = groundItems.getNearest(NAME);
  1548.          if(g != null){
  1549.              g.interact("Take " + g.getItem().getName());
  1550.          }
  1551.          }
  1552.      
  1553.      private void AllClues() {
  1554.          String NAME = "Clue scroll ";//The exact name
  1555.          RSGroundItem g = groundItems.getNearest(NAME);
  1556.          if(g != null){
  1557.              g.interact("Take " + g.getItem().getName());
  1558.          }
  1559.          }
  1560.      
  1561.      private void lootEasyClue() {
  1562.          RSGroundItem loot = groundItems.getNearest(EasyClueID);
  1563.        
  1564.          if (!inventory.isFull()) {
  1565.                
  1566.                 if (loot != null) {
  1567.                     if (loot.isOnScreen()) {
  1568.                         loot.interact("Take");
  1569.                         status = "Looting";
  1570.                         sleep(1000, 1200);
  1571.                        
  1572.                     } else {
  1573.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1574.                         sleep(800, 1000);
  1575.                         status = "Walking to loot";
  1576.                     }
  1577.                 }
  1578.             }else {
  1579.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1580.                     RSItem f = inventory.getItem(foodID);
  1581.                     f.interact("Eat");
  1582.                     status = "Eating for loot space";
  1583.                 }
  1584.            
  1585.             }return;
  1586.      }
  1587.      
  1588.      private void lootMediumClue() {
  1589.          RSGroundItem loot = groundItems.getNearest(MediumClueID);
  1590.        
  1591.          if (!inventory.isFull()) {
  1592.                
  1593.                 if (loot != null) {
  1594.                     if (loot.isOnScreen()) {
  1595.                         loot.interact("Take");
  1596.                         status = "Looting";
  1597.                         sleep(1000, 1200);
  1598.                        
  1599.                     } else {
  1600.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1601.                         sleep(800, 1000);
  1602.                         status = "Walking to loot";
  1603.                     }
  1604.                 }
  1605.             }else {
  1606.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1607.                     RSItem f = inventory.getItem(foodID);
  1608.                     f.interact("Eat");
  1609.                     status = "Eating for loot space";
  1610.                 }
  1611.            
  1612.             }return;
  1613.      }
  1614.      
  1615.      private void lootHardClue() {
  1616.          RSGroundItem loot = groundItems.getNearest(HardClueID);
  1617.        
  1618.          if (!inventory.isFull()) {
  1619.                
  1620.                 if (loot != null) {
  1621.                     if (loot.isOnScreen()) {
  1622.                         loot.interact("Take");
  1623.                         status = "Looting";
  1624.                         sleep(1000, 1200);
  1625.                        
  1626.                     } else {
  1627.                         walking.walkTileMM(loot.getLocation(), 2, 2);
  1628.                         sleep(800, 1000);
  1629.                         status = "Walking to loot";
  1630.                     }
  1631.                 }
  1632.             }else {
  1633.                 if(inventory.isFull() && inventory.contains(foodID) && loot != null) {
  1634.                     RSItem f = inventory.getItem(foodID);
  1635.                     f.interact("Eat");
  1636.                     status = "Eating for loot space";
  1637.                 }
  1638.            
  1639.             }return;
  1640.      }
  1641.      
  1642.      //loots bones
  1643.      private void boneloot() {
  1644.          RSGroundItem b = groundItems.getNearest(bonesID);
  1645.          if (!inventory.isFull()) {
  1646.                
  1647.                 if (b != null) {
  1648.                      if(calc.distanceTo(b.getLocation()) < 8) {
  1649.                     if (b.isOnScreen()) {
  1650.                         b.interact("Take " + b.getItem().getName());
  1651.                         sleep(1000, 1200);
  1652.                         status = "Looting bones";
  1653.                     } else {
  1654.                         walking.walkTileMM(b.getLocation(), 2, 2);
  1655.                         sleep(800, 1000);
  1656.                         status = "Walking to bones";
  1657.                     }
  1658.                
  1659.             }
  1660.          }
  1661.          }
  1662.      }
  1663.      
  1664.     //loots ashes
  1665.      private void ashloot() {
  1666.          RSGroundItem a = groundItems.getNearest(ashID);       
  1667.          if (!inventory.isFull()) {
  1668.              if(calc.distanceTo(a.getLocation()) < 8) {
  1669.                 if (a != null) {
  1670.                     if (a.isOnScreen()) {
  1671.                         a.interact("Take");
  1672.                         status = "Looting ashes";
  1673.                         sleep(1000, 1200);
  1674.                        
  1675.                     } else {
  1676.                         walking.walkTileMM(a.getLocation(), 1, 1);
  1677.                         status = "Walking to ashes";
  1678.                         sleep(800, 1000);
  1679.                     }
  1680.                 }          
  1681.          }}
  1682.      }
  1683.      
  1684.            
  1685.      //
  1686.      //END LOOTING METHODS
  1687.      //
  1688.      
  1689.      //turns on run
  1690.        public void setRun() {
  1691.            
  1692.           if(walking.getEnergy() > 40 && !walking.isRunEnabled())
  1693.           {
  1694.                status = "Turning run ON";
  1695.                   walking.setRun(true);
  1696.                
  1697.                  
  1698.           }
  1699.   }
  1700.        private void mine() {
  1701.              RSNPC rock = npcs.getNearest(deadID);
  1702.              if (rock != null) {
  1703.              if(rock.isOnScreen()) {
  1704.                      if (inventory.containsOneOf(pickaxeID)) {
  1705.                      rock.interact("Mine");
  1706.                      status = "Mining dead rock creature";
  1707.                      sleep(200, 400);
  1708.                      }
  1709.                  }
  1710.              }
  1711.          }
  1712.        
  1713.        private void retaliate() {
  1714.           if(combat.isAutoRetaliateEnabled() == false) {
  1715.               status = "You need auto retaliate ON";
  1716.           log(Color.red,"Please start with auto retaliate enabled");
  1717.           stopScript(true);
  1718.           }
  1719.            
  1720.            return;
  1721.        }
  1722.        
  1723.        private void walkRandom() {
  1724.            status = "Walking random";
  1725.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), randomTile);
  1726.                 while (calc.distanceTo(randomTile) > 4) {
  1727.                     walkWeb.step();
  1728.                     sleep(200, 800);
  1729.                 }
  1730.        }
  1731.        
  1732.        private void walkStore() {
  1733.            status = "Walking to store";
  1734.              final RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), storeTile);
  1735.                 while (calc.distanceTo(storeTile) > 4) {
  1736.                     walkWeb.step();
  1737.                     sleep(200, 800);
  1738.                 }
  1739.        }
  1740.        
  1741.         // Credits to float for getClosestNPCs method and related
  1742.        
  1743.        
  1744.        private int[] LootAmount;
  1745.        private int getTotalLootCount(){
  1746.        int count = 0;
  1747.        for(int i = 0; i < LootNames.length; i++) {
  1748.        count += LootPrices[i] * LootAmount[i];
  1749.      
  1750.        }
  1751.        return count;
  1752.        }
  1753.        
  1754.        private int getTotalPriceCount(){
  1755.            int count = 0;
  1756.            for(int i = 0; i < LootNames.length; i++) {
  1757.            count += LootPrices[i];
  1758.            }
  1759.            return count;
  1760.            }
  1761.        
  1762.        private RSNPC[] getClosestNPCs() {
  1763.             final ArrayList<RSNPC> array = new ArrayList<RSNPC>();
  1764.             final RSNPC[] allNPC = npcs.getAll(new Filter<RSNPC>() {
  1765.                 @Override
  1766.                 public boolean accept(final RSNPC npc) {
  1767.                     return npc != null && npc.getLevel() > 0;
  1768.                 }
  1769.             }); int k = 0;
  1770.             tag: for (int emtF = k; emtF < allNPC.length; emtF++) {
  1771.                 for(int i = 0; i < array.size(); i++){
  1772.                     if(array.get(i).getName().equals(allNPC[emtF].getName())){
  1773.                         k++;
  1774.                         continue tag;
  1775.                     }
  1776.                 }
  1777.                 array.add(allNPC[emtF]);
  1778.              }
  1779.              final RSNPC[] npcList = new RSNPC[array.size()];
  1780.              for (int i = 0; i < array.size(); i++) {
  1781.                 npcList[i] = array.get(i);
  1782.              }
  1783.            return npcList;
  1784.         }
  1785.        private String[] getItems(){
  1786.             final ArrayList<String> array = new ArrayList<String>();
  1787.             for(final RSItem invItem : inventory.getItems(true)){
  1788.                 if(invItem != null && invItem.getID() != -1
  1789.                         && !array.contains(invItem.getName())){
  1790.                     array.add(invItem.getName());
  1791.                 }
  1792.             }
  1793.             for(final RSGroundItem gItem : groundItems.getAll()){
  1794.                 if(gItem != null && gItem.getItem().getID() != -1
  1795.                         && !array.contains(gItem.getItem().getName())){
  1796.                     array.add(gItem.getItem().getName());
  1797.                 }
  1798.             }
  1799.             return array.toArray(new String[array.size()]);
  1800.         }
  1801.     @Override
  1802.     public void onFinish() {
  1803.         status = "Taking screen shot";
  1804.         env.saveScreenshot(true);
  1805.         status = "Shutting down";
  1806.         log("If you belive the bot shut down because of a bug please report.");
  1807.         log(Color.RED,"wFighter stopped.");
  1808.         log(Color.GREEN,"Thanks for using wFighter!");
  1809.        
  1810.     }
  1811.  
  1812.     private void antiBan() {
  1813.         int r = random(0, 15);
  1814.         switch (r) {
  1815.      
  1816.                 case 3:
  1817.                      mouse.move(120, 0);
  1818.                      log(Color.ORANGE,"Antiban activated, mouse moves accross screen.");
  1819.                      sleep(random(500, 800));
  1820.                 break;
  1821.                        
  1822.                 case 4:
  1823.                     camera.setPitch(random(360, 0));
  1824.                     sleep(random(450, 650));
  1825.                     log(Color.ORANGE,"Antiban activated, camera sets random angle.");
  1826.                 break;
  1827.                    
  1828.                 case 5:
  1829.                     camera.setPitch(random(0, 280));
  1830.                     sleep(random(450, 650));
  1831.                     log(Color.ORANGE,"Antiban activated, camera sets random angle.");
  1832.                 break;
  1833.                
  1834.                 case 7:
  1835.                         mouse.moveSlightly();
  1836.                         log(Color.ORANGE,"Antiban activated, mouse moves randomly.");
  1837.                  break;
  1838.                        
  1839.                 case 11:
  1840.                     mouse.moveOffScreen();
  1841.                     log(Color.ORANGE,"Antiban activated, mouse moves off screen.");
  1842.                 break;
  1843.                    
  1844.                 case 16:
  1845.                         camera.setPitch(random(0, 360));
  1846.                         sleep(random(450, 650));
  1847.                         log(Color.ORANGE,"Antiban activated, camera sets random angle.");
  1848.                  break;
  1849.                  
  1850.                 case 17:
  1851.                     mouse.move(60, 260);
  1852.                     log(Color.ORANGE,"Antiban activated, mouse randomly.");
  1853.                     sleep(random(500, 800));
  1854.                break;
  1855.                      
  1856.                 case 18:
  1857.                     mouse.moveRandomly(0, 360);
  1858.                     log(Color.ORANGE,"Antiban activated, mouse randomly.");
  1859.                     sleep(random(500, 800));
  1860.                break;
  1861.              
  1862.         }
  1863.            
  1864.     }
  1865.    
  1866.      public final void messageReceived(final MessageEvent e) {
  1867.             final String msg = e.getMessage();
  1868.            
  1869.             if (msg.contains("advanced a")) {
  1870.                 log(Color.GREEN,"Congratulations you advanced a level with wFighter!");
  1871.                
  1872.             } if (msg.contains("the next Runescape")) {
  1873.                 log(Color.RED,"System update, Running away and loggin out to prevent death.");
  1874.                 walkRandom();
  1875.                 stopScript(true);
  1876.             }
  1877.             if (msg.contains("Your resistance to dragon fire has run out.")){
  1878.                 log(Color.RED,"Drinking antifire");
  1879.                 if (inventory.getItemID("Super antifire")!=-1)
  1880.                 inventory.getItem(inventory.getItemID("Super antifire")).doClick(true);
  1881.         }
  1882.         }
  1883.      
  1884.      @SuppressWarnings("serial")
  1885.      public class wfighterGUI extends JFrame {
  1886.    
  1887.          private static final long serialVersionUID = 1L;
  1888.           private final ArrayList<String> currentSelected = new ArrayList<String>();
  1889.          public wfighterGUI() {
  1890.                 initComponents();
  1891.             }
  1892.          
  1893.          private void checkBox6ActionPerformed(ActionEvent e) {
  1894.              
  1895.          }
  1896. private void checkBox4ActionPerformed(ActionEvent e) {
  1897.              
  1898.          }
  1899.             private void StartActionPerformed(ActionEvent e) {
  1900.                 LootNames = new String[currentSelected.size()];
  1901.                 LootPrices = new int[currentSelected.size()];
  1902.                 for (int i = 0; i < currentSelected.size(); i++) {
  1903.                 LootNames[i] = currentSelected.get(i).split(" : ")[0];
  1904.                 LootPrices[i] = Integer.parseInt(currentSelected.get(i)
  1905.                 .replace("GP", "").split(" : ")[1]);
  1906.                 }
  1907.                 for (int i = 0; i < currentSelected.size(); i++) {
  1908.                     log("Item: " + currentSelected.get(i).split(" : ")[0]
  1909.                             + ", Price: " + currentSelected.get(i).split(" : ")[1]);
  1910.                 }
  1911.                  LootAmount = new int[LootNames.length];
  1912.                  for(int i = 0; i < LootAmount.length; i++)
  1913.                      LootAmount[i] = 0;
  1914.                  
  1915.                
  1916.                 //checkboxes
  1917.                  
  1918.                  if(checkBox9.isSelected()) {
  1919.                      hellHounds = true;
  1920.                  }else {
  1921.                      hellHounds = false;
  1922.                  }
  1923.                  if(prayer.isSelected()) {
  1924.                      pray = true;
  1925.                  }else {
  1926.                      pray = false;
  1927.                  }
  1928.                  
  1929.                  if(note.isSelected()) {
  1930.                    
  1931.                  }else {
  1932.                      unNote = false;
  1933.                  }
  1934.                 if(checkBox6.isSelected()) {
  1935.                     bury = true;
  1936.                 }else{
  1937.                     bury = false;
  1938.                 }
  1939.                 if(checkBox5.isSelected()) {
  1940.                    
  1941.                     ash = true;
  1942.                 }else{
  1943.                     ash = false;
  1944.                 }
  1945.            
  1946.                 if(checkBox4.isSelected()) {
  1947.                      exc = true;                 
  1948.                  }else{
  1949.                      exc = false;
  1950.                  }
  1951.                
  1952.                 if(checkBox2.isSelected()) {
  1953.                      b2p = true;
  1954.                  }else{
  1955.                      b2p = false;
  1956.                  }
  1957.                
  1958.                  if(checkBox3.isSelected()) {
  1959.                      b2b = true;
  1960.                 }else{
  1961.                      b2b = false;
  1962.                  }
  1963.              
  1964.            
  1965.                 //FOOD
  1966.                  final String chosenFood = comboBox1.getSelectedItem().toString();
  1967.                 if (chosenFood.equals("Summer Pie")) {
  1968.                     foodID = summerPie;
  1969.                 } else if (chosenFood.equals("Mud Pie")) {
  1970.                     foodID = MudPie;
  1971.                 } else if (chosenFood.equals("Redberry Pie")) {
  1972.                     foodID = RedberryPie;
  1973.                 } else if (chosenFood.equals("Admiral Pie")) {
  1974.                     foodID = AdmiralPie;
  1975.                 } else if (chosenFood.equals("Meat Pie")) {
  1976.                     foodID = MeatPie;
  1977.                 } else if (chosenFood.equals("Apple Pie")) {
  1978.                     foodID = ApplePie;
  1979.                 } else if (chosenFood.equals("Fish Pie")) {
  1980.                     foodID = fishPie;
  1981.                 } else if (chosenFood.equals("Garden Pie")) {
  1982.                     foodID = GardenPie;
  1983.                 } else if (chosenFood.equals("Strawberry")) {
  1984.                     foodID = Strawberry;
  1985.                 } else if (chosenFood.equals("Peaches")) {
  1986.                     foodID = Peach;
  1987.                 } else if (chosenFood.equals("Banana")) {
  1988.                     foodID = Banana;
  1989.                 } else if (chosenFood.equals("Papaya")) {
  1990.                     foodID = Papaya;
  1991.                 } else if (chosenFood.equals("Lemon")) {
  1992.                     foodID = Lemon;
  1993.                 } else if (chosenFood.equals("Orange")) {
  1994.                     foodID = Orange;
  1995.                 }
  1996.                 if (chosenFood.equals("Anchoveys")) {
  1997.                     foodID = AnchoveysID;
  1998.                 } else if (chosenFood.equals("Shrimp")) {
  1999.                     foodID = ShrimpID;
  2000.                 } else if (chosenFood.equals("Crayfish")) {
  2001.                     foodID = CrayfishID;
  2002.                 } else if (chosenFood.equals("Sardine")) {
  2003.                     foodID = SardineID;
  2004.                 } else if (chosenFood.equals("Herring")) {
  2005.                     foodID = HerringID;
  2006.                 } else if (chosenFood.equals("Mackeral")) {
  2007.                     foodID = MackeralID;
  2008.                 } else if (chosenFood.equals("Trout")) {
  2009.                     foodID = TroutID;
  2010.                 } else if (chosenFood.equals("Cod")) {
  2011.                     foodID = CodID;
  2012.                 } else if (chosenFood.equals("Pike")) {
  2013.                     foodID = PikeID;
  2014.                 } else if (chosenFood.equals("Salmon")) {
  2015.                     foodID = SalmonID;
  2016.                 } else if (chosenFood.equals("Tuna")) {
  2017.                     foodID = TunaID;
  2018.                 } else if (chosenFood.equals("Lobster")) {
  2019.                     foodID = LobsterID;
  2020.                 } else if (chosenFood.equals("Swordfish")) {
  2021.                     foodID = SwordfishID;
  2022.  
  2023.                 } else if (chosenFood.equals("Bass")) {
  2024.                     foodID = BassID;
  2025.  
  2026.                 } else if (chosenFood.equals("Monkfish")) {
  2027.                     foodID = MonkfishID;
  2028.  
  2029.                 } else if (chosenFood.equals("Shark")) {
  2030.                     foodID = SharkID;
  2031.                 } else if (chosenFood.equals("Cavefish")) {
  2032.                     foodID = CavefishID;
  2033.                 } else if (chosenFood.equals("Sea Turtle")) {
  2034.                     foodID = SeaTurtleID;
  2035.  
  2036.                 } else if (chosenFood.equals("Manta Ray")) {
  2037.                     foodID = MantaRayID;
  2038.  
  2039.                 } else if (chosenFood.equals("Rocktail")) {
  2040.                     foodID = RocktailID;
  2041.  
  2042.                 } else if (chosenFood.equals("Baron Shark")) {
  2043.                     foodID = BaronSharkID;
  2044.  
  2045.                 } else if (chosenFood.equals("Lobster")) {
  2046.                     foodID = LobsterID;
  2047.                 } else if (chosenFood.equals("Wild Pie")) {
  2048.                     foodID = wildPie;
  2049.                 }
  2050.                
  2051.                 //SPECIAL ATTACK WEPS
  2052.                 String specWep = SpecialAtt.getSelectedItem().toString();
  2053.                 if(specWep.equals("None")) {
  2054.                 spec = false;
  2055.                 }
  2056.                 else if(specWep.equals("Dragon Dagger")) {
  2057.                     specID = dds1ID;
  2058.                     spec = true;
  2059.                 }else if(specWep.equals("Dragon Dagger(p)")) {
  2060.                     specID = dds2ID;
  2061.                     spec = true;
  2062.                 }
  2063.                 else if(specWep.equals("Dragon Dagger+")) {
  2064.                     specID = dds3ID;
  2065.                     spec = true;
  2066.                 }
  2067.                 else if(specWep.equals("Dragon Dagger++")) {
  2068.                     specID = dds4ID;
  2069.                     spec = true;
  2070.                 }
  2071.                 else if(specWep.equals("Korasi Sword")) {
  2072.                     specID = korasiID;
  2073.                     spec = true;
  2074.                 }else if(specWep.equals("Bandos Godsword")) {
  2075.                     specID = bgsID;
  2076.                     spec = true;
  2077.                 }else if(specWep.equals("Zamorak Godsword")) {
  2078.                     specID = zgsID;
  2079.                     spec = true;
  2080.                 }else if(specWep.equals("Saradomin Godsword")) {
  2081.                     specID = sgsID;
  2082.                     spec = true;
  2083.                 }else if(specWep.equals("Armadyl Godsword")) {
  2084.                     specID = agsID;
  2085.                     spec = true;
  2086.                 }else if(specWep.equals("Dragon Claws")) {
  2087.                     specID = dClawsID;
  2088.                     spec = true;
  2089.                 }else if(specWep.equals("Enchanted Excalibur")) {
  2090.                     specID = excID;
  2091.                     spec = true;
  2092.                 }
  2093.                
  2094.                 //POTIONS
  2095.                
  2096.                 String attPot = comboBox2.getSelectedItem().toString();
  2097.                 if(attPot.equals("Attack Potion")) {
  2098.                     attPotion = regAttID;
  2099.                     attPotion3 = regAtt3ID;
  2100.                     attPotion2 = regAtt2ID;
  2101.                     attPotion1 = regAtt1ID;
  2102.                 }
  2103.                 else if(attPot.equals("None")) {
  2104.                    
  2105.                    
  2106.                 }
  2107.                 else if(attPot.equals("Super Att Potion")) {
  2108.                     attPotion = supAttID;
  2109.                     attPotion3 = supAtt3ID;
  2110.                     attPotion2 = supAtt2ID;
  2111.                     attPotion1 = supAtt1ID;
  2112.                 }else if(attPot.equals("Extreme Att Potion")) {
  2113.                     attPotion = extremeAttID;
  2114.                     attPotion3 = extremeAtt3ID;
  2115.                     attPotion2 = extremeAtt2ID;
  2116.                     attPotion1 = extremeAtt1ID;
  2117.                 }
  2118.                 String strPot = comboBox3.getSelectedItem().toString();
  2119.                 if(strPot.equals("Strength Potion")) {
  2120.                     strPotion = regStrID;
  2121.                     strPotion3 = regStr3ID;
  2122.                     strPotion2 = regStr2ID;
  2123.                     strPotion1 = regStr1ID;
  2124.                    
  2125.                 }else if(strPot.equals("None")) {
  2126.                    
  2127.                 }
  2128.                 else if(strPot.equals("Super Str Potion")) {
  2129.                     strPotion = supStrID;
  2130.                     strPotion3 = supStr3ID;
  2131.                     strPotion2 = supStr2ID;
  2132.                     strPotion1 = supStr1ID;
  2133.                    
  2134.                 }else if(strPot.equals("Extreme Str Potion")) {
  2135.                     strPotion = extremeStrID;
  2136.                     strPotion3 = extremeStr3ID;
  2137.                     strPotion2 = extremeStr2ID;
  2138.                     strPotion1 = extremeStr1ID;
  2139.                 }
  2140.                 String defPot = comboBox3.getSelectedItem().toString();
  2141.                 if(defPot.equals("Defence Potion")) {
  2142.                     defPotion = regDefID;
  2143.                 }else if(defPot.equals("None")) {
  2144.                    
  2145.                 }
  2146.                 else if(defPot.equals("Super Def Potion")) {
  2147.                     defPotion = supDefID;
  2148.                 }else if(defPot.equals("Extreme Def Potion")) {
  2149.                     defPotion = extremeDefID;
  2150.                 }
  2151.                 String rngPot = comboBox4.getSelectedItem().toString();
  2152.                 if(rngPot.equals("Ranging Potion")) {
  2153.                     rngPotion = regRngID;
  2154.                 }else if(rngPot.equals("None")) {
  2155.                    
  2156.                 }
  2157.                 else if(rngPot.equals("Extreme Rng Potion")) {
  2158.                     rngPotion = extremeRngID;
  2159.                 }
  2160.                
  2161.                 //POUCHES
  2162.                 String pouch = comboBox5.getSelectedItem().toString();
  2163.                 if(pouch.equals("None")) {
  2164.                    
  2165.                 }
  2166.                 else if(pouch.equals("Unicorn Stallion")) {
  2167.                    
  2168.                     pouchID = unicornID;
  2169.                    
  2170.                    
  2171.                 }else if(pouch.equals("Pack Yak")){
  2172.                    
  2173.                     pouchID = packYakID;
  2174.                    
  2175.                 }else if(pouch.equals("Bunyip")){
  2176.                    
  2177.                         pouchID = bunyipID;
  2178.                    
  2179.                    
  2180.                 }else if(pouch.equals("War Tortoise")){
  2181.                    
  2182.                         pouchID = bunyipID;
  2183.                        
  2184.                    
  2185.                    
  2186.                 }else if(pouch.equals("Bull Ant")){
  2187.                 pouchID = bullAntID;   
  2188.                
  2189.                 }else if(pouch.equals("Terror Bird")){
  2190.                     pouchID = terrorBirdID;
  2191.                 }else if(pouch.equals("Thorny Snail")){
  2192.                     pouchID = snailID;
  2193.                
  2194.             }else if(pouch.equals("Bull Ant")){
  2195.                 pouchID = bullAntID;
  2196.             }
  2197.                 String scrolls = comboBox6.getSelectedItem().toString();
  2198.                 if(scrolls.equals("None")) {
  2199.                    
  2200.                 }else if(scrolls.equals("Healing Aurora(Unicorn)")) {
  2201.                     scrollID = unicornScrollsID;
  2202.                 }else if(scrolls.equals("Winter Storage(Pack Yak)")) {
  2203.                     scrollID = packYakScrollsID;
  2204.                 }
  2205.                 gui.setVisible(false);
  2206.             }
  2207.  
  2208.            
  2209.  
  2210.             private void button2ActionPerformed(final java.awt.event.ActionEvent evt) {//refresh
  2211.                  list1.setModel(new javax.swing.AbstractListModel() {//Re-builds the list
  2212.                          String[] strings = getList();
  2213.                      public int getSize() { return strings.length; }
  2214.                      public Object getElementAt(final int i) { return strings[i]; }
  2215.                  });
  2216.              }
  2217.  
  2218.            
  2219.                  private void button1ActionPerformed(final java.awt.event.ActionEvent evt) {//select
  2220.                         if(list1.getSelectedValue() == null){//If no value is selected you will get a nullpointer, this stops it
  2221.                                 log(Color.RED, "Please select an NPC first!");
  2222.                                 return;
  2223.                         }
  2224.                
  2225.                         selectedNPCName = list1.getSelectedValue().toString().replace("Name: ", "").split(",")[0];
  2226.                                 log("NPC set to: " + selectedNPCName);
  2227.                                
  2228.                     }
  2229.  
  2230.                
  2231.                 private void updateList1() {
  2232.                         list2.setModel(new AbstractListModel() {
  2233.                             //String[] values = getPrices(getItems());
  2234.                             String[] values = getItems();
  2235.                             public int getSize() {
  2236.                                 return values.length;
  2237.                             }
  2238.                             public Object getElementAt(final int i) {
  2239.                                 return values[i];
  2240.                             }
  2241.                         });
  2242.                     }
  2243.                    
  2244.                     private void updateList2() {
  2245.                         list3.setModel(new AbstractListModel() {
  2246.                             String[] values = currentSelected
  2247.                                     .toArray(new String[currentSelected.size()]);
  2248.                             public int getSize() {
  2249.                                 return values.length;
  2250.                             }
  2251.                             public Object getElementAt(final int i) {
  2252.                                 return values[i];
  2253.                             }
  2254.                         });
  2255.                     }
  2256.                    
  2257.                     private void updateProgBar(final boolean visible){
  2258.                         button5.setVisible(visible);
  2259.                         textField1.setVisible(visible);
  2260.                         label6.setVisible(visible);
  2261.                         progressBar1.setVisible(!visible);
  2262.                     }
  2263.  
  2264.                
  2265.                  private void loadItem(final String itemName) {
  2266.                      if (itemName != null && itemName.replaceAll(" ", "").length() > 0) {
  2267.                      updateProgBar(false);
  2268.                      new Thread(new Runnable() {
  2269.                      @Override
  2270.                      public void run() {
  2271.                      try {
  2272.                      final int price = grandExchange.lookup(itemName)
  2273.                      .getGuidePrice();
  2274.                      if (price > 0) {
  2275.                      currentSelected.add(itemName + " : " + price
  2276.                      + "GP");
  2277.                      updateList2();
  2278.                      textField1.setText("");
  2279.                      updateProgBar(true);
  2280.                      return;
  2281.                      }
  2282.                      updateProgBar(true);
  2283.                      } catch (final Exception err) {
  2284.                      JOptionPane.showMessageDialog(null,
  2285.                      "Error loading item!", "Error",
  2286.                      JOptionPane.ERROR_MESSAGE);
  2287.                      textField1.setText("");
  2288.                      updateProgBar(true);
  2289.                      }
  2290.                      }
  2291.                      }).start();
  2292.                      }
  2293.                      }
  2294.                  
  2295.              private void button4ActionPerformed(final ActionEvent e) {
  2296.                      if(list3.getSelectedValue() != null) {
  2297.                              for(int i = 0; i < currentSelected.size(); i++)
  2298.                                      if(currentSelected.get(i).equals(list3.getSelectedValue())){
  2299.                                              currentSelected.remove(i);
  2300.                                              updateList2();
  2301.                                      }
  2302.                      }
  2303.              }
  2304.  
  2305.              private void button5ActionPerformed(final ActionEvent e) {
  2306.                  if (textField1.getText() != null
  2307.                  && textField1.getText().replaceAll(" ", "").length() > 0) {
  2308.                  loadItem(textField1.getText().trim());
  2309.                  }
  2310.                  }
  2311.  
  2312.                  private void button3ActionPerformed(final ActionEvent e) {
  2313.                  if (list2.getSelectedValue() != null) {
  2314.                  loadItem(String.valueOf(list2.getSelectedValue()).trim());
  2315.                  }
  2316.                  }
  2317.  
  2318.              private String[] getList(){//Gets all the npcs, and then creates a sentence saying there name, id & cbLvl
  2319.                  final RSNPC[] allNPC = getClosestNPCs();
  2320.                  final String[] str = new String[allNPC.length];
  2321.                  for (int i = 0; i < allNPC.length; i++) {
  2322.                      str[i] = "Name: " + allNPC[i].getName() + "," +
  2323.                      " CBLvl: " + allNPC[i].getLevel() + "," +
  2324.                      " ID: " + allNPC[i].getID();
  2325.                  }
  2326.                  return str;
  2327.      }
  2328.            
  2329.              
  2330.                 private void initComponents() {
  2331.                
  2332.                     label2 = new JLabel();
  2333.                     label1 = new JLabel();
  2334.                     Start = new JButton();
  2335.                     label3 = new JLabel();
  2336.                     scrollPane1 = new JScrollPane();
  2337.                     list1 = new JList();
  2338.                     button1 = new JButton();
  2339.                     button2 = new JButton();
  2340.                     label4 = new JLabel();
  2341.                     checkBox1 = new JCheckBox();
  2342.                     scrollPane2 = new JScrollPane();
  2343.                     list2 = new JList();
  2344.                     button3 = new JButton();
  2345.                     button4 = new JButton();
  2346.                     scrollPane3 = new JScrollPane();
  2347.                     list3 = new JList();
  2348.                     label5 = new JLabel();
  2349.                     label6 = new JLabel();
  2350.                     textField1 = new JTextField();
  2351.                     button5 = new JButton();
  2352.                     label7 = new JLabel();
  2353.                     label8 = new JLabel();
  2354.                     comboBox1 = new JComboBox();
  2355.                     checkBox2 = new JCheckBox();
  2356.                     checkBox3 = new JCheckBox();
  2357.                     checkBox4 = new JCheckBox();
  2358.                     comboBox2 = new JComboBox();
  2359.                     label9 = new JLabel();
  2360.                     comboBox3 = new JComboBox();
  2361.                     comboBox4 = new JComboBox();
  2362.                     comboBox5 = new JComboBox();
  2363.                     comboBox6 = new JComboBox();
  2364.                     label10 = new JLabel();
  2365.                     label11 = new JLabel();
  2366.                     label12 = new JLabel();
  2367.                     label13 = new JLabel();
  2368.                     label15 = new JLabel();
  2369.                     label14 = new JLabel();
  2370.                     label16 = new JLabel();
  2371.                     label17 = new JLabel();
  2372.                     comboBox7 = new JComboBox();
  2373.                     comboBox8 = new JComboBox();
  2374.                     checkBox5 = new JCheckBox();
  2375.                     checkBox6 = new JCheckBox();
  2376.                     checkBox7 = new JCheckBox();
  2377.                     checkBox8 = new JCheckBox();
  2378.                     label20 = new JLabel();
  2379.                     label21 = new JLabel();
  2380.                     SpecialAtt = new JComboBox();
  2381.                     progressBar1 = new JProgressBar();
  2382.                     prayer = new JCheckBox();
  2383.                     note = new JCheckBox();
  2384.                     checkBox9 = new JCheckBox();
  2385.                    
  2386.                     //======== this ========
  2387.                     Container contentPane = getContentPane();
  2388.                     contentPane.setLayout(null);
  2389.  
  2390.                     //---- label2 ----
  2391.                     label2.setText("wFighter");
  2392.                     label2.setFont(new Font("Tempus Sans ITC", Font.BOLD, 18));
  2393.                     contentPane.add(label2);
  2394.                     label2.setBounds(345, 10, 100, 25);
  2395.  
  2396.                     //---- label1 ----
  2397.                     label1.setText(" by waao");
  2398.                     contentPane.add(label1);
  2399.                     label1.setBounds(365, 35, 44, 20);
  2400.  
  2401.                     //---- Start ----
  2402.                     Start.setText("Start");
  2403.                     Start.addActionListener(new ActionListener() {
  2404.                         @Override
  2405.                         public void actionPerformed(ActionEvent e) {
  2406.                             StartActionPerformed(e);
  2407.                             StartActionPerformed(e);
  2408.                             StartActionPerformed(e);
  2409.                         }
  2410.                     });
  2411.                     contentPane.add(Start);
  2412.                     Start.setBounds(45, 375, 605, 18);
  2413.  
  2414.                     //---- label3 ----
  2415.                     label3.setText("Monster");
  2416.                     label3.setFont(label3.getFont().deriveFont(label3.getFont().getStyle() | Font.BOLD));
  2417.                     contentPane.add(label3);
  2418.                     label3.setBounds(new Rectangle(new Point(65, 65), label3.getPreferredSize()));
  2419.  
  2420.                     //======== scrollPane1 ========
  2421.                     {
  2422.                         scrollPane1.setViewportView(list1);
  2423.                     }
  2424.                     contentPane.add(scrollPane1);
  2425.                     scrollPane1.setBounds(15, 90, 135, scrollPane1.getPreferredSize().height);
  2426.  
  2427.                     //---- button1 ----
  2428.                     button1.setText("Select");
  2429.                     button1.addActionListener(new ActionListener() {
  2430.                         @Override
  2431.                         public void actionPerformed(ActionEvent e) {
  2432.                             button1ActionPerformed(e);
  2433.                         }
  2434.                     });
  2435.                     contentPane.add(button1);
  2436.                     button1.setBounds(15, 235, 135, button1.getPreferredSize().height);
  2437.  
  2438.                     //---- button2 ----
  2439.                     button2.setText("Refresh");
  2440.                     button2.addActionListener(new ActionListener() {
  2441.                         @Override
  2442.                         public void actionPerformed(ActionEvent e) {
  2443.                             button2ActionPerformed(e);
  2444.                         }
  2445.                     });
  2446.                     contentPane.add(button2);
  2447.                     button2.setBounds(15, 265, 135, button2.getPreferredSize().height);
  2448.  
  2449.                     //---- label4 ----
  2450.                     label4.setText("Loot");
  2451.                     label4.setFont(label4.getFont().deriveFont(label4.getFont().getStyle() | Font.BOLD));
  2452.                     contentPane.add(label4);
  2453.                     label4.setBounds(new Rectangle(new Point(275, 65), label4.getPreferredSize()));
  2454.  
  2455.                     //---- checkBox1 ----
  2456.                     checkBox1.setText("Enable Looting");
  2457.                     contentPane.add(checkBox1);
  2458.                     checkBox1.setBounds(new Rectangle(new Point(205, 85), checkBox1.getPreferredSize()));
  2459.  
  2460.                     //======== scrollPane2 ========
  2461.                     {
  2462.                         scrollPane2.setViewportView(list2);
  2463.                     }
  2464.                     contentPane.add(scrollPane2);
  2465.                     scrollPane2.setBounds(205, 115, 95, scrollPane2.getPreferredSize().height);
  2466.  
  2467.                     //---- button3 ----
  2468.                     button3.setText(">>>>");
  2469.                     button3.addActionListener(new ActionListener() {
  2470.                         @Override
  2471.                         public void actionPerformed(ActionEvent e) {
  2472.                             button3ActionPerformed(e);
  2473.                         }
  2474.                     });
  2475.                     contentPane.add(button3);
  2476.                     button3.setBounds(new Rectangle(new Point(310, 150), button3.getPreferredSize()));
  2477.  
  2478.                     //---- button4 ----
  2479.                     button4.setText("<<<<");
  2480.                     button4.addActionListener(new ActionListener() {
  2481.                         @Override
  2482.                         public void actionPerformed(ActionEvent e) {
  2483.                             button4ActionPerformed(e);
  2484.                         }
  2485.                     });
  2486.                     contentPane.add(button4);
  2487.                     button4.setBounds(new Rectangle(new Point(310, 180), button4.getPreferredSize()));
  2488.  
  2489.                     //======== scrollPane3 ========
  2490.                     {
  2491.                         scrollPane3.setViewportView(list3);
  2492.                     }
  2493.                     contentPane.add(scrollPane3);
  2494.                     scrollPane3.setBounds(385, 120, 105, 130);
  2495.  
  2496.                     //---- label5 ----
  2497.                     label5.setText("Added");
  2498.                     label5.setFont(label5.getFont().deriveFont(label5.getFont().getStyle() & ~Font.BOLD));
  2499.                     contentPane.add(label5);
  2500.                     label5.setBounds(new Rectangle(new Point(415, 90), label5.getPreferredSize()));
  2501.  
  2502.                     //---- label6 ----
  2503.                     label6.setText("Search:");
  2504.                     contentPane.add(label6);
  2505.                     label6.setBounds(new Rectangle(new Point(225, 255), label6.getPreferredSize()));
  2506.  
  2507.                     //---- textField1 ----
  2508.                     textField1.setText("Must be exact name");
  2509.                     contentPane.add(textField1);
  2510.                     textField1.setBounds(270, 250, 110, textField1.getPreferredSize().height);
  2511.  
  2512.                     //---- button5 ----
  2513.                     button5.setText("Go");
  2514.                     button5.addActionListener(new ActionListener() {
  2515.                         @Override
  2516.                         public void actionPerformed(ActionEvent e) {
  2517.                             button5ActionPerformed(e);
  2518.                         }
  2519.                     });
  2520.                     contentPane.add(button5);
  2521.                     button5.setBounds(new Rectangle(new Point(385, 250), button5.getPreferredSize()));
  2522.  
  2523.                     //---- label7 ----
  2524.                     label7.setText("Healing");
  2525.                     label7.setFont(label7.getFont().deriveFont(label7.getFont().getStyle() | Font.BOLD));
  2526.                     contentPane.add(label7);
  2527.                     label7.setBounds(new Rectangle(new Point(565, 60), label7.getPreferredSize()));
  2528.  
  2529.                     //---- label8 ----
  2530.                     label8.setText("Food:");
  2531.                     contentPane.add(label8);
  2532.                     label8.setBounds(new Rectangle(new Point(520, 90), label8.getPreferredSize()));
  2533.  
  2534.                     //---- comboBox1 ----
  2535.                     comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  2536.                             "Summer Pie",
  2537.                             "Admiral Pie", "Meat Pie", "Apple Pie", "Mud Pie",
  2538.                             "Redberry Pie", "Wild Pie", "Fish Pie", "Garden Pie",
  2539.                             "Strawberry", "Lemon", "Orange", "Papaya", "Banana",
  2540.                             "Peaches", "Crayfish", "Anchovies", "Shrimp", "Sardine",
  2541.                             "Herring", "Mackerel", "Trout", "Cod", "Pike", "Salmon",
  2542.                             "Tuna", "Lobster", "Bass", "Swordfish", "Monkfish",
  2543.                             "Shark", "Cavefish", "Sea Turtle", "Manta Ray", "Rocktail",
  2544.                             "Baron Shark"
  2545.                     }));
  2546.                     contentPane.add(comboBox1);
  2547.                     comboBox1.setBounds(570, 85, 105, comboBox1.getPreferredSize().height);
  2548.  
  2549.                     //---- checkBox2 ----
  2550.                     checkBox2.setText("Bones to peaches");
  2551.                     contentPane.add(checkBox2);
  2552.                     checkBox2.setBounds(new Rectangle(new Point(510, 120), checkBox2.getPreferredSize()));
  2553.  
  2554.                     //---- checkBox3 ----
  2555.                     checkBox3.setText("Bones to bananas");
  2556.                     contentPane.add(checkBox3);
  2557.                     checkBox3.setBounds(new Rectangle(new Point(510, 145), checkBox3.getPreferredSize()));
  2558.  
  2559.                     //---- checkBox4 ----
  2560.                     checkBox4.setText("Enchanted Excalibur");
  2561.                     contentPane.add(checkBox4);
  2562.                     checkBox4.setBounds(new Rectangle(new Point(510, 170), checkBox4.getPreferredSize()));
  2563.  
  2564.                     //---- comboBox2 ----
  2565.                     comboBox2.setModel(new DefaultComboBoxModel(new String[] {
  2566.                         "None",
  2567.                         "Attack Potion",
  2568.                         "Super Att Potion",
  2569.                         "Extreme Att Potion  "
  2570.                     }));
  2571.                     contentPane.add(comboBox2);
  2572.                     comboBox2.setBounds(570, 220, 122, 20);
  2573.  
  2574.                     //---- label9 ----
  2575.                     label9.setText("Potions");
  2576.                     label9.setFont(label9.getFont().deriveFont(label9.getFont().getStyle() | Font.BOLD));
  2577.                     contentPane.add(label9);
  2578.                     label9.setBounds(555, 200, 42, 14);
  2579.  
  2580.                     //---- comboBox3 ----
  2581.                     comboBox3.setModel(new DefaultComboBoxModel(new String[] {
  2582.                         "None",
  2583.                         "Strength Potion",
  2584.                         "Super Str Potion",
  2585.                         "Extreme Str Potion  "
  2586.                     }));
  2587.                     contentPane.add(comboBox3);
  2588.                     comboBox3.setBounds(570, 250, 121, 20);
  2589.  
  2590.                     //---- comboBox4 ----
  2591.                     comboBox4.setModel(new DefaultComboBoxModel(new String[] {
  2592.                         "None",
  2593.                         "Defence Potion",
  2594.                         "Super Def Potion",
  2595.                         "Extreme Def Potion "
  2596.                     }));
  2597.                     contentPane.add(comboBox4);
  2598.                     comboBox4.setBounds(570, 275, 121, 20);
  2599.  
  2600.                     //---- comboBox5 ----
  2601.                     comboBox5.setModel(new DefaultComboBoxModel(new String[] {
  2602.                         "None",
  2603.                         "Ranging Potion",
  2604.                         "Super Rng Potion",
  2605.                         "Extreme Rng Potion"
  2606.                     }));
  2607.                     contentPane.add(comboBox5);
  2608.                     comboBox5.setBounds(570, 300, 120, 20);
  2609.  
  2610.                     //---- comboBox6 ----
  2611.                     comboBox6.setModel(new DefaultComboBoxModel(new String[] {
  2612.                         "None",
  2613.                         "Magic Potion",
  2614.                         "Extreme Magic Potion"
  2615.                     }));
  2616.                     contentPane.add(comboBox6);
  2617.                     comboBox6.setBounds(new Rectangle(new Point(570, 325), comboBox6.getPreferredSize()));
  2618.  
  2619.                     //---- label10 ----
  2620.                     label10.setText("Attack:");
  2621.                     contentPane.add(label10);
  2622.                     label10.setBounds(510, 225, 35, 14);
  2623.  
  2624.                     //---- label11 ----
  2625.                     label11.setText("Strength:");
  2626.                     contentPane.add(label11);
  2627.                     label11.setBounds(510, 250, 46, 20);
  2628.  
  2629.                     //---- label12 ----
  2630.                     label12.setText("Defence:");
  2631.                     contentPane.add(label12);
  2632.                     label12.setBounds(510, 280, 44, 14);
  2633.  
  2634.                     //---- label13 ----
  2635.                     label13.setText("Range:");
  2636.                     contentPane.add(label13);
  2637.                     label13.setBounds(510, 305, 35, 14);
  2638.  
  2639.                     //---- label15 ----
  2640.                     label15.setText("Mage:");
  2641.                     contentPane.add(label15);
  2642.                     label15.setBounds(new Rectangle(new Point(510, 330), label15.getPreferredSize()));
  2643.  
  2644.                     //---- label14 ----
  2645.                     label14.setText("Summoning");
  2646.                     label14.setFont(label14.getFont().deriveFont(label14.getFont().getStyle() | Font.BOLD));
  2647.                     contentPane.add(label14);
  2648.                     label14.setBounds(45, 295, 67, 14);
  2649.  
  2650.                     //---- label16 ----
  2651.                     label16.setText("Familiar:");
  2652.                     contentPane.add(label16);
  2653.                     label16.setBounds(20, 315, 40, 14);
  2654.  
  2655.                     //---- label17 ----
  2656.                     label17.setText("Scrolls:");
  2657.                     contentPane.add(label17);
  2658.                     label17.setBounds(20, 340, 34, 14);
  2659.  
  2660.                     //---- comboBox7 ----
  2661.                     comboBox7.setModel(new DefaultComboBoxModel(new String[] {
  2662.                         "None",
  2663.                         "Bunyip",
  2664.                         "Unicorn Stallion",
  2665.                         "Snail",
  2666.                         "Bull Ant",
  2667.                         "Spirit Terror Bird",
  2668.                         "War Tortoise",
  2669.                         "Pack Yak"
  2670.                     }));
  2671.                     contentPane.add(comboBox7);
  2672.                     comboBox7.setBounds(65, 315, 103, 20);
  2673.  
  2674.                     //---- comboBox8 ----
  2675.                     comboBox8.setModel(new DefaultComboBoxModel(new String[] {
  2676.                         "None",
  2677.                         "Healing Aurora(Unicorn)",
  2678.                         "Winter Storage(Pack Yak)"
  2679.                     }));
  2680.                     contentPane.add(comboBox8);
  2681.                     comboBox8.setBounds(65, 340, 140, 20);
  2682.  
  2683.                    
  2684.                     //---- checkBox5 ----
  2685.                     checkBox5.setText("Scatter ashes");
  2686.                     checkBox5.addActionListener(new ActionListener() {
  2687.                         @Override
  2688.                         public void actionPerformed(ActionEvent e) {
  2689.                             checkBox4ActionPerformed(e);
  2690.                         }
  2691.                     });
  2692.                     contentPane.add(checkBox5);
  2693.                     checkBox5.setBounds(new Rectangle(new Point(255, 310), checkBox5.getPreferredSize()));
  2694.  
  2695.                     //---- checkBox6 ----
  2696.                     checkBox6.setText("Burry Bones");
  2697.                     checkBox6.addActionListener(new ActionListener() {
  2698.                         @Override
  2699.                         public void actionPerformed(ActionEvent e) {
  2700.                             checkBox6ActionPerformed(e);
  2701.                         }
  2702.                     });
  2703.                     contentPane.add(checkBox6);
  2704.                     checkBox6.setBounds(new Rectangle(new Point(255, 335), checkBox6.getPreferredSize()));
  2705.  
  2706.                     //---- checkBox7 ----
  2707.                     checkBox7.setText("High Alch Loot");
  2708.                     contentPane.add(checkBox7);
  2709.                     checkBox7.setBounds(new Rectangle(new Point(355, 310), checkBox7.getPreferredSize()));
  2710.  
  2711.                     //---- checkBox8 ----
  2712.                     checkBox8.setText("Low Alch Loot");
  2713.                     contentPane.add(checkBox8);
  2714.                     checkBox8.setBounds(new Rectangle(new Point(355, 335), checkBox8.getPreferredSize()));
  2715.  
  2716.                     //---- checkBox9 ----
  2717.                     checkBox9.setText("Banking(Taverly dungeon Hell hounds)");
  2718.                     contentPane.add(checkBox9);
  2719.                     checkBox9.setBounds(new Rectangle(new Point(255, 285), checkBox9.getPreferredSize()));
  2720.                    
  2721.                     //---- label20 ----
  2722.                     label20.setText("Special Attack");
  2723.                     label20.setFont(label20.getFont().deriveFont(label20.getFont().getStyle() | Font.BOLD));
  2724.                     contentPane.add(label20);
  2725.                     label20.setBounds(70, 0, 81, 14);
  2726.  
  2727.                     //---- label21 ----
  2728.                     label21.setText("Spec Wepon:");
  2729.                     contentPane.add(label21);
  2730.                     label21.setBounds(10, 25, 64, 14);
  2731.  
  2732.                     //---- SpecialAtt ----
  2733.                     SpecialAtt.setModel(new DefaultComboBoxModel(new String[] {
  2734.                         "None",
  2735.                         "Dragon Dagger",
  2736.                         "Dragon Dagger+",
  2737.                         "Dragon Dagger++",
  2738.                         "Korasi Sword",
  2739.                         "Bandos Godsword",
  2740.                         "Zamorak Godsword",
  2741.                         "Saradomin Godsword",
  2742.                         "Armadyl Godsword",
  2743.                         "Dragon Claws",
  2744.                         "Enchanted Excalibur"
  2745.                     }));
  2746.                     contentPane.add(SpecialAtt);
  2747.                     SpecialAtt.setBounds(95, 25, 126, 20);
  2748.                     contentPane.add(progressBar1);
  2749.                     progressBar1.setBounds(270, 250, 110, 20);
  2750.  
  2751.                     //---- prayer ----
  2752.                     prayer.setText("Quick Prayer");
  2753.                     contentPane.add(prayer);
  2754.                     prayer.setBounds(new Rectangle(new Point(255, 355), prayer.getPreferredSize()));
  2755.  
  2756.                     //---- note ----
  2757.                     note.setText("un-note food (Bandits)");
  2758.                     contentPane.add(note);
  2759.                     note.setBounds(new Rectangle(new Point(355, 355), note.getPreferredSize()));
  2760.  
  2761.                    
  2762.                     { // compute preferred size
  2763.                         Dimension preferredSize = new Dimension();
  2764.                         for(int i = 0; i < contentPane.getComponentCount(); i++) {
  2765.                             Rectangle bounds = contentPane.getComponent(i).getBounds();
  2766.                             preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  2767.                             preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  2768.                         }
  2769.                         Insets insets = contentPane.getInsets();
  2770.                         preferredSize.width += insets.right;
  2771.                         preferredSize.height += insets.bottom;
  2772.                         contentPane.setMinimumSize(preferredSize);
  2773.                         contentPane.setPreferredSize(preferredSize);
  2774.                     }
  2775.                     updateProgBar(false);
  2776.                     updateList1();
  2777.                     updateList2();
  2778.                     updateProgBar(true);
  2779.                     pack();
  2780.                     setLocationRelativeTo(getOwner());
  2781.                 }
  2782.  
  2783.                
  2784.                 private JLabel label2;
  2785.                 private JLabel label1;
  2786.                 private JButton Start;
  2787.                 private JLabel label3;
  2788.                 private JScrollPane scrollPane1;
  2789.                 private JList list1;
  2790.                 private JButton button1;
  2791.                 private JButton button2;
  2792.                 private JLabel label4;
  2793.                 private JCheckBox checkBox1;
  2794.                 private JScrollPane scrollPane2;
  2795.                 private JList list2;
  2796.                 private JButton button3;
  2797.                 private JButton button4;
  2798.                 private JScrollPane scrollPane3;
  2799.                 private JList list3;
  2800.                 private JLabel label5;
  2801.                 private JLabel label6;
  2802.                 private JTextField textField1;
  2803.                 private JButton button5;
  2804.                 private JLabel label7;
  2805.                 private JLabel label8;
  2806.                 private JComboBox comboBox1;
  2807.                 private JCheckBox checkBox2;
  2808.                 private JCheckBox checkBox3;
  2809.                 private JCheckBox checkBox4;
  2810.                 private JComboBox comboBox2;
  2811.                 private JLabel label9;
  2812.                 private JComboBox comboBox3;
  2813.                 private JComboBox comboBox4;
  2814.                 private JComboBox comboBox5;
  2815.                 private JComboBox comboBox6;
  2816.                 private JLabel label10;
  2817.                 private JLabel label11;
  2818.                 private JLabel label12;
  2819.                 private JLabel label13;
  2820.                 private JLabel label15;
  2821.                 private JLabel label14;
  2822.                 private JLabel label16;
  2823.                 private JLabel label17;
  2824.                 private JComboBox comboBox7;
  2825.                 private JComboBox comboBox8;
  2826.                 private JCheckBox checkBox5;
  2827.                 private JCheckBox checkBox6;
  2828.                 private JCheckBox checkBox7;
  2829.                 private JCheckBox checkBox8;
  2830.                 private JLabel label20;
  2831.                 private JLabel label21;
  2832.                 private JComboBox SpecialAtt;
  2833.                 private JProgressBar progressBar1;
  2834.                 private JCheckBox prayer;
  2835.                 private JCheckBox note;
  2836.                 private JCheckBox checkBox9;
  2837.             }
  2838.     //paint
  2839.     public void mouseClicked(MouseEvent e) {
  2840.         if (button1.contains(e.getPoint())) {
  2841.             SHOWING_TAB = Curpaint.button1BOX;
  2842.             } else if (button2.contains(e.getPoint())) {
  2843.             SHOWING_TAB = Curpaint.button2BOX;
  2844.             } else if (button3.contains(e.getPoint())) {
  2845.             SHOWING_TAB = Curpaint.button3BOX;
  2846.             } else if (button4.contains(e.getPoint())) {
  2847.             SHOWING_TAB = Curpaint.button4BOX;
  2848.             }else if (button5.contains(e.getPoint())) {
  2849.             SHOWING_TAB = Curpaint.button5BOX;
  2850.             }else if (button6.contains(e.getPoint())) {
  2851.             SHOWING_TAB = Curpaint.button6BOX;
  2852.             }else if (button7.contains(e.getPoint())) {
  2853.             SHOWING_TAB = Curpaint.button7BOX;
  2854.             }
  2855.  
  2856.     }
  2857.    
  2858.    
  2859.    
  2860.    
  2861.  
  2862.  
  2863.     @Override
  2864.     public void mouseEntered(MouseEvent e) {
  2865.        
  2866.        
  2867.     }
  2868.  
  2869.     @Override
  2870.     public void mouseExited(MouseEvent e) {
  2871.      
  2872.        
  2873.     }
  2874.  
  2875.     @Override
  2876.     public void mousePressed(MouseEvent e) {
  2877.        
  2878.        
  2879.     }
  2880.  
  2881.     @Override
  2882.     public void mouseReleased(MouseEvent e) {
  2883.        
  2884.        
  2885.     }
  2886.    
  2887.     private void drawTile(Graphics render, RSTile tile, Color color,
  2888.               boolean drawCardinalDirections) {
  2889.             Point southwest = calc.tileToScreen(tile, 0, 0, 0);
  2890.             Point southeast = calc.tileToScreen(
  2891.                 new RSTile(tile.getX() + 1, tile.getY()), 0, 0, 0);
  2892.             Point northwest = calc.tileToScreen(new RSTile(tile.getX(),
  2893.                 tile.getY() + 1), 0, 0, 0);
  2894.             Point northeast = calc.tileToScreen(
  2895.                 new RSTile(tile.getX() + 1, tile.getY() + 1), 0, 0, 0);
  2896.          
  2897.             if (calc.pointOnScreen(southwest) && calc.pointOnScreen(southeast)
  2898.                 && calc.pointOnScreen(northwest)
  2899.                 && calc.pointOnScreen(northeast)) {
  2900.               render.setColor(Color.GREEN);
  2901.               render.drawPolygon(new int[] { (int) northwest.getX(),
  2902.                   (int) northeast.getX(), (int) southeast.getX(),
  2903.                   (int) southwest.getX() },
  2904.                   new int[] { (int) northwest.getY(), (int) northeast.getY(),
  2905.                       (int) southeast.getY(), (int) southwest.getY() }, 4);
  2906.               render.setColor(color);
  2907.               render.fillPolygon(new int[] { (int) northwest.getX(),
  2908.                   (int) northeast.getX(), (int) southeast.getX(),
  2909.                   (int) southwest.getX() },
  2910.                   new int[] { (int) northwest.getY(), (int) northeast.getY(),
  2911.                       (int) southeast.getY(), (int) southwest.getY() }, 4);
  2912.          
  2913.               if (drawCardinalDirections) {
  2914.                 render.setColor(Color.WHITE);
  2915.          
  2916.               }
  2917.             }
  2918.           }
  2919.          
  2920.     private Image getImage(String url) {
  2921.         try {
  2922.             return ImageIO.read(new URL(url));
  2923.         } catch(IOException e) {
  2924.             return null;
  2925.         }
  2926.     }
  2927.  
  2928.     private final Font font1 = new Font("Arial", 0, 12);
  2929.  
  2930.     private final Color color1 = new Color(0, 0, 0);
  2931.  
  2932.  
  2933.     private final Image img1 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintOverall.png");
  2934.      
  2935.  
  2936.     private final Image img2 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintAttack.png");
  2937.  
  2938.     private final Image img3 = getImage("http://img29.imageshack.us/img29/4227/waaopaintstrength.png");
  2939.  
  2940.     private final Image img4 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintDefence.png");
  2941.  
  2942.     private final Image img5 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintRange.png");
  2943.  
  2944.     private final Image img6 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintMagic.png");
  2945.  
  2946.     private final Image img7 = getImage("http://i304.photobucket.com/albums/nn191/hailmerry7/Waao%20Paint/WaaoPaintHitpoints.png");
  2947.  
  2948.     private final Image img8 = getImage("http://img202.imageshack.us/img202/5171/10perc.png");
  2949.  
  2950.     private final Image img9 = getImage("http://img560.imageshack.us/img560/8610/20perc.png");
  2951.  
  2952.     private final Image img10 = getImage("http://img703.imageshack.us/img703/120/30perc.png");
  2953.  
  2954.     private final Image img11 = getImage("http://img703.imageshack.us/img703/120/30perc.png");
  2955.  
  2956.     private final Image img12 = getImage("http://img233.imageshack.us/img233/3317/50perc.png");
  2957.  
  2958.     public void onRepaint(Graphics g1) {
  2959.         final RSNPC npc = npcs.getNearest(selectedNPCName);
  2960.         if(npc != null && npc.isOnScreen()) {
  2961.         drawTile(g1, npc.getLocation(), new Color(0, 0,
  2962.                   200, 70), true);
  2963.         }
  2964.        
  2965.         hpexpGained = skills.getCurrentExp(Skills.CONSTITUTION) - startHpExp;
  2966.          AttexpGained = skills.getCurrentExp(Skills.ATTACK) - startAttExp;
  2967.          StrexpGained = skills.getCurrentExp(Skills.STRENGTH) - startStrExp;
  2968.          DefexpGained = skills.getCurrentExp(Skills.DEFENSE) - startDefExp;
  2969.          RngexpGained = skills.getCurrentExp(Skills.RANGE) - startRngExp;
  2970.          MageexpGained = skills.getCurrentExp(Skills.MAGIC) - startMageExp;
  2971.          timeTNL = (long) ((double) attExpTNL / (double) attxpHour * 3600000);
  2972.         // attExpTNL = skills.getExpToNextLevel(Skills.ATTACK);
  2973.          //strExpTNL = skills.getExpToNextLevel(Skills.STRENGTH);
  2974.          //defExpTNL = skills.getExpToNextLevel(Skills.DEFENSE);
  2975.         // rngExpTNL = skills.getExpToNextLevel(Skills.RANGE);
  2976.         // mageExpTNL = skills.getExpToNextLevel(Skills.MAGIC);
  2977.         // hpExpTNL = skills.getExpToNextLevel(Skills.CONSTITUTION);
  2978.          
  2979.          TotalExp = hpexpGained + AttexpGained + StrexpGained + DefexpGained + RngexpGained + MageexpGained;
  2980.          TotalGP = getTotalLootCount();
  2981.          
  2982.          goldCharms = inventory.getCount(true, goldCharmID);
  2983.          greenCharms = inventory.getCount(true, greenCharmID);
  2984.          crimsonCharms = inventory.getCount(true, crimsonCharmID);
  2985.          blueCharms = inventory.getCount(true, blueCharmID);
  2986.                  
  2987.          long millis = System.currentTimeMillis() - startTime;
  2988.           long hours = millis / (1000 * 60 * 60);
  2989.           millis -= hours * (1000 * 60 * 60);
  2990.           long minutes = millis / (1000 * 60);
  2991.           millis -= minutes * (1000 * 60);
  2992.           long seconds = millis / 1000;
  2993.                  
  2994.              
  2995.           attxpHour = (int) ((AttexpGained) * 3600000D / (System
  2996.  
  2997.                     .currentTimeMillis() - startTime));
  2998.        
  2999.           strxpHour = (int) ((StrexpGained) * 3600000D / (System
  3000.  
  3001.                     .currentTimeMillis() - startTime));
  3002.           defxpHour = (int) ((DefexpGained) * 3600000D / (System
  3003.  
  3004.                     .currentTimeMillis() - startTime));
  3005.           rngxpHour = (int) ((RngexpGained) * 3600000D / (System
  3006.  
  3007.                     .currentTimeMillis() - startTime));
  3008.           magexpHour = (int) ((MageexpGained) * 3600000D / (System
  3009.  
  3010.                     .currentTimeMillis() - startTime));
  3011.           hpxpHour = (int) ((hpexpGained) * 3600000D / (System
  3012.  
  3013.                     .currentTimeMillis() - startTime));
  3014.          
  3015.        
  3016.          
  3017.          
  3018.           final Point p = mouse.getLocation();
  3019.             final long mpt = System.currentTimeMillis()- mouse.getPressTime();
  3020.             if (mouse.getPressTime() == -1 || mpt >= 1000) {
  3021.                     g1.drawImage(normal, p.x - 8, p.y - 8, null);
  3022.             }
  3023.             if (mpt < 2050) {
  3024.                     g1.drawImage(normal, p.x - 8, p.y - 8, null);
  3025.                                                
  3026.             }
  3027.            
  3028.    
  3029.           //mouse paint
  3030.          while (!mousePath.isEmpty() && mousePath.peek().isUp())
  3031.               mousePath.remove();
  3032.         Point clientCursor = mouse.getLocation();
  3033.         MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y,
  3034.                       1000); //1000 = lasting time/MS
  3035.         if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
  3036.               mousePath.add(mpp);
  3037.         MousePathPoint lastPoint = null;
  3038.         for (MousePathPoint a : mousePath) {
  3039.               if (lastPoint != null) {
  3040.                       g1.setColor(a.getColor());
  3041.                       g1.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  3042.               }
  3043.               lastPoint = a;
  3044.         }
  3045.        
  3046.     switch (SHOWING_TAB) {
  3047.    
  3048.     case button1BOX:
  3049.     g1.drawImage(img1, -1, 297, null);
  3050.     g1.setFont(font1);
  3051.     g1.setColor(color1);
  3052.     g1.drawString(status, 194, 449);
  3053.     g1.drawString("" + TotalExp, 269, 399);
  3054.     g1.drawString("", 240, 425);
  3055.     g1.drawString(hours + ":" + minutes + ":" + seconds, 249, 377);
  3056.     g1.drawString("" + goldCharms, 455, 407);
  3057.     g1.drawString("" + greenCharms, 466, 422);
  3058.     g1.drawString("" + crimsonCharms, 476, 442);
  3059.     g1.drawString("" + blueCharms, 455, 458);
  3060.     break;
  3061.  
  3062.     case button2BOX:    
  3063.      
  3064.     g1.drawImage(img2, -1, 297, null);
  3065.         g1.drawString("" + AttexpGained, 260, 369);
  3066.     g1.drawString("" + attxpHour , 251, 392);
  3067.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 10) {
  3068.         g1.drawImage(img8, 151, 420, null);
  3069.      }
  3070.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 20) {
  3071.         g1.drawImage(img9, 184, 420, null);
  3072.      }
  3073.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 30) {
  3074.         g1.drawImage(img10, 216, 420, null);
  3075.      }
  3076.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 40) {
  3077.         g1.drawImage(img11, 248, 420, null);
  3078.      }
  3079.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 50) {
  3080.         g1.drawImage(img12, 282, 420, null);
  3081.      }
  3082.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 60) {
  3083.         g1.drawImage(img12, 318, 420, null);
  3084.      }
  3085.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 70) {
  3086.         g1.drawImage(img12, 354, 420, null);
  3087.      }
  3088.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 80) {
  3089.         g1.drawImage(img12, 390, 420, null);
  3090.      }
  3091.     if(skills.getPercentToNextLevel(Skills.ATTACK) > 90) {
  3092.         g1.drawImage(img12, 426, 420, null);
  3093.      }
  3094.     break;
  3095.    
  3096.  
  3097.     case button3BOX:
  3098.  
  3099.     g1.drawImage(img3, -1, 297, null);
  3100.         g1.drawString("" + StrexpGained, 260, 369);
  3101.     g1.drawString("" + strxpHour , 251, 392);
  3102.   // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.STRENGTH, StrexpGained, startTime)), 219, 412);
  3103.     break;
  3104.  
  3105.     case button4BOX:
  3106.        
  3107.         g1.drawImage(img4, -1, 297, null);
  3108.         g1.drawString("" + DefexpGained, 260, 369);
  3109.         g1.drawString("" + defxpHour , 251, 392);
  3110.         //g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.DEFENSE, DefexpGained, startTime)), 219, 412);
  3111.        
  3112.      
  3113.        
  3114.     break;
  3115.        
  3116.     case button5BOX:
  3117.         g1.drawImage(img5, -1, 297, null);
  3118.         g1.drawString("" + RngexpGained, 260, 369);
  3119.         g1.drawString("" + rngxpHour , 251, 392);
  3120.        // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.RANGE, RngexpGained, startTime)), 219, 412);
  3121.        
  3122.        
  3123.         break;
  3124.    
  3125.     case button6BOX:
  3126.         g1.drawImage(img7, -1, 297, null);
  3127.         g1.drawString("" + hpexpGained, 260, 369);
  3128.         g1.drawString("" + hpxpHour , 251, 392);
  3129.        // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.CONSTITUTION, hpexpGained, startTime)), 219, 412);
  3130.        
  3131.    
  3132.         break;
  3133.    
  3134.     case button7BOX:
  3135.         g1.drawImage(img6, -1, 297, null);
  3136.         g1.drawString("" + MageexpGained, 260, 369);
  3137.         g1.drawString("" + magexpHour , 251, 392);
  3138.        // g1.drawString(Timer.format(skills.getTimeTillNextLevel(Skills.MAGIC, MageexpGained, startTime)), 219, 412);
  3139.        
  3140.         break;
  3141.     }
  3142.    
  3143.     }
  3144.    
  3145.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement