Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: JavaScript  |  size: 27.77 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.BasicStroke;
  2. import java.awt.Color;
  3. import java.awt.Dimension;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.awt.Image;
  8. import java.awt.Point;
  9. import java.awt.Rectangle;
  10. import java.awt.Toolkit;
  11. import java.awt.event.ActionEvent;
  12. import java.awt.event.ActionListener;
  13. import java.awt.event.MouseEvent;
  14. import java.awt.event.MouseListener;
  15. import java.io.File;
  16. import java.net.URL;
  17.  
  18. import javax.imageio.ImageIO;
  19. import javax.swing.DefaultComboBoxModel;
  20. import javax.swing.JButton;
  21. import javax.swing.JComboBox;
  22. import javax.swing.JFrame;
  23. import javax.swing.JTextPane;
  24. import javax.swing.SwingUtilities;
  25.  
  26. import org.powerbot.concurrent.Task;
  27. import org.powerbot.concurrent.strategy.Condition;
  28. import org.powerbot.concurrent.strategy.Strategy;
  29. import org.powerbot.game.api.ActiveScript;
  30. import org.powerbot.game.api.Manifest;
  31. import org.powerbot.game.api.methods.Tabs;
  32. import org.powerbot.game.api.methods.Walking;
  33. import org.powerbot.game.api.methods.Widgets;
  34. import org.powerbot.game.api.methods.input.Mouse;
  35. import org.powerbot.game.api.methods.interactive.NPCs;
  36. import org.powerbot.game.api.methods.interactive.Players;
  37. import org.powerbot.game.api.methods.node.Menu;
  38. import org.powerbot.game.api.methods.node.SceneEntities;
  39. import org.powerbot.game.api.methods.tab.Inventory;
  40. import org.powerbot.game.api.methods.tab.Skills;
  41. import org.powerbot.game.api.methods.widget.Camera;
  42. import org.powerbot.game.api.util.Random;
  43. import org.powerbot.game.api.util.Time;
  44. import org.powerbot.game.api.wrappers.Tile;
  45. import org.powerbot.game.api.wrappers.node.SceneObject;
  46. import org.powerbot.game.api.wrappers.widget.WidgetChild;
  47. import org.powerbot.game.bot.event.MessageEvent;
  48. import org.powerbot.game.bot.event.listener.MessageListener;
  49. import org.powerbot.game.bot.event.listener.PaintListener;
  50.  
  51.  
  52.  
  53.  
  54. @Manifest(
  55.                 name = "BD Gold Bars",
  56.                 version = 3.1,
  57.                 description = "Start near Edge Village's bank",
  58.                 authors = {"BullDozerx6"}
  59.                 )
  60. public class BDGoldBars extends ActiveScript implements PaintListener, MessageListener, MouseListener
  61. {
  62.  int GoldBarsC;
  63.  int BankId;
  64.  int FurnaceId;
  65.  String Status = "Starting up";
  66.  int SmithStart;
  67.  int Level;
  68.  String currentversion = "3.1";
  69.  int GoldBarsLast;
  70.  int GoldBarsNew;
  71.  int GoldTime;
  72.  boolean gift = false;
  73.  boolean Start = false;
  74.  boolean antban;
  75.  int Rand;
  76.  int Door;
  77.  int Locat;
  78.  Image Gold;
  79.  int GoldShow;
  80. @Override
  81.                 protected void setup()
  82.                 {
  83.         Gold = getImage("http://i45.tinypic.com/281u3xk.png","281u3xk.png");
  84.           SwingUtilities.invokeLater(new Runnable() {
  85.                  public void run() {
  86.                      try {
  87.                          final BDGoldgui BD = new BDGoldgui();
  88.                          BD.setVisible(true);
  89.                      } catch (Exception e) {
  90.                          e.printStackTrace();
  91.                      }
  92.                  }
  93.              });
  94.                      
  95.                 }
  96.  
  97. @SuppressWarnings("deprecation")
  98. public Image getImage(String url, String name) {
  99.         try {
  100.                 File dir = new File(getStorageDirectory().getAbsolutePath() + System.getProperty("file.seperator") + name);
  101.                 if(!dir.exists()) {
  102.                         ImageIO.write(ImageIO.read(new URL(url)), url.substring(url.lastIndexOf('.')).substring(1), dir);
  103.                 }
  104.                 return ImageIO.read(dir);
  105.         } catch(Exception a) {
  106.                 a.printStackTrace();
  107.         }
  108.         return null;
  109. }
  110. @Override
  111. public void messageReceived(MessageEvent e)
  112. {
  113.         if(e.getMessage().contains("You retrieve a bar of gold ")){GoldBarsC++; GoldBarsNew++;}
  114.         else if(e.getMessage().contains("gift ")){gift = true;}
  115. }
  116. public static boolean isBankOpen() {
  117.         return Widgets.get(762).validate();
  118. }
  119. final class BDGoldgui extends JFrame implements ActionListener {
  120.     private static final long serialVersionUID = 1L;
  121.     @SuppressWarnings("unchecked")
  122.     public BDGoldgui() {
  123.     setTitle("BDGoldBars v3.1");
  124.     final JButton start = new JButton("Start");
  125.     start.setBounds(80, 40, 60, 30);
  126.     start.addActionListener(this);
  127.     getContentPane().setLayout(null);
  128.     getContentPane().add(start);
  129.    
  130.     JTextPane t = new JTextPane();
  131.     t.setBounds(10, 10, 100, 20);
  132.     t.setEditable(false);
  133.     t.setBackground(null);
  134.     t.setText("Select the Place:");
  135.     getContentPane().add(t);
  136.      
  137.     final JComboBox Rock = new JComboBox();
  138.     Rock.setModel(new DefaultComboBoxModel(new String[] {"EdgeVille", "Port Phasmatys", "Al Kahid", "Neitiznot"}));
  139.     Rock.setBounds(130, 10, 90, 20);
  140.     getContentPane().add(Rock);
  141.     setSize(250, 130);
  142.    
  143.     start.addActionListener(new ActionListener() {
  144.         @Override
  145.         public void actionPerformed(ActionEvent e) {
  146.             String s = Rock.getSelectedItem().toString();
  147.            
  148.         if(s == "EdgeVille") {
  149.                 INIT i = new INIT();
  150.                 provide(new Strategy(i,i));
  151.                 Locat = 1;
  152.                      EdgeBankWalk ew = new EdgeBankWalk();
  153.                      provide(new Strategy(ew,ew));
  154.                      EdgeBank eb = new EdgeBank();
  155.                      provide(new Strategy(eb,eb));
  156.                      EdgeFurnWalk efw = new EdgeFurnWalk();
  157.                      provide(new Strategy(efw,efw));
  158.                      EdgeFurn ef = new EdgeFurn();
  159.                      provide(new Strategy(ef,ef));
  160.                      Anti a = new Anti();
  161.                      provide(new Strategy(a,a));
  162.                      EdgeSmelt es = new EdgeSmelt();
  163.                      provide(new Strategy(es,es));
  164.                      Nlev n = new Nlev();
  165.                      provide(new Strategy(n,n));
  166.                      
  167.        
  168.         } else if(s == "Port Phasmatys") {
  169.                 PhasINIT i = new PhasINIT();
  170.                 provide(new Strategy(i,i));
  171.                 Locat = 2;
  172.                  PhasBankWalk ew = new PhasBankWalk();
  173.              provide(new Strategy(ew,ew));
  174.              PhasBank eb = new PhasBank();
  175.              provide(new Strategy(eb,eb));
  176.              PhasFurnWalk efw = new PhasFurnWalk();
  177.              provide(new Strategy(efw,efw));
  178.              PhasDoor d = new PhasDoor();
  179.              provide(new Strategy(d,d));
  180.              PhasFurn ef = new PhasFurn();
  181.              provide(new Strategy(ef,ef));
  182.              Anti a = new Anti();
  183.              provide(new Strategy(a,a));
  184.              PhasSmelt es = new PhasSmelt();
  185.              provide(new Strategy(es,es));
  186.              PhasDoor d2 = new PhasDoor();
  187.                  provide(new Strategy(d2,d2));
  188.                Nlev n = new Nlev();
  189.              provide(new Strategy(n,n));
  190.         }else if(s == "Al Kahid"){
  191.                 AlINIT i = new AlINIT();
  192.                 provide(new Strategy(i,i));
  193.                 Locat = 3;
  194.                  AlkBankWalk ew = new AlkBankWalk();
  195.              provide(new Strategy(ew,ew));
  196.              AlkBank eb = new AlkBank();
  197.              provide(new Strategy(eb,eb));
  198.              AlkFurnWalk efw = new AlkFurnWalk();
  199.              provide(new Strategy(efw,efw));
  200.              AlkFurn ef = new AlkFurn();
  201.              provide(new Strategy(ef,ef));
  202.              Anti a = new Anti();
  203.              provide(new Strategy(a,a));
  204.              AlkSmelt es = new AlkSmelt();
  205.              provide(new Strategy(es,es));
  206.            Nlev n = new Nlev();
  207.              provide(new Strategy(n,n));
  208.         }else if(s == "Neitiznot"){
  209.                 AlINIT i = new AlINIT();
  210.                 provide(new Strategy(i,i));
  211.                 Locat = 4;
  212.                  NeitBankWalk ew = new NeitBankWalk();
  213.              provide(new Strategy(ew,ew));
  214.              NeitBank eb = new NeitBank();
  215.              provide(new Strategy(eb,eb));
  216.              NeitFurnWalk efw = new NeitFurnWalk();
  217.              provide(new Strategy(efw,efw));
  218.              NeitFurn ef = new NeitFurn();
  219.              provide(new Strategy(ef,ef));
  220.              Anti a = new Anti();
  221.              provide(new Strategy(a,a));
  222.              NeitSmelt es = new NeitSmelt();
  223.              provide(new Strategy(es,es));
  224.            Nlev n = new Nlev();
  225.              provide(new Strategy(n,n));
  226.         }
  227.             setVisible(false);
  228.         }            
  229.     });
  230.     Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
  231.     int x = (int) ((dimension.getWidth() - getWidth()) / 2);
  232.     int y = (int) ((dimension.getHeight() - getHeight()) / 2);
  233.     setLocation(x, y);
  234. }
  235.  
  236. @Override
  237. public void actionPerformed(ActionEvent e) {
  238.     this.setVisible(false);
  239.     this.dispose();
  240.    
  241. }
  242. }    
  243.  
  244. public boolean BANK(){
  245.         for(SceneObject Local : SceneEntities.getLoaded())
  246.            {
  247.                
  248.                         if(Local.getId() == 2759){
  249.                                 if(Local.isOnScreen()){
  250.                                         BankId = 2759; return true;}}
  251.                        
  252.            }
  253.         return false;
  254. }
  255. public boolean FURNACE(){
  256.         for(SceneObject Local : SceneEntities.getLoaded())
  257.            {
  258.                
  259.                         if(Local.getId() == 26814){
  260.                                 if(Local.isOnScreen()){
  261.                                         FurnaceId= 26814; return true;}}
  262.                        
  263.            }
  264.         return false;
  265. }
  266. public boolean PhasBANK(){
  267.         for(SceneObject Local : SceneEntities.getLoaded())
  268.            {
  269.                
  270.                         if(Local.getId() == 5276){
  271.                                 if(Local.isOnScreen()){
  272.                                         BankId = 5276; return true;}}
  273.                        
  274.            }
  275.         return false;
  276. }
  277. public boolean NeitBANK(){
  278.         for(SceneObject Local : SceneEntities.getLoaded())
  279.            {
  280.                
  281.                         if(Local.getId() == 21301){
  282.                                 if(Local.isOnScreen()){
  283.                                         BankId = 21301; return true;}}
  284.                        
  285.            }
  286.         return false;
  287. }
  288. public boolean PhasFURNACE(){
  289.         for(SceneObject Local : SceneEntities.getLoaded())
  290.            {
  291.                
  292.                         if(Local.getId() == 11666){
  293.                                 if(Local.isOnScreen()){
  294.                                         FurnaceId= 11666; return true;}}
  295.                        
  296.            }
  297.         return false;
  298. }
  299. public boolean NeitFURNACE(){
  300.         for(SceneObject Local : SceneEntities.getLoaded())
  301.            {
  302.                
  303.                         if(Local.getId() == 21303){
  304.                                 if(Local.isOnScreen()){
  305.                                         FurnaceId= 21303; return true;}}
  306.                        
  307.            }
  308.         return false;
  309. }
  310. public boolean Door(){
  311.         for(SceneObject Local : SceneEntities.getLoaded())
  312.            {
  313.                
  314.                         if(Local.getId() == 5245){
  315.                                 if(Local.isOnScreen()){
  316.                                         Door = 5244; return true;}}
  317.                        
  318.            }
  319.         return false;
  320. }
  321. private class AlINIT extends Strategy implements Task
  322. {
  323.         @Override
  324.         public void run(){
  325.                 if(Start == false){
  326.                         Tabs.INVENTORY.open();
  327.             Level = Skills.getLevel(Skills.SMITHING);
  328.                 SmithStart = Skills.getExperience(13);
  329.             Time.sleep(1000);
  330.                 Widgets.get(548).getChild(145).click(true);
  331.                 Time.sleep(400);
  332.                 Camera.setPitch(100);
  333.                
  334.                 Start = true;}
  335.         }
  336.         @Override
  337.         public boolean validate(){
  338.                 return true;
  339.         }
  340. }
  341. private class PhasINIT extends Strategy implements Task
  342. {
  343.         @Override
  344.         public void run(){
  345.                 if(Start == false){
  346.                         Tabs.INVENTORY.open();
  347.             Level = Skills.getLevel(Skills.SMITHING);
  348.                 SmithStart = Skills.getExperience(13);
  349.             Time.sleep(1000);
  350.                 Widgets.get(548).getChild(145).click(true);
  351.                 Time.sleep(400);
  352.                 Camera.setAngle(-45);
  353.                 Time.sleep(400);
  354.                 Camera.setPitch(100);
  355.                
  356.                 Start = true;}
  357.         }
  358.         @Override
  359.         public boolean validate(){
  360.                 return true;
  361.         }
  362. }
  363. private class INIT extends Strategy implements Task
  364. {
  365.         @Override
  366.         public void run(){
  367.                 if(Start == false){
  368.                         Tabs.INVENTORY.open();
  369.             Level = Skills.getLevel(Skills.SMITHING);
  370.                 SmithStart = Skills.getExperience(13);
  371.             Time.sleep(1000);
  372.                 Widgets.get(548).getChild(145).click(true);
  373.                 Time.sleep(400);
  374.                 Camera.setPitch(100);
  375.                
  376.                 Start = true;}
  377.         }
  378.         @Override
  379.         public boolean validate(){
  380.                 return true;
  381.         }
  382. }
  383. public boolean withdraw() {
  384.         WidgetChild[] bank = Widgets.get(762, 95).getChildren();
  385.         for (WidgetChild child : bank) {
  386.                 if (child.getChildId() == 444) {
  387.                        
  388.                         child.click(false);
  389.                        
  390.                                 Menu.select("Withdraw-All");
  391.                             Time.sleep(Random.nextInt(1000,1200));
  392.                             return true;
  393.                 }              
  394.         }
  395.            Widgets.get(762).getChild(45).click(true);
  396.            Time.sleep(500);
  397.         Mouse.click(752, 12, true);
  398.         Time.sleep(500);
  399.         Mouse.click(639, 407, true);
  400.         stop();
  401.         return false;
  402.        
  403. }
  404. public void Banking(){
  405.                 Status = "Banking";
  406.                 Widgets.get(762).getChild(34).click(true);
  407.                 Time.sleep(1500);
  408.        
  409. }
  410. public void Antib(int ant){
  411. if(ant == 1){
  412.         Camera.setAngle(Random.nextInt(20, 250));
  413.         Status = "Anti-Ban";
  414. }
  415. else
  416. if(ant == 2 || ant == 5 || ant == 10 || ant == 11){
  417. do{Tabs.STATS.open();}while(!Tabs.STATS.open());               
  418. Widgets.get(320).getChild(16).hover();
  419. Time.sleep(Random.nextInt(4000, 6000));
  420. do{Tabs.INVENTORY.open();}while(!Tabs.INVENTORY.open());
  421. Status = "Anti-Ban";
  422. }
  423. else
  424. if(ant == 3){
  425.         Mouse.move(Random.nextInt(1, 500),Random.nextInt(1, 500),Random.nextInt(1, 500),Random.nextInt(1, 500));
  426.         Status = "Anti-Ban";
  427.        
  428. }
  429. else
  430. if(ant == 4){
  431.    Camera.setPitch(Random.nextInt(20, 250));Status = "Anti-Ban";
  432. }
  433. }
  434. public void Time()
  435. {
  436.         GoldTime=0;
  437.         do{Time.sleep(10); GoldTime++;
  438.         if(GoldBarsLast < GoldBarsNew){GoldTime = 0;}
  439.         if(GoldTime < 1000 && GoldBarsLast != GoldBarsNew){GoldBarsLast = GoldBarsNew;}}
  440.         while(Inventory.getCount(444) > 0);
  441. }
  442. private class PhasSmelt extends Strategy implements Task, Condition
  443. {
  444. @Override
  445. public void run(){
  446.  
  447.          Status = "Smelting";
  448.          GoldBarsNew = 0;
  449.          GoldBarsLast = GoldBarsNew;
  450.          Time();
  451. }
  452. @Override
  453. public boolean validate(){
  454.         return true;
  455. }
  456. }
  457. private class PhasFurn extends Strategy implements Task, Condition
  458. {
  459. @Override
  460. public void run(){
  461.          Status = "Finding Furnace";
  462.          PhasFURNACE();
  463.          do{
  464.          SceneObject OB1 = SceneEntities.getNearest(FurnaceId);
  465.          OB1.interact("Smelt");
  466.          Widgets.get(905).getChild(19).click(true);
  467.          Status = "Smelting";
  468.          Time.sleep(Random.nextInt(5000, 10000));}
  469.          while(Inventory.getCount(444) == 28);
  470.  
  471. }
  472. @Override
  473. public boolean validate(){
  474.         return true;
  475. }
  476. }
  477. private class PhasDoor extends Strategy implements Task, Condition
  478. {
  479. @Override
  480. public void run(){
  481.          Door();
  482.          SceneObject OB2 = SceneEntities.getNearest(Door);
  483.          do{
  484.          if(!Door()){
  485.                  Status = "Door closed?";
  486.                  OB2.interact("Open");
  487.                  Time.sleep(1500);
  488.                
  489.          } Door();}while(!Door());
  490.  
  491. }
  492. @Override
  493. public boolean validate(){
  494.         return true;
  495. }
  496. }
  497. private class PhasFurnWalk extends Strategy implements Task, Condition
  498. {
  499. @Override
  500. public void run(){
  501.  
  502.           Status = "Walking";
  503.          do{Walking.walk(new Tile(3685, 3479, 0));
  504.          Time.sleep(1000);}while(!Players.getLocal().isMoving());
  505.          do{Time.sleep(10); Door();}while(!Door());
  506. }
  507. @Override
  508. public boolean validate(){
  509.         return true;
  510. }
  511. }
  512. private class PhasBank extends Strategy implements Task, Condition
  513. {
  514. @Override
  515. public void run(){
  516.         if(Inventory.getCount(444) != 28)
  517.         {
  518.     if(!isBankOpen()){
  519.         Status = "Opening Bank";
  520.         SceneObject OB = SceneEntities.getNearest(BankId);
  521.        
  522.         do{
  523.          OB.interact("Bank");
  524.          Time.sleep(500);
  525.          do{Time.sleep(10);}while(Players.getLocal().isMoving());
  526.          Time.sleep(1000);}while(!Widgets.get(1186).getChild(7).isOnScreen());
  527.            Mouse.click(Random.nextInt(228, 289), Random.nextInt(462, 470), true);
  528.            Time.sleep(1500);
  529.         do{
  530.                 Status = "Banking";
  531.                 Banking();}
  532.                 while(Inventory.getCount() > 0);
  533.        
  534.          do{
  535.                         Status = "Taking Ores";
  536.                         withdraw();
  537.                         Time.sleep(1000);}
  538.                         while(Inventory.getCount(444) == 0);}
  539.         }
  540.  
  541. }
  542. @Override
  543. public boolean validate(){
  544.         return true;
  545. }
  546. }
  547. private class PhasBankWalk extends Strategy implements Task, Condition
  548. {
  549. @Override
  550. public void run(){
  551.         if(Inventory.getCount(444) != 28)
  552.         {
  553.     if(!isBankOpen()){
  554.     Status = "Walking";
  555.          Walking.walk(new Tile(Random.nextInt(3687, 3691), 3465, 0));
  556.     do{Time.sleep(10); PhasBANK();}while(PhasBANK() == false);}}
  557. }
  558. @Override
  559. public boolean validate(){
  560.         return true;
  561. }
  562. }
  563. private class EdgeSmelt extends Strategy implements Task, Condition
  564. {
  565. @Override
  566. public void run(){
  567.          Status = "Smelting";
  568.          GoldBarsNew = 0;
  569.          GoldBarsLast = GoldBarsNew;
  570.          Time();
  571. }
  572. @Override
  573. public boolean validate(){
  574.         return true;
  575. }
  576. }
  577. private class EdgeFurn extends Strategy implements Task, Condition
  578. {
  579. @Override
  580. public void run(){
  581.          Status = "Finding furnace";
  582.          FURNACE();
  583.          do{
  584.          SceneObject OB1 = SceneEntities.getNearest(FurnaceId);
  585.          OB1.interact("Smelt");
  586.          Widgets.get(905).getChild(19).click(true);
  587.          Status = "Smelting";
  588.          Time.sleep(Random.nextInt(5000, 6000));}
  589.          while(Inventory.getCount(444) == 28);
  590. }
  591. @Override
  592. public boolean validate(){
  593.         return true;
  594. }
  595. }
  596. private class EdgeFurnWalk extends Strategy implements Task, Condition
  597. {
  598. @Override
  599. public void run(){
  600.           Status = "Walking";
  601.                  Walking.walk(new Tile(3110, Random.nextInt(3499, 3501), 0));
  602.                  do{Time.sleep(10);}while(isBankOpen());
  603.                  Time.sleep(500);
  604.                  do{Time.sleep(10); FURNACE();}while(Players.getLocal().isMoving() && !FURNACE());
  605. }
  606. @Override
  607. public boolean validate(){
  608.         return true;
  609. }
  610. }
  611. private class EdgeBank extends Strategy implements Task, Condition
  612. {
  613. @Override
  614. public void run(){
  615.         if(Inventory.getCount(444) != 28)
  616.         {
  617.     if(!isBankOpen()){
  618.         Status = "Opening Bank";
  619.         do{
  620.          NPCs.getNearest(2759).interact("Bank");
  621.          if(Widgets.get(205).getChild(0).isOnScreen()){
  622.                  do{Mouse.click(496, 23, true); Time.sleep(500);}while(Widgets.get(205).getChild(0).isOnScreen());
  623.          }
  624.          Time.sleep(1500);
  625.          if(Widgets.get(205).getChild(0).isOnScreen()){
  626.                  do{Mouse.click(496, 23, true); Time.sleep(500);}while(Widgets.get(205).getChild(0).isOnScreen());
  627.          }
  628.         do{Time.sleep(10);}while(Players.getLocal().isMoving());
  629.         if(Widgets.get(205).getChild(0).isOnScreen()){
  630.                  do{Mouse.click(496, 23, true); Time.sleep(500);}while(Widgets.get(205).getChild(0).isOnScreen());
  631.          }}while(!isBankOpen());
  632.         do{
  633.                 Status = "Banking";
  634.                 Banking();}
  635.                 while(Inventory.getCount() > 0);
  636.        
  637.          do{
  638.                         Status = "Taking Ores";
  639.                         withdraw();
  640.                         Time.sleep(1000);}
  641.                         while(Inventory.getCount(444) == 0);
  642. }}
  643. }
  644. @Override
  645. public boolean validate(){
  646.         return true;
  647. }
  648. }
  649. private class EdgeBankWalk extends Strategy implements Task, Condition
  650. {
  651. @Override
  652. public void run(){
  653.         if(Inventory.getCount(444) != 28)
  654.         {
  655.     if(!isBankOpen()){
  656.     Status = "Walking";
  657.          Walking.walk(new Tile(3097, Random.nextInt(3495, 3498), 0));
  658.          Time.sleep(500);
  659.     do{Time.sleep(10);}while(Players.getLocal().isMoving());}}
  660. }
  661. @Override
  662. public boolean validate(){
  663.         return true;
  664. }
  665. }
  666. private class AlkSmelt extends Strategy implements Task, Condition
  667. {
  668. @Override
  669. public void run(){
  670.          Status = "Smelting";
  671.          GoldBarsNew = 0;
  672.          GoldBarsLast = GoldBarsNew;
  673.          Time();
  674. }
  675. @Override
  676. public boolean validate(){
  677.         return true;
  678. }
  679. }
  680. private class AlkFurn extends Strategy implements Task, Condition
  681. {
  682. @Override
  683. public void run(){
  684.          Status = "Finding furnace";
  685.          FURNACE();
  686.          do{
  687.          SceneObject OB1 = SceneEntities.getNearest(FurnaceId);
  688.          OB1.interact("Smelt");
  689.          Widgets.get(905).getChild(19).click(true);
  690.          Status = "Smelting";
  691.          Time.sleep(Random.nextInt(8000, 10000));}
  692.          while(Inventory.getCount(444) == 28);
  693. }
  694. @Override
  695. public boolean validate(){
  696.         return true;
  697. }
  698. }
  699. private class AlkFurnWalk extends Strategy implements Task, Condition
  700. {
  701. @Override
  702. public void run(){
  703.           Status = "Walking";
  704.          Walking.walk(new Tile(3275, 3184, 0));
  705.          Time.sleep(1000);
  706.          do{Time.sleep(10); PhasFURNACE();}while(!PhasFURNACE());
  707. }
  708. @Override
  709. public boolean validate(){
  710.         return true;
  711. }
  712. }
  713. private class AlkBank extends Strategy implements Task, Condition
  714. {
  715. @Override
  716. public void run(){
  717.         if(Inventory.getCount(444) != 28)
  718.         {
  719.                 if(!isBankOpen()){
  720.     Status = "Opening Bank";
  721.    
  722.     do{
  723.          NPCs.getNearest(496).interact("Bank");
  724.          Time.sleep(2000);}while(!isBankOpen());
  725.     do{
  726.                 Status = "Banking";
  727.                 Banking();}
  728.                 while(Inventory.getCount() > 0);
  729.    
  730.          do{
  731.                         Status = "Taking Ores";
  732.                         withdraw();
  733.                         Time.sleep(1000);}
  734.                         while(Inventory.getCount(444) == 0);}}}
  735.  
  736. @Override
  737. public boolean validate(){
  738.         return true;
  739. }
  740. }
  741. private class AlkBankWalk extends Strategy implements Task, Condition
  742. {
  743. @Override
  744. public void run(){
  745.         if(Inventory.getCount(444) != 28)
  746.         {
  747.     if(!isBankOpen()){
  748.     Status = "Walking";
  749.         do{Walking.walk(new Tile(Random.nextInt(3269, 3271), Random.nextInt(3169,3170), 0));
  750.         Time.sleep(1500);}while(!Players.getLocal().isMoving());
  751.     do{Time.sleep(10);}while(Players.getLocal().isMoving());}}
  752. }
  753. @Override
  754. public boolean validate(){
  755.         return true;
  756. }
  757. }
  758. private class Anti extends Strategy implements Task, Condition
  759. {
  760. @Override
  761. public void run(){
  762.  
  763.          Mouse.move(Random.nextInt(1, 600),Random.nextInt(1, 600),Random.nextInt(1, 600),Random.nextInt(1, 600));
  764.          Time.sleep(500);
  765.          Antib(Random.nextInt(0, 15));
  766. }
  767. @Override
  768. public boolean validate(){
  769.         return true;
  770. }
  771. }
  772. private class NeitSmelt extends Strategy implements Task, Condition
  773. {
  774. @Override
  775. public void run(){
  776.  
  777.          Status = "Smelting";
  778.          GoldBarsNew = 0;
  779.          GoldBarsLast = GoldBarsNew;
  780.          Time();
  781. }
  782. @Override
  783. public boolean validate(){
  784.         return true;
  785. }
  786. }
  787. private class NeitFurn extends Strategy implements Task, Condition
  788. {
  789. @Override
  790. public void run(){
  791.  
  792.          Status = "Fiding furnace";
  793.          do{
  794.          SceneObject OB1 = SceneEntities.getNearest(FurnaceId);
  795.          do{Time.sleep(10);}while(Players.getLocal().isMoving());
  796.          OB1.interact("Smelt-ore");
  797.          Widgets.get(905).getChild(19).click(true);
  798.          Status = "Smelting";
  799.          Time.sleep(Random.nextInt(5000, 6000));}
  800.          while(Inventory.getCount(444) == 28);
  801. }
  802. @Override
  803. public boolean validate(){
  804.         return true;
  805. }
  806. }
  807. private class NeitFurnWalk extends Strategy implements Task, Condition
  808. {
  809. @Override
  810. public void run(){
  811.           Status = "Walking";
  812.          Walking.walk(new Tile(2344, 3809, 0));
  813.          Time.sleep(1000);
  814.           NeitFURNACE();
  815.          do{Time.sleep(10); NeitFURNACE();}while(!NeitFURNACE());
  816. }
  817. @Override
  818. public boolean validate(){
  819.         return true;
  820. }
  821. }
  822. private class NeitBank extends Strategy implements Task, Condition
  823. {
  824. @Override
  825. public void run(){
  826.         if(Inventory.getCount(444) != 28)
  827.         {
  828.             if(!isBankOpen()){
  829.                 NeitBANK();
  830.                 Status = "Walking";
  831.              
  832.                 Status = "Opening Bank";
  833.                 SceneObject OB = SceneEntities.getNearest(BankId);
  834.                 do{
  835.                  OB.interact("Use");
  836.                  Time.sleep(500);
  837.                  do{Time.sleep(10);}while(Players.getLocal().isMoving());
  838.                  Time.sleep(1500);}while(!isBankOpen());}
  839.                 do{
  840.                         Status = "Banking";
  841.                         Banking();}
  842.                         while(Inventory.getCount() > 0);
  843.                
  844.                  do{
  845.                                 Status = "Taking Ores";
  846.                                 withdraw();
  847.                                 Time.sleep(1000);}
  848.                                 while(Inventory.getCount(444) == 0);
  849.                  }
  850. }
  851. @Override
  852. public boolean validate(){
  853.         return true;
  854. }
  855. }
  856. private class NeitBankWalk extends Strategy implements Task, Condition
  857. {
  858. @Override
  859. public void run(){
  860.         if(Inventory.getCount(444) != 28)
  861.         {
  862.                    if(NeitBANK() == false){
  863.                             do{Walking.walk(new Tile(Random.nextInt(2236, 2237), Random.nextInt(3806,3808), 0));
  864.                                 Time.sleep(800);}while(!Players.getLocal().isMoving());
  865.                             do{Time.sleep(10);}while(Players.getLocal().isMoving());}}
  866. }
  867. @Override
  868. public boolean validate(){
  869.         return true;
  870. }
  871. }
  872. private class Nlev extends Strategy implements Task, Condition
  873. {
  874. @Override
  875. public void run(){
  876.         NLEVEL = Skills.getLevel(Skills.getLevel(Skills.SMITHING)) - Level;
  877. }
  878. @Override
  879. public boolean validate(){
  880.         return true;
  881. }
  882. }
  883.  
  884. private final static Rectangle Golds = new Rectangle(453 , 343, 60, 17);
  885. @Override
  886. public void mousePressed(MouseEvent arg0) {
  887.  
  888.  
  889.      
  890. }
  891. @Override
  892. public void mouseClicked(MouseEvent e) {
  893.      
  894.          Point p = e.getPoint();
  895.      if(Golds.contains(p)) {
  896.         if( GoldShow== 0){
  897.                  GoldShow = 1;}
  898.         else if( GoldShow == 1){ GoldShow = 2;}
  899.         else if( GoldShow == 2){ GoldShow = 0;}
  900.        
  901.      }
  902.        
  903. }
  904. @Override
  905. public void mouseEntered(MouseEvent arg0) {
  906.          
  907. }
  908. @Override
  909. public void mouseExited(MouseEvent arg0) {
  910.  
  911. }
  912. @Override
  913. public void mouseReleased(MouseEvent arg0) {
  914.        
  915. }
  916. private final Color color1 = new Color(0, 0, 0, 180);
  917. private final Color color2 = new Color(180, 180, 1);
  918. private final Color color3 = new Color(0, 0, 0);
  919. private final BasicStroke stroke1 = new BasicStroke(1);
  920. private final Font font3 = new Font("Arial", 1, 10);
  921. private final Font font1 = new Font("Arial", 1, 9);
  922.  
  923.  
  924.     private static long StartTime = System.currentTimeMillis();
  925.     int NLEVEL;
  926.  
  927.     @Override
  928.     public void onRepaint(Graphics graphics) {
  929.        
  930.         long milliseconds = System.currentTimeMillis() - StartTime;
  931.         long t_seconds = milliseconds / 1000;
  932.                 long t_minutes = t_seconds / 60;
  933.                 long t_hours = t_minutes / 60;
  934.                 long seconds = t_seconds % 60;
  935.                 long minutes = t_minutes % 60;
  936.                 long hours = t_hours % 500;
  937.                 String RunTime = hours + ":" + minutes + ":" + seconds;
  938.                 int SmithExpGain = Skills.getExperience(13) - SmithStart;
  939.                 int SmithPerHour = 0;
  940.                 float SmithPerSec = 0;
  941.                 int Gperhour = 0;
  942.                 float gpersec = 0;
  943.                 float Smith = Skills.getExperienceToLevel(Skills.SMITHING, Skills.getRealLevel(Skills.SMITHING) + 1);
  944.                 float sm = 0;
  945.                
  946.                
  947.                 if ((minutes > 0 || hours > 0 || seconds > 0) && SmithExpGain > 0) {
  948.                         SmithPerSec = ((float) SmithExpGain)/(float)(seconds + (minutes*60) + (hours*60*60));
  949.                 }
  950.                 SmithPerHour = Math.round(SmithPerSec * 3600);
  951.                 if ((minutes > 0 || hours > 0 || seconds > 0) && GoldBarsC > 0) {
  952.                         gpersec = ((float) GoldBarsC)/(float)(seconds + (minutes*60) + (hours*60*60));
  953.                 }
  954.                 Gperhour = Math.round(gpersec * 3600);
  955.                 sm = Smith/SmithPerHour;  
  956.                 if(Skills.getRealLevel(Skills.SMITHING) >= 99){
  957.                                 sm = 0;
  958.                         }
  959.             graphics.setColor(Color.black);
  960.         Graphics2D g2d = (Graphics2D)graphics;
  961.        
  962.         if(GoldShow == 0){
  963.         g2d.drawImage(Gold, 0, 338, null);
  964.         g2d.setFont(font1);
  965.         g2d.setColor(color3);
  966.         g2d.drawString("Made By BullDozerx6 v" + currentversion, 13, 385);
  967.         g2d.setFont(font3);
  968.         g2d.setColor(Color.black);
  969.         g2d.drawString("" +RunTime, 104, 399);
  970.         g2d.drawString("" + Status,85, 420);
  971.         g2d.drawString("" +  SmithExpGain,72, 444);
  972.         g2d.drawString("" + SmithPerHour ,259, 443);
  973.         g2d.drawString("" + GoldBarsC ,246, 399);
  974.         g2d.drawString("" + Gperhour ,277, 422);
  975.         g2d.drawString("" + Level +"("+NLEVEL+")" ,386, 400);
  976.         g2d.drawString("" + sm + "h", 384, 422);
  977.         g2d.setColor(color1);
  978.         g2d.fillRoundRect(453, 343, 60, 17, 5, 5);
  979.         g2d.setColor(color2);
  980.         g2d.setStroke(stroke1);
  981.         g2d.drawRoundRect(453, 343, 60, 17, 5, 5);
  982.         g2d.setFont(font3);
  983.         g2d.drawString("Change", 464, 356);}
  984.         else if(GoldShow == 1){
  985.             g2d.drawImage(Gold, 0, 197, null);
  986.             g2d.setFont(font1);
  987.             g2d.setColor(color3);
  988.             g2d.drawString("Made By BullDozerx6 v" + currentversion, 13, 244);
  989.             g2d.setFont(font3);
  990.             g2d.setColor(Color.black);
  991.             g2d.drawString("" +RunTime, 104, 399-141);
  992.             g2d.drawString("" + Status,85, 420-141);
  993.             g2d.drawString("" +  SmithExpGain,72, 444-141);
  994.             g2d.drawString("" + SmithPerHour ,259, 443-141);
  995.             g2d.drawString("" + GoldBarsC ,246, 399-141);
  996.             g2d.drawString("" + Gperhour ,277, 422-141);
  997.             g2d.drawString("" + Level +"("+NLEVEL+")" ,386, 400-141);
  998.             g2d.drawString("" + sm + "h", 384, 422-141);
  999.             g2d.setColor(color1);
  1000.             g2d.fillRoundRect(453, 343, 60, 17, 5, 5);
  1001.             g2d.setColor(color2);
  1002.             g2d.setStroke(stroke1);
  1003.             g2d.drawRoundRect(453, 343, 60, 17, 5, 5);
  1004.             g2d.setFont(font3);
  1005.             g2d.drawString("Hide", 472, 356);
  1006.         }
  1007.         else{
  1008.             g2d.setColor(color1);
  1009.             g2d.fillRoundRect(453, 343, 60, 17, 5, 5);
  1010.             g2d.setColor(color2);
  1011.             g2d.setStroke(stroke1);
  1012.             g2d.drawRoundRect(453, 343, 60, 17, 5, 5);
  1013.             g2d.setFont(font3);
  1014.             g2d.drawString("Show", 470, 356);
  1015.         }
  1016.         Point p = new Point(Mouse.getX(),Mouse.getY());
  1017.         graphics.setColor(Color.BLACK);
  1018.        
  1019.         graphics.drawLine(0, p.y, 800, p.y);
  1020.         graphics.drawLine(p.x, 0, p.x, 800);
  1021.         graphics.setColor(Color.YELLOW);
  1022.         graphics.drawOval(p.x-5,p.y-5,10,10);
  1023.        
  1024.         graphics.setColor(color2);
  1025.                
  1026.                 }
  1027.        
  1028. }