Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSWeb;
- import org.rsbot.event.listeners.*;
- import java.awt.*;
- @ScriptManifest(name = "Lordluke24barblootter", version = 1.00, description = "Loots fish",
- authors = "Lordluke24")
- public class Lordluke24barbblootter extends Script implements PaintListener {
- private int[] fishes = { 331 };
- private int FISHES_LOOTED;
- private long startTime = System.currentTimeMillis();
- RSArea atBank = new RSArea(new RSTile(3088,3484), new RSTile(3102,3502));
- RSArea atSpot = new RSArea(new RSTile(3100,3419), new RSTile(3113,3439));
- RSTile bankTile = new RSTile(3094,3494);
- RSTile spotTile = new RSTile(3105,3433);
- RSWeb bankPath;
- RSWeb spotPath;
- public boolean onStart() {
- return true;
- }
- private void walkBank() {
- bankPath = web.getWeb(getMyPlayer().getLocation(), bankTile);
- bankPath.step();
- }
- private void walkSpot() {
- spotPath = web.getWeb(getMyPlayer().getLocation(), spotTile);
- spotPath.step();
- }
- private void loot() {
- RSGroundItem fish = groundItems.getNearest(fishes);
- if(getMyPlayer().getAnimation() == -1) {
- if(fish != null) {
- if(fish.isOnScreen()) {
- fish.doAction("Take");
- sleep(50);
- } else {
- walking.walkTileMM(fish.getLocation());
- }
- } else {
- sleep(50);
- }
- }
- }
- private void bank() {
- if(bank.isOpen()) {
- if(inventory.containsOneOf(fishes)) {
- bank.depositAll();
- FISHES_LOOTED = FISHES_LOOTED +28;
- }
- sleep(2000);
- if(!inventory.containsOneOf(fishes)) {
- bank.close();
- }
- } else {
- bank.open();
- }
- }
- private void antiban() {
- switch(random(1,5)) {
- case 1:
- mouse.move(random(100, 700), random(100, 500));
- break;
- case 2:
- camera.setPitch(true);
- int angle = camera.getAngle() + random(-100, 100);
- if(angle < 0) {
- angle += 359;
- }
- if(angle > 359) {
- angle -= 359;
- }
- camera.setAngle(angle);
- break;
- case 5:
- int angle2 = camera.getAngle() + random(-40, 40);
- if(angle2 < 0) {
- angle2 += 359;
- }
- if(angle2 > 359) {
- angle2 -= 359;
- }
- camera.setAngle(angle2);
- break;
- }
- }
- @Override
- public int loop() {
- if(random(1,5) == 3) {
- antiban();
- }
- if(!walking.isRunEnabled() && walking.getEnergy() > 20) {
- walking.setRun(true);
- }
- if(!inventory.isFull()) {
- if(!atSpot.contains(getMyPlayer().getLocation())) {
- walkSpot();
- } else {
- loot();
- }
- } else {
- if(!atBank.contains(getMyPlayer().getLocation())) {
- walkBank();
- } else {
- bank();
- }
- }
- return(random(500,1000));
- }
- private final Color color1 = new Color(51, 102, 255, 154);
- private final Color color2 = new Color(102, 0, 102);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Tahoma", 1, 12);
- private final Font font2 = new Font("Tahoma", 0, 12);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color2);
- g.setStroke(stroke1);
- g.setFont(font2);
- g.drawString("Fishe Picked: " + FISHES_LOOTED, 341, 361);
- g.drawString("Run Time: " + getRuntime(), 380, 377);
- }
- private String getRuntime() {
- try {
- 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;
- return ("" + (hours < 10 ? "0" : "") + hours + ":"
- + (minutes < 10 ? "0" : "") + minutes + ":"
- + (seconds < 10 ? "0" : "") + seconds + "");
- } catch (Exception e) {
- return "";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement