Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2. import java.awt.*;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.Script;
  5. import org.rsbot.script.methods.Game;
  6. import org.rsbot.script.methods.Bank;
  7. import org.rsbot.script.wrappers.RSObject;
  8. import org.rsbot.script.wrappers.RSTile;
  9. import org.rsbot.script.wrappers.RSArea;
  10. import org.rsbot.script.wrappers.RSNPC;
  11. import org.rsbot.script.methods.Calculations;
  12. import org.rsbot.script.methods.GroundItems;
  13. import org.rsbot.script.wrappers.RSGroundItem;
  14. import org.rsbot.script.wrappers.RSComponent;
  15. import org.rsbot.script.methods.Mouse;
  16. import org.rsbot.event.listeners.PaintListener;
  17.  
  18.  
  19. @ScriptManifest(authors = { "InfinityBOTS" }, keywords = { "shields,lumbridge" }, name = "infinitySHIELDS", version = 1.1, description = "Flawless! Start at bank with money.")
  20. public class infinitySHIELDS extends Script implements PaintListener {
  21. public RSTile[] toNPC2 = { new RSTile(3208, 3320), new RSTile(3206, 3224), new RSTile(3206, 3229) };
  22. public RSTile[] toBank2 = { new RSTile(3208, 3323) };
  23. public RSTile[] toBank1 = { new RSTile(3206, 3224), new RSTile(3206, 3228) };
  24. public RSTile[] toNPC1 = { new RSTile(3207, 3222) };
  25. public RSTile[] goNPC = { new RSTile(3210, 3222) };
  26. public RSTile[] toDoor = { new RSTile(3206, 3222) };
  27. public RSArea NPCarea = new RSArea(new RSTile(3209, 3219), new RSTile(3212, 3225));
  28. public RSArea STAIRarea = new RSArea(new RSTile(3205, 3224), new RSTile(3207, 3228));
  29. public RSArea DoorArea = new RSArea(new RSTile(3206, 3220), new RSTile(3209, 3224));
  30. public long startTime = System.currentTimeMillis();
  31. public int price = grandExchange.lookup(1540).getMarketPrice();
  32. private final Color color1 = new Color(0, 102, 204, 101);
  33. private final Color color2 = new Color(51, 51, 51);
  34. private final Color color3 = new Color(0, 102, 102);
  35. private final Color color4 = new Color(0, 204, 204, 132);
  36. private final Color color5 = new Color(0, 204, 204);
  37. private final Color color6 = new Color(255, 102, 102);
  38.  
  39. private final BasicStroke stroke1 = new BasicStroke(10);
  40.  
  41. private final Font font1 = new Font("Arial Black", 0, 17);
  42. private final Font font2 = new Font("Arial Black", 0, 9);
  43.  
  44. int elevation = 0;
  45. int count = 0;
  46. int npc1 = 741;
  47. int none = 0;
  48. int bankboothID = 36786;
  49. int SHIELDNOTE = 1541;
  50. int SHIELD = 1540;
  51. int down = 36778;
  52. int up = 36777;
  53. int doorOpen = 36845;
  54. int doorClose = 36844;
  55. int banked = 0;
  56.  
  57.     public boolean onStart(){
  58.     log("InfinityBOTS present infinitySHIELDS v1.1");
  59.     startTime = System.currentTimeMillis();
  60.     //UpdateLog!
  61.     log("Update v1.1 Fixed door error.");
  62.     log("NEXT UPDATE: Antiban and improved banking!");
  63.     return true;
  64.     }
  65.     public void onRepaint(Graphics g1) {
  66.         long millis = System.currentTimeMillis() - startTime;
  67.         long hours = millis / (1000 * 60 * 60);
  68.         millis -= hours * (1000 * 60 * 60);
  69.         long minutes = millis / (1000 * 60);
  70.         millis -= minutes * (1000 * 60);
  71.         long seconds = millis / 1000;
  72.         long minutes2 = minutes + (hours * 60);
  73.         Graphics2D g = (Graphics2D)g1;
  74.         g.setColor(color1);
  75.         g.fillRect(281, 175, 232, 158);
  76.         g.setColor(color2);
  77.         g.setStroke(stroke1);
  78.         g.drawRect(281, 175, 232, 158);
  79.         g.setFont(font1);
  80.         g.setColor(color3);
  81.         g.drawString("infinitySHIELDS", 292, 196);
  82.         g.setColor(color4);
  83.         g.fillOval(546, 5, 165, 163);
  84.         g.setColor(color2);
  85.         g.drawOval(546, 5, 165, 163);
  86.         g.setColor(color3);
  87.         g.fillRect(301, 6, 212, 74);
  88.         g.setColor(color2);
  89.         g.drawRect(301, 6, 212, 74);
  90.         g.setColor(color5);
  91.         g.drawString("Time Running:: " + hours + ":" + minutes + ":" + seconds ++ , 310, 26);
  92.         g.drawString("Profit: " +banked*price, 290, 256);
  93.         g.setColor(color6);
  94.         g.drawString("infinitySHIELDS", 556, 77);
  95.         g.setFont(font2);
  96.         g.drawString("By: InfinityBOTS(bowlofosup)", 553, 91);
  97.     }
  98.  
  99.     public int loop(){
  100.             try {
  101.                 if ( walking.getEnergy() > random(60,70)) {
  102.                     walking.setRun(true);
  103.                 }
  104.                 elevation = game.getPlane();
  105.                     if(inventory.isFull()){
  106.        
  107.                     } else {
  108.                         if( elevation == 1) {
  109.                             if(count == 4) {
  110.                                 RSGroundItem shield1 = groundItems.getNearest(SHIELDNOTE);
  111.                                 if (shield1 != null) {
  112.                                     shield1.doAction("Take");
  113.                                 }
  114.                                 if(inventory.getCount() > 0) {
  115.                                     count = 5;
  116.                                 }
  117.                                 return 1500;
  118.                             }
  119.                             if(count == 8) {
  120.  
  121.                                 RSGroundItem shield1 = groundItems.getNearest(SHIELDNOTE);
  122.                                     RSGroundItem shield2 = groundItems.getNearest(SHIELD);
  123.             if (shield1 != null) {
  124.          shield1.doAction("Take");
  125.             } else if (shield2 != null) {
  126.          shield2.doAction("Take");
  127.          }
  128.             if(shield1 == null && shield2 == null) {
  129.  
  130.                 RSObject checkDoor1 = objects.getNearest(doorOpen);
  131.                 RSObject checkDoor2 = objects.getNearest(doorClose);
  132.                 RSObject theStairs = objects.getNearest(up);
  133.          
  134.                     if (checkDoor1 != null) {
  135.                         if ( DoorArea.contains(checkDoor1.getLocation())) {
  136.  
  137.                             if(calc.distanceTo(theStairs) < 3) {
  138.          
  139.                                 try {
  140.                                     camera.turnToObject(theStairs);
  141.                                 } catch (NullPointerException e) {
  142.                                 }
  143.                                     theStairs.doAction("Climb-up");
  144.                             } else {
  145.                                 walking.walkPathMM(toBank1, 0 ,0);
  146.                             }
  147.             }
  148.          }
  149.                     if ( NPCarea.contains(getMyPlayer().getLocation())) {
  150.                         if (checkDoor2 != null) {
  151.                             if ( DoorArea.contains(checkDoor2.getLocation())) {
  152.                                 try {
  153.                                     camera.turnToObject(checkDoor2);
  154.             } catch (NullPointerException e) {
  155.                 }
  156.             checkDoor2.doAction("Open");
  157.  
  158.                             }
  159.                         }
  160.                     } else {
  161.                         if(calc.distanceTo(theStairs) < 3) {
  162.          
  163.                             try {
  164.                                 camera.turnToObject(theStairs);
  165.                             } catch (NullPointerException e) {
  166.                                 }
  167.                             theStairs.doAction("Climb-up");
  168.                         } else {
  169.                             walking.walkPathMM(toBank1, 0 ,0);
  170.                         }
  171.                     }
  172.  
  173.             }
  174.          }
  175.                             if ( NPCarea.contains(getMyPlayer().getLocation())) {
  176.  
  177.                                 if(count == 8) {
  178.                                 } else {
  179.                                     if (!interfaces.getComponent(242, 6).isValid() && !interfaces.getComponent(519, 2).isValid() && !interfaces.getComponent(64, 5).isValid() && !interfaces.getComponent(65, 6).isValid() && !interfaces.getComponent(230, 2).isValid() && !interfaces.getComponent(241, 5).isValid()) {
  180.  
  181.                                         inventory.dropAllExcept(none);
  182.              RSNPC npc1Haz = npcs.getNearest(npc1);
  183.              if (npc1Haz != null && npc1Haz.isOnScreen()) {            
  184.                  npc1Haz.doAction("Talk-to");
  185.              } else {
  186.                  camera.turnToCharacter(npc1Haz);
  187.              }
  188.                                     }
  189.                                     if (interfaces.getComponent(242, 6).isValid()){
  190.                                         interfaces.getComponent(242, 6).doAction("Continue");      
  191.                                     }
  192.                                     if (interfaces.getComponent(519, 2).isValid()){
  193.                                             interfaces.getComponent(519, 2).doAction("Continue");
  194.                                                 count = count + 1;
  195.                                                 banked++;
  196.                                         sleep(300);
  197.                                     inventory.dropAllExcept(none);       
  198.          }
  199.                                     if (interfaces.getComponent(64, 5).isValid()){
  200.                                         interfaces.getComponent(64, 5).doAction("Continue");       
  201.          }
  202.                                     if (interfaces.getComponent(65, 6).isValid()){
  203.                                         interfaces.getComponent(65, 6).doAction("Continue");       
  204.          }
  205.                                     if (interfaces.getComponent(230, 2).isValid()){
  206.                                         interfaces.getComponent(230, 2).doAction("Continue");      
  207.                                     }
  208.                                     if (interfaces.getComponent(241, 5).isValid()){
  209.                                         interfaces.getComponent(241, 5).doAction("Continue");      
  210.                                     }
  211.                                 }
  212.                             } else {
  213.                                 if(count == 8) {
  214.                                 } else {
  215.                                     RSObject checkDoor1 = objects.getNearest(doorOpen);
  216.                                     RSObject checkDoor2 = objects.getNearest(doorClose);
  217.                                     if (checkDoor1 != null) {
  218.                                         if ( DoorArea.contains(checkDoor1.getLocation())) {
  219.  
  220.                                             walking.walkPathMM(goNPC, 0 ,0);
  221.                                         }
  222.                                     }
  223.                                     if (checkDoor2 != null) {
  224.                                         if ( DoorArea.contains(checkDoor2.getLocation())) {
  225.                                             try {
  226.                                                 camera.turnToObject(checkDoor2);
  227.                                             } catch (NullPointerException e) {
  228.                                             }
  229.                                             if(calc.distanceTo(checkDoor2) < 3) {
  230.  
  231.                                                 checkDoor2.doAction("Open");
  232.                                             } else {
  233.                                                 walking.walkPathMM(toDoor, 0 ,0);
  234.                                             }
  235.          
  236.              }
  237.                                     }
  238.                                 }
  239.                             }
  240.                         }
  241.                         if ( elevation == 2) {
  242.                             if (inventory.getCount() > 2) {
  243.          
  244.                                 RSObject theBank = objects.getNearest(bankboothID);
  245.                                 if(calc.distanceTo(theBank) < 3) {
  246.          
  247.                                     if (!bank.isOpen()) {
  248.                                         try {
  249.                                             camera.turnToObject(theBank);
  250.                                         } catch (NullPointerException e) {
  251.                                         }
  252.                                         theBank.doAction("Use-quickly");
  253.                                     }
  254.                                     if (bank.isOpen()) {
  255.                                         bank.depositAllExcept(none);
  256.                                         bank.setWithdrawModeToNote();
  257.                                             bank.withdraw(1540, 1000000);
  258.                                             bank.close();
  259.                                             count = 0;
  260.                                     }
  261.              } else {
  262.          
  263.                  RSTile goTheBank = new RSTile(theBank.getLocation().getX(), theBank.getLocation().getY());
  264.                     walking.walkTo(goTheBank);
  265.             }
  266.                             } else {
  267.                                 RSObject goDown = objects.getNearest(down);
  268.                                 if(goDown != null) {
  269.                                     if(calc.distanceTo(goDown) < 3) {
  270.                                         goDown.doAction("Climb-down");
  271.  
  272.                                     } else {
  273.                                         walking.walkPathMM(toNPC2, 0 ,0);
  274.                                     }
  275.                                 }
  276.                             }
  277.                         }
  278.                     }
  279.             } catch (NullPointerException e) {
  280.        
  281.                 }
  282.                 return random(1400, 1500);
  283.         }
  284.    
  285.  
  286.         public void onFinish(){
  287.             log("Thanks for using infinitySHIELDS!");
  288.        
  289.     }
  290. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement