Decompiled osbot script

Thejuzo

Perustaja
Ylläpitäjä
Viestit
251
Pisteet
18
Decompiloitu ja korjattu virheet Intellij Idea ohjelman kanssa.


Main.java

Java:
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.image.ImageObserver;
import java.io.IOException;
import java.net.URL;
import java.util.Objects;
import javax.imageio.ImageIO;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(
        name = "Cowhide l00ter by juzo",
        author = "thejuzo",
        version = 1.0,
        info = "Loots cowhides",
        logo = ""
)
public class Main extends Script {

  private long a;
  private long b;
  private c c;
  private static String d;
  private static String e;
  public Area f = new Area(3253, 3255, 3265, 3299);
  private Area g = new Area(3240, 3272, 3265, 3299);
  private final Image h = a("https://i.imgur.com/YzcXUFI.png");
  private int i = 0;
  // $FF: synthetic field
  private static int[] j;

  public static void main(String[] args) { }
  public void onStart() {
    this.a = System.currentTimeMillis();
    this.getExperienceTracker().start(Skill.PRAYER);
  }

  public void onExit() {
    this.log("Thanks for thejuzo's l00ter lulz");
  }

  public int onLoop() throws InterruptedException {
    if(this.getDialogues().isPendingContinuation()) {
      d = "Clicking continue";
      sleep((long)random(600, 1500));
      this.getDialogues().clickContinue();
    }

    this.c = this.inventory.isFull()?c.a:(!this.inventory.isFull() && !this.f.contains(this.myPlayer()) && !this.g.contains(this.myPlayer())?c.b:c.c);
    switch(a()[this.c.ordinal()]) {
      case 1:
        d = "Banking";
        if(!Banks.LUMBRIDGE_UPPER.contains(this.myPlayer())) {
          this.getWalking().webWalk(new Area[]{Banks.LUMBRIDGE_UPPER});
          sleep((long)random(1000, 2000));
        } else if(!this.getBank().isOpen()) {
          this.getBank().open();
        } else {
          this.i = this.i = (int)((long)this.i + this.inventory.getAmount(new String[]{"Cowhide"}));
          this.getBank().depositAll();
        }
        break;
      case 2:
        d = "Walking to field";
        (new a(this, 2000)).sleep();
        break;
      case 3:
        d = "Looting";
        GroundItem var1;
        if((var1 = (GroundItem)this.getGroundItems().closest(new String[]{"Cowhide"})) != null && !this.myPlayer().isMoving() && (this.f.contains(var1.getPosition()) || this.g.contains(var1.getPosition()))) {
          (new b(this, 5000, var1)).sleep();
        }

        sleep((long)random(600, 1200));
    }

    return random(100, 300);
  }

  public void onPaint(Graphics2D var1) {
    this.b = System.currentTimeMillis() - this.a;
    var1.setFont(new Font("Open Sans", 1, 14));
    var1.setColor(new Color(240, 243, 239, 255));
    Point var2 = this.getMouse().getPosition();
    var1.drawImage(this.h, 7, 345, (ImageObserver)null);
    var1.drawString("v" + this.getVersion(), 10, 453);
    StringBuilder var10001 = new StringBuilder("[");
    if(!Objects.equals(e, d)) {
      e = d;
    }

    var1.drawString(var10001.append(e).append("]").toString(), 365, 368);
    var1.drawLine(var2.x, 0, var2.x, 500);
    var1.drawLine(0, var2.y, 800, var2.y);
    long var3 = this.b;
    long var5;
    long var7;
    long var9 = (var7 = (var5 = this.b / 1000L) / 60L) / 60L;
    var5 %= 60L;
    var7 %= 60L;
    var9 %= 24L;
    var1.drawString(String.format("%02d:%02d:%02d", new Object[]{Long.valueOf(var9), Long.valueOf(var7), Long.valueOf(var5)}), 214, 397);
    var1.drawString("" + this.i, 253, 418);
    var1.drawString("" + this.i*120, 214, 370);
  }

  private static Image a(String var0) {
    try {
      return ImageIO.read(new URL(var0));
    } catch (IOException var1) {
      return null;
    }
  }

  // $FF: synthetic method
  static Area a(Main var0) {
    return var0.f;
  }

  // $FF: synthetic method
  private int[] a() {
    if(j != null) {
      return j;
    } else {
      int[] var0 = new int[c.a().length];

      try {
        var0[c.a.ordinal()] = 1;
      } catch (NoSuchFieldError var3) {
        ;
      }

      try {
        var0[c.c.ordinal()] = 3;
      } catch (NoSuchFieldError var2) {
        ;
      }

      try {
        var0[c.b.ordinal()] = 2;
      } catch (NoSuchFieldError var1) {
        ;
      }

      j = var0;
      return var0;
    }
  }
}
b.java

Java:
import org.osbot.rs07.api.Equipment;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.utility.ConditionalSleep;

final class b extends ConditionalSleep {
  private GroundItem a;

  b(Main var1, int var2, GroundItem var3) {
    super(5000);
    this.a = var3;
  }

  public final boolean condition() {
    return this.a.interact(new String[]{"Take"});
  }
}

c.java

Java:
enum c {

  a("BANK", 0),
  b("WALK", 1),
  c("LOOT", 2);
  // $FF: synthetic field
  private static final c[] d = new c[]{a, b, c};


  private c(String var1, int var2) {}

  public static c[] a() {
    c[] var0;
    System.arraycopy(d, 0, var0 = new c[3], 0, 3);
    return var0;
  }
}
 
Viimeksi muokattu:
Your email address will not be publicly visible. We will only use it to contact you to confirm your post. Sähköposti osoitetta ei näytetä julkisesti.
Ylös