Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.awt.*;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Bank;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.methods.Calculations;
- import org.rsbot.script.methods.GroundItems;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.methods.Mouse;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = { "InfinityBOTS" }, keywords = { "shields,lumbridge" }, name = "infinitySHIELDS", version = 1.1, description = "Flawless! Start at bank with money.")
- public class infinitySHIELDS extends Script implements PaintListener {
- public RSTile[] toNPC2 = { new RSTile(3208, 3320), new RSTile(3206, 3224), new RSTile(3206, 3229) };
- public RSTile[] toBank2 = { new RSTile(3208, 3323) };
- public RSTile[] toBank1 = { new RSTile(3206, 3224), new RSTile(3206, 3228) };
- public RSTile[] toNPC1 = { new RSTile(3207, 3222) };
- public RSTile[] goNPC = { new RSTile(3210, 3222) };
- public RSTile[] toDoor = { new RSTile(3206, 3222) };
- public RSArea NPCarea = new RSArea(new RSTile(3209, 3219), new RSTile(3212, 3225));
- public RSArea STAIRarea = new RSArea(new RSTile(3205, 3224), new RSTile(3207, 3228));
- public RSArea DoorArea = new RSArea(new RSTile(3206, 3220), new RSTile(3209, 3224));
- public long startTime = System.currentTimeMillis();
- public int price = grandExchange.lookup(1540).getMarketPrice();
- private final Color color1 = new Color(0, 102, 204, 101);
- private final Color color2 = new Color(51, 51, 51);
- private final Color color3 = new Color(0, 102, 102);
- private final Color color4 = new Color(0, 204, 204, 132);
- private final Color color5 = new Color(0, 204, 204);
- private final Color color6 = new Color(255, 102, 102);
- private final BasicStroke stroke1 = new BasicStroke(10);
- private final Font font1 = new Font("Arial Black", 0, 17);
- private final Font font2 = new Font("Arial Black", 0, 9);
- int elevation = 0;
- int count = 0;
- int npc1 = 741;
- int none = 0;
- int bankboothID = 36786;
- int SHIELDNOTE = 1541;
- int SHIELD = 1540;
- int down = 36778;
- int up = 36777;
- int doorOpen = 36845;
- int doorClose = 36844;
- int banked = 0;
- public boolean onStart(){
- log("InfinityBOTS present infinitySHIELDS v1.1");
- startTime = System.currentTimeMillis();
- //UpdateLog!
- log("Update v1.1 Fixed door error.");
- log("NEXT UPDATE: Antiban and improved banking!");
- return true;
- }
- public void onRepaint(Graphics g1) {
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long minutes2 = minutes + (hours * 60);
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRect(281, 175, 232, 158);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(281, 175, 232, 158);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("infinitySHIELDS", 292, 196);
- g.setColor(color4);
- g.fillOval(546, 5, 165, 163);
- g.setColor(color2);
- g.drawOval(546, 5, 165, 163);
- g.setColor(color3);
- g.fillRect(301, 6, 212, 74);
- g.setColor(color2);
- g.drawRect(301, 6, 212, 74);
- g.setColor(color5);
- g.drawString("Time Running:: " + hours + ":" + minutes + ":" + seconds ++ , 310, 26);
- g.drawString("Profit: " +banked*price, 290, 256);
- g.setColor(color6);
- g.drawString("infinitySHIELDS", 556, 77);
- g.setFont(font2);
- g.drawString("By: InfinityBOTS(bowlofosup)", 553, 91);
- }
- public int loop(){
- try {
- if ( walking.getEnergy() > random(60,70)) {
- walking.setRun(true);
- }
- elevation = game.getPlane();
- if(inventory.isFull()){
- } else {
- if( elevation == 1) {
- if(count == 4) {
- RSGroundItem shield1 = groundItems.getNearest(SHIELDNOTE);
- if (shield1 != null) {
- shield1.doAction("Take");
- }
- if(inventory.getCount() > 0) {
- count = 5;
- }
- return 1500;
- }
- if(count == 8) {
- RSGroundItem shield1 = groundItems.getNearest(SHIELDNOTE);
- RSGroundItem shield2 = groundItems.getNearest(SHIELD);
- if (shield1 != null) {
- shield1.doAction("Take");
- } else if (shield2 != null) {
- shield2.doAction("Take");
- }
- if(shield1 == null && shield2 == null) {
- RSObject checkDoor1 = objects.getNearest(doorOpen);
- RSObject checkDoor2 = objects.getNearest(doorClose);
- RSObject theStairs = objects.getNearest(up);
- if (checkDoor1 != null) {
- if ( DoorArea.contains(checkDoor1.getLocation())) {
- if(calc.distanceTo(theStairs) < 3) {
- try {
- camera.turnToObject(theStairs);
- } catch (NullPointerException e) {
- }
- theStairs.doAction("Climb-up");
- } else {
- walking.walkPathMM(toBank1, 0 ,0);
- }
- }
- }
- if ( NPCarea.contains(getMyPlayer().getLocation())) {
- if (checkDoor2 != null) {
- if ( DoorArea.contains(checkDoor2.getLocation())) {
- try {
- camera.turnToObject(checkDoor2);
- } catch (NullPointerException e) {
- }
- checkDoor2.doAction("Open");
- }
- }
- } else {
- if(calc.distanceTo(theStairs) < 3) {
- try {
- camera.turnToObject(theStairs);
- } catch (NullPointerException e) {
- }
- theStairs.doAction("Climb-up");
- } else {
- walking.walkPathMM(toBank1, 0 ,0);
- }
- }
- }
- }
- if ( NPCarea.contains(getMyPlayer().getLocation())) {
- if(count == 8) {
- } else {
- 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()) {
- inventory.dropAllExcept(none);
- RSNPC npc1Haz = npcs.getNearest(npc1);
- if (npc1Haz != null && npc1Haz.isOnScreen()) {
- npc1Haz.doAction("Talk-to");
- } else {
- camera.turnToCharacter(npc1Haz);
- }
- }
- if (interfaces.getComponent(242, 6).isValid()){
- interfaces.getComponent(242, 6).doAction("Continue");
- }
- if (interfaces.getComponent(519, 2).isValid()){
- interfaces.getComponent(519, 2).doAction("Continue");
- count = count + 1;
- banked++;
- sleep(300);
- inventory.dropAllExcept(none);
- }
- if (interfaces.getComponent(64, 5).isValid()){
- interfaces.getComponent(64, 5).doAction("Continue");
- }
- if (interfaces.getComponent(65, 6).isValid()){
- interfaces.getComponent(65, 6).doAction("Continue");
- }
- if (interfaces.getComponent(230, 2).isValid()){
- interfaces.getComponent(230, 2).doAction("Continue");
- }
- if (interfaces.getComponent(241, 5).isValid()){
- interfaces.getComponent(241, 5).doAction("Continue");
- }
- }
- } else {
- if(count == 8) {
- } else {
- RSObject checkDoor1 = objects.getNearest(doorOpen);
- RSObject checkDoor2 = objects.getNearest(doorClose);
- if (checkDoor1 != null) {
- if ( DoorArea.contains(checkDoor1.getLocation())) {
- walking.walkPathMM(goNPC, 0 ,0);
- }
- }
- if (checkDoor2 != null) {
- if ( DoorArea.contains(checkDoor2.getLocation())) {
- try {
- camera.turnToObject(checkDoor2);
- } catch (NullPointerException e) {
- }
- if(calc.distanceTo(checkDoor2) < 3) {
- checkDoor2.doAction("Open");
- } else {
- walking.walkPathMM(toDoor, 0 ,0);
- }
- }
- }
- }
- }
- }
- if ( elevation == 2) {
- if (inventory.getCount() > 2) {
- RSObject theBank = objects.getNearest(bankboothID);
- if(calc.distanceTo(theBank) < 3) {
- if (!bank.isOpen()) {
- try {
- camera.turnToObject(theBank);
- } catch (NullPointerException e) {
- }
- theBank.doAction("Use-quickly");
- }
- if (bank.isOpen()) {
- bank.depositAllExcept(none);
- bank.setWithdrawModeToNote();
- bank.withdraw(1540, 1000000);
- bank.close();
- count = 0;
- }
- } else {
- RSTile goTheBank = new RSTile(theBank.getLocation().getX(), theBank.getLocation().getY());
- walking.walkTo(goTheBank);
- }
- } else {
- RSObject goDown = objects.getNearest(down);
- if(goDown != null) {
- if(calc.distanceTo(goDown) < 3) {
- goDown.doAction("Climb-down");
- } else {
- walking.walkPathMM(toNPC2, 0 ,0);
- }
- }
- }
- }
- }
- } catch (NullPointerException e) {
- }
- return random(1400, 1500);
- }
- public void onFinish(){
- log("Thanks for using infinitySHIELDS!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement