Advertisement
waao

Save as: wLRC.java

Jul 26th, 2011
2,107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @author waao
  3.  */
  4.  
  5. import java.awt.BasicStroke;
  6. import java.awt.Color;
  7. import java.awt.Container;
  8. import java.awt.Dimension;
  9. import java.awt.Font;
  10. import java.awt.Graphics;
  11. import java.awt.Graphics2D;
  12. import java.awt.Image;
  13. import java.awt.Insets;
  14. import java.awt.Rectangle;
  15. import java.awt.Shape;
  16. import java.io.IOException;
  17. import java.net.MalformedURLException;
  18. import java.net.URL;
  19. import javax.imageio.ImageIO;
  20. import java.awt.*;
  21. import java.awt.event.*;
  22.  
  23. import javax.swing.*;
  24.  
  25. import org.rsbot.event.events.MessageEvent;
  26. import org.rsbot.event.listeners.MessageListener;
  27. import org.rsbot.event.listeners.PaintListener;
  28. import org.rsbot.script.Script;
  29. import org.rsbot.script.ScriptManifest;
  30. import org.rsbot.script.methods.Equipment;
  31. import org.rsbot.script.methods.Game.Tab;
  32. import org.rsbot.script.methods.Prayer;
  33. import org.rsbot.script.methods.Skills;
  34. import org.rsbot.script.methods.Summoning.Familiar;
  35. import org.rsbot.script.wrappers.RSArea;
  36. import org.rsbot.script.wrappers.RSItem;
  37. import org.rsbot.script.wrappers.RSNPC;
  38. import org.rsbot.script.wrappers.RSObject;
  39. import org.rsbot.script.wrappers.RSTile;
  40. import org.rsbot.script.wrappers.RSWeb;
  41.  
  42. import java.awt.event.MouseEvent;
  43. import java.awt.event.MouseListener;
  44.  
  45. import org.rsbot.script.wrappers.RSComponent;
  46.  
  47. import java.awt.Color;
  48. import java.awt.Graphics;
  49. import java.awt.Point;
  50. import java.util.LinkedList;
  51. import java.awt.image.BufferedImage;
  52. import java.io.IOException;
  53. import java.net.MalformedURLException;
  54. import java.net.URL;
  55.  
  56.  
  57. @ScriptManifest(authors = { "waao" },version = 1.3, keywords = {
  58.         "FastXP", "training", "waao", "Moneymaking", "Fishing", "wScripts", "Living rock caverns" }, description = "Fishes rocktails in LRC, by waao.",
  59.         name = "wLRC")
  60. public class wLRC extends Script implements PaintListener, MessageListener, MouseListener{
  61.  
  62.   ScriptManifest props = getClass().getAnnotation(ScriptManifest.class);
  63.  
  64.   private int[] fishingGear = {12069, 15263, 14632, 307, 313, 12531, 20346, 20347, 20348, 20323, 20340, 20341,
  65.             20342, 20343, 20328, 20329, 20330, 20334, 20335, 1161, 1965, 1969, 1967, 1895, 1893,
  66.  
  67.         1891, 1971, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293,
  68.  
  69.         6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315,
  70.  
  71.         325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136,
  72.  
  73.         5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309,
  74.  
  75.         2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198,
  76.  
  77.         7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295,
  78.  
  79.         2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072,//wLRCOFFICIAL  BY WAAO
  80.  
  81.         7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054,
  82.  
  83.         6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913,
  84.  
  85.         5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751,
  86.  
  87.         5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213,
  88.  
  89.         2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219,
  90.  
  91.         2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235,
  92.  
  93.         2064, 2028, 2187, 2185, 2229, 12140, 12142, 12144, 12146};
  94.    
  95.     private int obeliskID = 5787;
  96.     private int BropeID = 45078; //bottom rope
  97.     private int TropeID = 45077; //top rope
  98.     private int fishSpotID;
  99.     private int fishID;
  100.     private int[] fishCape = {9798, 9799};
  101.     private int[] summPotID = {12140, 12142, 12144, 12146};
  102.     private final static int rockSpotID = 8842;
  103.     private final static int caveSpotID = 8841;
  104.     private boolean isReady;
  105.     private int RodID = 307;
  106.     private int mineralsID = 15263;
  107.     private int[] bankID = {45079};
  108.     private int rockTailID = 15272;
  109.     private int caveFishID = 15264;
  110.     private int gLobsterID = 12069;
  111.     private int IbisID =  12531;
  112.     private int[] pouchesID = {12069, 12531, 12788};
  113.     private int excID = 14632;
  114.     private long startTime;
  115. private int expGained = 0;
  116. private int startExp = 0;
  117. private int Fishfished;
  118. private int urnsUsed;
  119. private int FishTillLevel;
  120. private int TTL;
  121. public int gpMade;
  122. public int fishPrice;
  123. public int gpHour;
  124. public int GainedLevels;//wLRCOFFICIAL  BY WAAO
  125. RSArea fishArea;
  126. public boolean showPaint = true ;
  127. private int[] fullUrn = {20342, 20348, 20336, 20330, 20324};
  128.     RSTile spotTile = new RSTile(3643, 5082);
  129.     RSTile spotTile2 = new RSTile(3629, 5084);
  130.     RSTile spotTile3 = new RSTile(3618, 5090);
  131.     RSTile bankTile = new RSTile(3654, 5114);
  132.     RSTile safeTile = new RSTile(3653, 5116);
  133.     RSTile BropeTile = new RSTile(3651, 5122);
  134.     RSTile errorTile = new RSTile(3645, 5084);
  135.     RSTile screenTile = new RSTile(3642, 5084);
  136.     RSTile halfWayTile = new RSTile(3650, 5091);
  137.     private RSArea spot1Area = new RSArea(new RSTile(3641, 5085), new RSTile(3647, 5080));
  138.     private RSArea spot2Area = new RSArea(new RSTile(3625, 5086), new RSTile(3633, 5082));
  139.     private RSArea spot3Area = new RSArea(new RSTile(3616, 5093), new RSTile(3623, 5087));
  140.     private RSArea bankArea = new RSArea(new RSTile(3652, 5116), new RSTile(3660, 5111));
  141.     private int[] foodID = { 1161, 1965, 1969, 1967, 1895, 1893,
  142.  
  143.         1891, 1971, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293,
  144.  
  145.         6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315,
  146.  
  147.         325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136,
  148.  
  149.         5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309,
  150.  
  151.         2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198,
  152.  
  153.         7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295,
  154.  
  155.         2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072,
  156.  
  157.         7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054,
  158.  
  159.         6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913,
  160.  
  161.         5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751,
  162.  
  163.         5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213,
  164.  
  165.         2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219,
  166.  
  167.         2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235,
  168.  
  169.         2064, 2028, 2187, 2185, 2229 };
  170.    
  171.     BufferedImage normal = null;
  172.     BufferedImage clicked = null;
  173.    
  174.   private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
  175.  
  176.     @SuppressWarnings("serial")
  177.   private class MousePathPoint extends Point {
  178.    
  179.     private long finishTime;
  180.     private double lastingTime;
  181.  
  182.     private int toColor(double d) {
  183.       return Math.min(255, Math.max(0, (int) d));
  184.     }
  185.  
  186.     public MousePathPoint(int x, int y, int lastingTime) {
  187.       super(x, y);//wLRCOFFICIAL  BY WAAO
  188.       this.lastingTime = lastingTime;
  189.       finishTime = System.currentTimeMillis() + lastingTime;
  190.     }
  191.  
  192.     public boolean isUp() {
  193.       return System.currentTimeMillis() > finishTime;
  194.     }
  195.   //wLRCOFFICIAL  BY WAAO
  196.     public Color getColor() {//wLRCOFFICIAL  BY WAAO
  197.       return new Color(0,191,255, toColor(256 * ((finishTime - System
  198.           .currentTimeMillis()) / lastingTime)));
  199.     }//wLRCOFFICIAL  BY WAAO
  200.   }
  201.  
  202.    
  203.   @Override
  204.   public boolean onStart() {  
  205.          
  206.       try {
  207.           final URL cursorURL = new URL(
  208.                   "http://i.imgur.com/w7HhD.png"); // This is the link of your mouse when it isn't clicked
  209.          
  210.           normal = ImageIO.read(cursorURL);
  211.          
  212.       } catch (MalformedURLException e) {
  213.           log("Unable to buffer cursor.");
  214.       } catch (IOException e) {
  215.           log("Unable to open cursor image.");
  216.       }
  217.      
  218.     SwingUtilities.invokeLater(new Runnable() {
  219.             public void run() {
  220.                 wgui gui = new wgui();//wLRCOFFICIAL  BY WAAO
  221.                 gui.setVisible(true);
  222.             }
  223.         }//wLRCOFFICIAL  BY WAAO//wLRCOFFICIAL  BY WAAO
  224.         );
  225.         while (!isReady) {//wLRCOFFICIAL  BY WAAO
  226.             sleep(100);//wLRCOFFICIAL  BY WAAO
  227.         }
  228.       //wLRCOFFICIAL  BY WAAO
  229.  
  230.  
  231.     startExp = skills.getCurrentExp(Skills.FISHING);
  232.     startTime = System.currentTimeMillis();
  233.     fishPrice = grandExchange.lookup(rockTailID).getGuidePrice();
  234.     log(Color.GREEN,"Welcome to wLRC!");//wLRCOFFICIAL  BY WAAO
  235.     log("Please be patient while GUI and paint loads up!");
  236.     log("Please fill out GUI according to your desires, then press START.");
  237.      
  238.    
  239.    
  240.     return true;
  241.   }//wLRCOFFICIAL  BY WAAO
  242.  
  243.     //
  244.     //START LOOP
  245.     //
  246.  
  247.  
  248.   public int loop() {
  249.    
  250.      String returnText = interfaces.get(906)
  251.          . getComponent(221)
  252.           .getText().toLowerCase();
  253.   if (!game.isLoggedIn() || game.isWelcomeScreen() || ( returnText != null && returnText.equals("Logging In - Please Wait")))
  254.   {
  255.           sleep(1000,1500);
  256.           return random(6000,7000);
  257.   }
  258.  
  259. RSNPC fishSpot = npcs.getNearest(fishSpotID);
  260.  
  261.      
  262.      mouse.setSpeed(random(3, 6));
  263.  
  264.      offRetaliate();
  265.      ibisSummon();
  266.      lobsterSummon();
  267.      teleUrn();
  268.      summPot();
  269.      
  270.      if(random(1, 15) == 5) {
  271.          camera.setAngle(random(360, 0));
  272.          sleep(random(500, 850));
  273.          camera.setPitch(random(120, 280));
  274.          sleep(random(500, 850));
  275.      }
  276.      
  277.      //capeBoost();
  278.      
  279.     // if(!inventory.contains(mineralsID)) {
  280.     //   log(Color.RED,"Out of living rock minerals..");
  281.     //   log(Color.RED,"Sleeping for 20 sec in case of fail check of minerals");
  282.     //   sleep(random(15000, 25000));
  283.     //   log(Color.RED,"Confirmed out of minerals, logging out and shutting down..");
  284.     //   stopScript(true);
  285.    //  }
  286.      
  287.        if (!getMyPlayer().isInCombat()) {
  288.          if (!inventory.isFull()) {
  289.            
  290.            if(getMyPlayer().getAnimation() == 623) {
  291.                if(random(1, 10) == 5) {
  292.                    antiBan();
  293.                }
  294.            }
  295.           if(getMyPlayer().getAnimation() == -1) {
  296.              
  297.               if (random(1, 15) == 10) {
  298.                            antiBan();
  299.               }
  300.              
  301.               if(fishSpot == null && bankArea.contains(getMyPlayer().getLocation())) {
  302.                     walkFish();
  303.                     sleep(800, 1200);
  304.                 }
  305.       if (fishSpot != null) {
  306.              
  307.                if (fishSpot.isOnScreen()) {
  308.                    camera.turnTo(fishSpot);
  309.                    fishSpot.interact("Bait");
  310.  
  311.                    if (random(1, 10) == 5) {
  312.                        antiBan();
  313.                    }
  314.                    return random(200, 400);
  315.                    
  316.                }
  317.      
  318.              if (!fishSpot.isOnScreen()) {
  319.                 if(calc.tileOnScreen(screenTile) || spot1Area.contains(getMyPlayer().getLocation()) ||
  320.                         calc.tileOnScreen(screenTile) && spot1Area.contains(getMyPlayer().getLocation())) {
  321.                     log("At spot 1 walkign to spot 2");
  322.                     spot2Walk();
  323.                     camera.turnTo(fishSpot);
  324.                     sleep(800, 1200);
  325.  
  326.                 }
  327.                 else if (spot2Area.contains(getMyPlayer().getLocation())) {
  328.                     log("At spot 2 walkign to spot 3");
  329.                 spot3Walk();
  330.                 sleep(800, 1200);
  331.                 camera.turnTo(fishSpot);
  332.                
  333.                    
  334.                 }
  335.                 else if(spot3Area.contains(getMyPlayer().getLocation())) {
  336.                     log("At spot 3 finding new spot");
  337.                     spot2Walk();
  338.                     sleep(800, 1200);
  339.                     walkFish();
  340.                     sleep(800, 1200);
  341.                     camera.turnTo(fishSpot);
  342.                 }
  343.                
  344.                
  345.                
  346.              }
  347.          
  348.          
  349.              }
  350.          }
  351.        }
  352.      
  353.        }
  354.        
  355.          if(inventory.isFull()) {
  356.              if(atBank()) {
  357.              excSpec();
  358.              sleep(random(400, 600));
  359.        openBox();
  360.        doBank();
  361.    }else {
  362.        
  363.        halfWalk();
  364.        sleep(random(200, 400));
  365.        walkBank();
  366.    
  367.          }
  368.          }
  369.                
  370.        
  371.        
  372.          if(getMyPlayer().isInCombat()) {
  373.              if(!prayer.isQuickPrayerOn() && prayer.getPrayerLeft() >= 15) {
  374.                  prayer.setQuickPrayer(true);
  375.                  sleep(random(200, 400));
  376.              }
  377.              walkFish();
  378.              sleep(random(200, 400));
  379.                  walkBank();
  380.                  sleep(random(600, 800));
  381.                  
  382.                  if(prayer.isQuickPrayerOn()) {
  383.                  prayer.setQuickPrayer(false);
  384.                  sleep(random(200, 400));
  385.                  }
  386.          }      
  387.        
  388.        
  389.      if (inventory.getCount(foodID) >= 1) {
  390.          eat();
  391.          
  392.        } else {
  393.          if (inventory.getCount(foodID) < 1) {
  394.            if (getMyPlayer().getHPPercent() < 35) {
  395.              log(Color.RED,"Danger HP, walking to bank and resting til logged out.");
  396.              walkBank();
  397.              sleep(random(400, 600));
  398.              walkSafe();
  399.              sleep(random(400, 600));
  400.              walking.rest();
  401.              sleep(random(25000, 55000));
  402.              
  403.            
  404.            }
  405.          }
  406.        }
  407.      
  408.     return 500;
  409.   }
  410.  
  411.  
  412.  
  413. //
  414.   //END LOOP
  415.   //
  416.  
  417.   @SuppressWarnings({ "deprecation", "static-access" })
  418. private void capeBoost() {
  419.       if(skills.getCurrentLevel(Skills.FISHING) <= skills.getRealLevel(Skills.FISHING)) {
  420.           if(equipment.containsOneOf(fishCape)) {
  421.           if (game.getCurrentTab() != game.TAB_EQUIPMENT) {
  422.  
  423.                 game.openTab(game.TAB_EQUIPMENT);
  424.  
  425.             }
  426.  
  427.             if (game.getCurrentTab() == game.TAB_EQUIPMENT) {
  428.  
  429.                  equipment.getItem(Equipment.CAPE).interact("Boost");
  430.                  log("Successfully Boosted fishing with cape");
  431.                  sleep(random(100, 250));
  432.                  
  433.                    
  434.                     }
  435.             if (game.getCurrentTab() != game.TAB_INVENTORY)  {
  436.                 game.openTab(game.TAB_INVENTORY);
  437.             }
  438.                 }
  439.       }
  440.       }
  441.  
  442.  
  443.   //Summonng potion method
  444.       private void summPot() {
  445.         if(summoning.getSummoningPoints() < 15 && inventory.containsOneOf(pouchesID)) {
  446.          RSItem summPot = inventory.getItem(summPotID);
  447.          summPot.interact("Drink");
  448.          sleep(random(200, 400));
  449.       }return;
  450.          
  451.          
  452.       }
  453.      
  454.      
  455.        
  456.   private void eat() {
  457.         if (combat.getHealth() <= 35) {
  458.         while (combat.getHealth() <= 50) {      RSItem food = inventory.getItem(foodID);
  459.         food.interact("Eat");
  460.         }
  461. }
  462.         return;
  463. }
  464.  
  465.   private void ibisSummon() {
  466.     if (inventory.contains(IbisID) && !summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 56 && summoning.getSummoningPoints() > 20) {
  467.          RSItem ibis = inventory.getItem(IbisID);
  468.          ibis.interact("Summon");
  469.          log("Summoned ibis pouch.");
  470.     }
  471.     return;
  472.   }
  473.  
  474.   private void lobsterSummon() {
  475.      if (inventory.contains(gLobsterID)) {
  476.          if (!summoning.isFamiliarSummoned() && skills.getRealLevel(Skills.SUMMONING) >= 74 && summoning.getSummoningPoints() > 20) {
  477.  
  478.              RSItem lobster = inventory.getItem(gLobsterID);
  479.              lobster.interact("Summon");
  480.              log("Summoned granite Lobster pouch.");
  481.          }
  482.        }
  483.      return;
  484.   }
  485.  
  486.  
  487.   private void openBox(){
  488.     final RSObject bankDepositBox = objects.getNearest(bankID);
  489.     bankDepositBox.interact("Deposit");
  490.     sleep(2000);
  491.   }
  492.  
  493.  
  494.   private void doBank() {
  495.    
  496.         if (bank.isDepositOpen()) {
  497.                 bank.depositAllExcept(fishingGear);
  498.                 sleep(200, 400);
  499.                 bank.close();
  500.                
  501.               //wLRCOFFICIAL  BY WAAO
  502.                  
  503.                
  504.         }
  505. }
  506.  
  507.  
  508.   private void teleUrn(){
  509.         RSItem urn = inventory.getItem(fullUrn);
  510.         if(inventory.containsOneOf(fullUrn)){//wLRCOFFICIAL  BY WAAO//wLRCOFFICIAL  BY WAAO//wLRCOFFICIAL  BY WAAO//wLRCOFFICIAL  BY WAAO//wLRCOFFICIAL  BY WAAO
  511.             //wLRCOFFICIAL  BY WAAO
  512.                 urn.interact("Teleport urn");
  513.               //wLRCOFFICIAL  BY WAAO
  514.         }
  515.         return;//wLRCOFFICIAL  BY WAAO
  516. }
  517.  
  518.   private boolean atBank() {
  519.       RSObject x = objects.getNearest(bankID);
  520.       if (x != null && x.isOnScreen()) {
  521.           return true;
  522.       }//wLRCOFFICIAL  BY WAAO
  523.       return false;
  524.   }
  525.  
  526.   private void excSpec() {
  527.     if(equipment.containsOneOf(excID)) {
  528.       if (getMyPlayer().getHPPercent() < 50 && combat.getSpecialBarEnergy() >= 100) {
  529.       combat.setSpecialAttack(true);
  530.       }//wLRCOFFICIAL  BY WAAO
  531.     }
  532.     return;//wLRCOFFICIAL  BY WAAO
  533.   }
  534.  
  535.   public void offRetaliate() {
  536.     combat.setAutoRetaliate(false);
  537.   }
  538.  
  539.   private void halfWalk() {
  540.          RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), halfWayTile);
  541.            while (calc.distanceTo(halfWayTile) > 6) {
  542.                    walkWeb.step();
  543.                    sleep(200, 800);//wLRCOFFICIAL  BY WAAO
  544.            }
  545.        }
  546.  
  547.   private void spot2Walk() {
  548.      RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), spotTile2);
  549.        while (calc.distanceTo(spotTile2) > 6) {
  550.                walkWeb.step();
  551.                sleep(200, 800);//wLRCOFFICIAL  BY WAAO
  552.        }
  553.    }
  554.  
  555.   private void spot3Walk() {
  556.          RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), spotTile3);
  557.            while (calc.distanceTo(spotTile3) > 4) {
  558.                    walkWeb.step();
  559.                    sleep(200, 800);//wLRCOFFICIAL  BY WAAO
  560.            }
  561.        }
  562.  
  563.    private void walkBank() {
  564.      RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), bankTile);
  565.        while (calc.distanceTo(bankTile) > 6) {//wLRCOFFICIAL  BY WAAO
  566.                walkWeb.step();
  567.                sleep(200, 800);
  568.        }
  569.    }
  570.    
  571.       private void walkFish() {
  572.           RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), spotTile);
  573.           while (calc.distanceTo(spotTile) > 6) {
  574.               walkWeb.step();//wLRCOFFICIAL  BY WAAO
  575.               sleep(200, 800);
  576.           }
  577.       }
  578.      
  579.       private void walkSafe() {
  580.         RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), safeTile);
  581.         while (calc.distanceTo(safeTile) > 6) {
  582.           walkWeb.step();//wLRCOFFICIAL  BY WAAO
  583.           sleep(200, 600);
  584.         }
  585.       }
  586.      
  587.       public void setRun() {
  588.        
  589.                 if(walking.getEnergy() > 40 && !walking.isRunEnabled())
  590.                 {
  591.                         walking.setRun(true);
  592.                        
  593.                 }//wLRCOFFICIAL  BY WAAO
  594.         }
  595.      
  596.       public void rest() {
  597.         walking.rest();
  598.       }
  599.      
  600. private void antiBan() {
  601.       int r = random(0, 10);
  602.       switch (r) {
  603.          
  604.       case 1:
  605.           skills.doHover(Skills.MINING);
  606.           log("Antiban activated, hovering over mining skill.");
  607.      break;
  608.          
  609.       case 2:
  610.           game.openTab(Tab.FRIENDS_CHAT);
  611.           log("Antiban activated, opening friends chat tab.");
  612.      break;
  613.      
  614.       case 3:
  615.            mouse.move(120, 0);
  616.            log("Antiban activated, mouse moves accross screen.");
  617.            sleep(random(500, 800));
  618.       break;
  619.              
  620.       case 4:
  621.           camera.setPitch(random(360, 0));
  622.           sleep(random(850, 1000));
  623.           camera.setAngle(random(280, 0));
  624.           sleep(random(450, 650));
  625.           log("Antiban activated, camera sets random angle.");
  626.       break;
  627.          
  628.       case 5:
  629.           camera.setPitch(random(280, 0));
  630.           sleep(random(450, 650));
  631.           log("Antiban activated, camera sets random angle(Between 0 and 280 Degrees.");
  632.       break;
  633.        
  634.       case 7:
  635.               mouse.moveSlightly();
  636.               log("Antiban activated, mouse moves randomly.");
  637.        break;
  638.              
  639.       case 11:
  640.         mouse.moveOffScreen();
  641.         log("Antiban activated, mouse moves off screen.");
  642.       break;
  643.        
  644.       case 16:
  645.               camera.setPitch(random(0, 360));
  646.               sleep(random(450, 650));
  647.               camera.setPitch(random(280, 0));
  648.               sleep(random(450, 650));
  649.               log("antiban activated, camera sets random angle.");
  650.        break;
  651.        
  652.       case 17:
  653.           mouse.move(60, 260);
  654.           log("antiban activated, mouse randomly.");
  655.           sleep(random(500, 800));
  656.      break;
  657.            
  658.       case 18:
  659.           mouse.moveRandomly(0, 360);
  660.           log("antiban activated, mouse randomly.");
  661.           sleep(random(500, 800));
  662.      break;
  663.      
  664.       case 19:
  665.           skills.doHover(Skills.FISHING);
  666.           sleep(random(1500, 2500));
  667.           log("antiban activated hovering over fishing skill");
  668.          
  669.       case 20:
  670.           game.openTab(Tab.EMOTES);
  671.           log("Antiban activated, emotes tab.");
  672.      break;
  673.    
  674.       case 21:
  675.           game.openTab(Tab.STATS);
  676.           log("Antiban activated, stats tab.");
  677.      break;
  678.      
  679.       case 22:
  680.           game.openTab(Tab.QUESTS);
  681.           log("Antiban activated, quests tab.");
  682.      break;
  683. }
  684.    
  685.  
  686. }
  687.  
  688.   private void drawTile(Graphics render, RSTile tile, Color color,
  689.           boolean drawCardinalDirections) {
  690.         Point southwest = calc.tileToScreen(tile, 0, 0, 0);
  691.         Point southeast = calc.tileToScreen(
  692.             new RSTile(tile.getX() + 1, tile.getY()), 0, 0, 0);
  693.         Point northwest = calc.tileToScreen(new RSTile(tile.getX(),
  694.             tile.getY() + 1), 0, 0, 0);
  695.         Point northeast = calc.tileToScreen(
  696.             new RSTile(tile.getX() + 1, tile.getY() + 1), 0, 0, 0);
  697.      
  698.         if (calc.pointOnScreen(southwest) && calc.pointOnScreen(southeast)
  699.             && calc.pointOnScreen(northwest)
  700.             && calc.pointOnScreen(northeast)) {
  701.           render.setColor(Color.GREEN);
  702.           render.drawPolygon(new int[] { (int) northwest.getX(),
  703.                   (int) northeast.getX(), (int) southeast.getX(),
  704.                   (int) southwest.getX() },
  705.                   new int[] { (int) northwest.getY(), (int) northeast.getY(),
  706.                       (int) southeast.getY(), (int) southwest.getY() }, 4);
  707.           if (drawCardinalDirections) {
  708.             render.setColor(Color.WHITE);
  709.      
  710.           }
  711.         }
  712.       }
  713.  
  714.  
  715. @Override
  716. public void onFinish() {
  717.         env.saveScreenshot(true);
  718.         log("Thanks for using wRockTails!");
  719. }
  720.  
  721.  
  722. public void messageReceived(final MessageEvent e) {
  723.     String svrmsg = e.getMessage();
  724.     if (svrmsg.contains("You catch a")) {
  725.             Fishfished++;
  726.     }
  727.             if (svrmsg.contains("teleport")) {
  728.                 urnsUsed++;
  729.             }
  730.             if (svrmsg.contains("advanced a")) {
  731.                 GainedLevels++;
  732.             }
  733.             if (svrmsg.contains("stystem update")) {
  734.                 log(Color.RED,"Logged off and shutting down to prevent death...");
  735.                 log(Color.RED,"System update, wLRC shut down...");
  736.             }
  737. }
  738.  
  739.  
  740. //
  741. //Paint Stuff
  742. //
  743.  
  744. public void mouseClicked(MouseEvent e) {
  745.     RSComponent inter = interfaces.get(137).getComponent(0);
  746.     if (inter.getArea().contains(e.getPoint())) {
  747.         showPaint = !showPaint;
  748.     }
  749. }
  750.  
  751.  
  752. @Override
  753. public void mouseEntered(MouseEvent e) {
  754.  
  755.    
  756. }
  757.  
  758. @Override
  759. public void mouseExited(MouseEvent e) {
  760.  
  761.    
  762. }
  763.  
  764. @Override
  765. public void mousePressed(MouseEvent e) {
  766.    
  767.    
  768. }
  769.  
  770. @Override
  771. public void mouseReleased(MouseEvent e) {
  772.  
  773.    
  774. }
  775.  
  776. private final Color color1 = new Color(102, 102, 102, 130);
  777. private final Color color2 = new Color(0, 0, 0);
  778. private final Color color3 = new Color(102, 102, 102, 145);
  779.  
  780. private final BasicStroke stroke1 = new BasicStroke(1);
  781. private final BasicStroke stroke2 = new BasicStroke(2);
  782.  
  783. private final Font font1 = new Font("Arial", 0, 12);
  784. private final Font font2 = new Font("Arial", 0, 20);
  785.  
  786. private final Image img1 = getImage("http://img190.imageshack.us/img190/1418/spikesz.png");
  787. private final Image img2 = getImage("http://img11.imageshack.us/img11/7006/unledig.png");
  788. private final Image img3 = getImage("http://img228.imageshack.us/img228/1010/images2w.png");
  789. private final Image img4 = getImage("http://img39.imageshack.us/img39/2066/images1q.png");
  790.  
  791. private final Image img8 = getImage("http://img594.imageshack.us/img594/9318/wlrclogo.png");
  792. private final Image img9 = getImage("http://img3.imageshack.us/img3/8803/cooltext536086984.png" );
  793. private Image getImage(String url) {
  794. try {
  795. return ImageIO.read(new URL(url));
  796. } catch(IOException e) {
  797. return null;
  798. }
  799. }
  800.  
  801.  
  802. public void onRepaint(Graphics g1) {
  803.    
  804.     drawTile(g1, getMyPlayer().getLocation(), new Color(0, 0,
  805.               200, 70), true);
  806.    
  807.      final Point p = mouse.getLocation();
  808.      final long mpt = System.currentTimeMillis()- mouse.getPressTime();
  809.      if (mouse.getPressTime() == -1 || mpt >= 1000) {
  810.              g1.drawImage(normal, p.x - 8, p.y - 8, null);
  811.      }
  812.      if (mpt < 2050) {
  813.              g1.drawImage(normal, p.x - 8, p.y - 8, null);
  814.                                            
  815.      }
  816.      expGained = skills.getCurrentExp(Skills.FISHING) - startExp;
  817.      while (!mousePath.isEmpty() && mousePath.peek().isUp())
  818.       mousePath.remove();
  819. Point clientCursor = mouse.getLocation();
  820. MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y,
  821.               1000); //1000 = lasting time/MS
  822. if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
  823.       mousePath.add(mpp);
  824. MousePathPoint lastPoint = null;
  825. for (MousePathPoint a : mousePath) {
  826.       if (lastPoint != null) {
  827.               g1.setColor(a.getColor());
  828.               g1.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  829.       }
  830.       lastPoint = a;
  831. }
  832.   long millis = System.currentTimeMillis() - startTime;
  833.   long hours = millis / (1000 * 60 * 60);
  834.   millis -= hours * (1000 * 60 * 60);
  835.   long minutes = millis / (1000 * 60);//wLRCOFFICIAL  BY WAAO
  836.   millis -= minutes * (1000 * 60);
  837.   long seconds = millis / 1000;
  838.  
  839.   float xpsec = 0;
  840.   if (((minutes > 0) || (hours > 0) || (seconds > 0)) && (expGained > 0)) {
  841.           xpsec = ((float) expGained)
  842.                           / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  843.   }
  844.   float xpmin = xpsec * 60;
  845.   float xphour = xpmin * 60;
  846.  
  847.   float Fishsec = 0;
  848.   if (((minutes > 0) || (hours > 0) || (seconds > 0)) && (Fishfished > 0)) {
  849.           Fishsec = ((float) Fishfished)
  850.                           / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  851.   }
  852.   float Fishmin = Fishsec * 60;
  853.   float Fishhour = Fishmin * 60;
  854.  
  855.   float urnsUsedsec = 0;
  856.   if (((minutes > 0) || (hours > 0) || (seconds > 0)) && (urnsUsed > 0)) {
  857.           urnsUsedsec = ((float) urnsUsed)//wLRCOFFICIAL
  858.                           / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  859.   }
  860.   float urnsUsedmin = urnsUsedsec * 60;
  861.   float urnsUsedhour = urnsUsedmin * 60;
  862.  
  863.   gpHour = (int) ((gpMade) * 3600000D/ (System.currentTimeMillis() - startTime));
  864.  
  865.   FishTillLevel = ((skills.getExpToNextLevel(Skills.FISHING) * 1) / (380));
  866.   gpMade = fishPrice * Fishfished;
  867.   final int PercentBar = (int) (skills.getPercentToNextLevel(Skills.FISHING)*4.2);
  868.  
  869.             if (xphour > 0) {//wLRCOFFICIAL  BY WAAO
  870.                 float sTNL = (TTL) / (xphour / 3600);
  871.                 float hTNL = sTNL / (60 * 60);
  872.                 sTNL -= hTNL * (60 * 60);
  873.                 float mTNL = sTNL / 60;
  874.                 sTNL -= mTNL * 60;
  875.             }
  876.            
  877.            
  878.            
  879.        
  880.            
  881.               if(showPaint){
  882. Graphics2D g = (Graphics2D)g1;
  883.  
  884.  
  885. g.drawImage(img1, 441, 318, null);
  886. g.drawImage(img1, 77, 319, null);
  887. g.drawImage(img1, 433, 319, null);
  888. g.drawImage(img2, 9, 348, null);
  889. g.setColor(color1);
  890. g.fillRoundRect(208, 259, 0, 0, 16, 16);
  891. g.drawImage(img1, 0, 320, null);
  892. g.drawImage(img3, 438, 236, null);
  893. g.setColor(color2);
  894. g.setStroke(stroke1);
  895. g.drawRect(264, 344, 233, 84);
  896. g.drawRect(349, 428, 147, 29);
  897. g.setColor(color3);
  898. g.setStroke(stroke2);
  899. g.drawRoundRect(10, 428, 338, 31, 16, 16);
  900. g.setColor(color1);
  901. g.fillRoundRect(10, 428, PercentBar, 31, 16, 16);
  902. g.drawImage(img4, 5, 256, null);
  903. g.setFont(font1);
  904. g.setColor(color2);
  905. g.drawString("Runtime:" + hours + ":" + minutes + ":" + seconds, 270, 360);
  906. g.drawString("GP Earned:" + gpMade + "     Hour: " + gpHour, 270, 391);
  907. g.drawString("Exp Gained:" + expGained + "        Exp/h: "
  908.          + (int) xphour, 270, 407);
  909. g.drawString("Fished:" + Fishfished + "   Fish/h: "
  910.                              + (int) Fishhour, 270, 376);
  911. g.drawString("Urns used:" + urnsUsed + "   urns/h: "
  912.     + (int) urnsUsedhour, 270, 421);
  913. g.drawString("Levels+:" + GainedLevels, 118, 448);
  914. g.drawString("Fish TNL:" + FishTillLevel, 225, 448);
  915. g.drawString("Version:" + props.version(), 363, 448);
  916. g.drawImage(img1, 138, 320, null);
  917. g.drawImage(img1, 211, 320, null);
  918. g.drawImage(img1, 285, 320, null);
  919. g.drawImage(img1, 361, 320, null);
  920. g.setFont(font2);
  921. g.drawImage(img8, 19, 349, null);
  922. g.drawImage(img9, 140, 362, null);
  923. g.setFont(font1);
  924. g.drawString("|world 84 or 77| |Please Donate|", 19, 417);
  925. }
  926. }
  927. public class wgui extends javax.swing.JFrame {
  928.     private static final long serialVersionUID = 1L;
  929.  public wgui(){
  930.  initComponents();
  931.  }
  932.  
  933.     private void initComponents() {
  934.        
  935.         wgui = new JFrame();
  936.         select = new JComboBox();
  937.         startBtn = new JButton();
  938.         checkBox1 = new JCheckBox();
  939.         checkBox2 = new JCheckBox();
  940.         checkBox3 = new JCheckBox();
  941.         label1 = new JLabel();
  942.         label2 = new JLabel();
  943.  
  944.         //======== wgui ========
  945.         {
  946.             setBackground(Color.darkGray);
  947.             Container ContentPane = getContentPane();
  948.             ContentPane.setLayout(null);
  949.  
  950.             //---- select ----
  951.             select.setModel(new DefaultComboBoxModel(new String[] {
  952.                 "Rocktails",           
  953.                
  954.             }));
  955.             ContentPane.add(select);
  956.             select.setBounds(new Rectangle(new Point(30, 45), select.getPreferredSize()));
  957.  
  958.             //---- startBtn ----
  959.             startBtn.setText("Start");
  960.             startBtn.addActionListener(new ActionListener() {
  961.                 @Override
  962.                 public void actionPerformed(ActionEvent e) {
  963.                     startBtnActionPerformed(e);
  964.                 }
  965.             });
  966.             ContentPane.add(startBtn);
  967.             startBtn.setBounds(new Rectangle(new Point(30, 130), startBtn.getPreferredSize()));
  968.  
  969.             //---- checkBox1 ----
  970.             checkBox1.setText("Summoning");
  971.             ContentPane.add(checkBox1);
  972.             checkBox1.setBounds(new Rectangle(new Point(10, 70), checkBox1.getPreferredSize()));
  973.            
  974.             //---- checkBox2 ----
  975.             checkBox2.setText("Excalibur Healing");
  976.             ContentPane.add(checkBox2);
  977.             checkBox2.setBounds(new Rectangle(new Point(10, 90), checkBox2.getPreferredSize()));
  978.  
  979.             //---- checkBox2 ----
  980.             checkBox3.setText("Fishing Urns");
  981.             ContentPane.add(checkBox3);
  982.             checkBox3.setBounds(new Rectangle(new Point(10, 110), checkBox3.getPreferredSize()));
  983.            
  984.             //---- label1 ----
  985.             label1.setText("Select Fish:");
  986.             ContentPane.add(label1);
  987.             label1.setBounds(new Rectangle(new Point(30, 25), label1.getPreferredSize()));
  988.  
  989.             //---- label2 ----
  990.             label2.setText("wLRC");//wLRCOFFICIAL  BY WAAO
  991.             label2.setFont(new Font("Tempus Sans ITC", Font.PLAIN, 16));
  992.             ContentPane.add(label2);
  993.             label2.setBounds(new Rectangle(new Point(50, 0), label2.getPreferredSize()));
  994.  
  995.             {
  996.            
  997.                 Dimension preferredSize = new Dimension();
  998.                 for(int i = 0; i < ContentPane.getComponentCount(); i++) {
  999.                     Rectangle bounds = ContentPane.getComponent(i).getBounds();
  1000.                     preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  1001.                     preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  1002.                 }
  1003.                 Insets insets = ContentPane.getInsets();//wLRCOFFICIAL  BY WAAO
  1004.                 preferredSize.width += insets.right;
  1005.                 preferredSize.height += insets.bottom;
  1006.                 ContentPane.setMinimumSize(preferredSize);
  1007.                 ContentPane.setPreferredSize(preferredSize);
  1008.             }
  1009.             pack();
  1010.             setLocationRelativeTo(getOwner());
  1011.         }
  1012.        
  1013.     }
  1014.    
  1015.     private void startBtnActionPerformed(ActionEvent e) {
  1016.         String chosen = select.getSelectedItem().toString();
  1017.         if (chosen.equals("Rocktails")) {
  1018.             fishSpotID = rockSpotID;
  1019.             fishID = rockTailID;
  1020.             log(Color.GREEN,"Rocktails selected, now fishing rocktails!");
  1021.             log(Color.GREEN,"Requirements to fish Rocktails: 90 Fishing, Fishing Rod and Living Rock Minerals.");
  1022.         }
  1023.        
  1024.                
  1025.                 setVisible(false);
  1026.              isReady = true;
  1027.     }
  1028.  
  1029.  
  1030.     private JFrame wgui;
  1031.     private JComboBox select;
  1032.     private JButton startBtn;
  1033.     private JCheckBox checkBox1;
  1034.     private JCheckBox checkBox2;
  1035.     private JCheckBox checkBox3;
  1036.     private JLabel label1;
  1037.     private JLabel label2;
  1038.    
  1039. }
  1040.  
  1041. }
  1042.  
  1043. //Writen by: waao, All copyright to waao powerbot user.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement