Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.*;
- import java.awt.*;
- import java.awt.event.*;
- import org.rsbot.script.internal.event.PaintListener;
- import org.rsbot.script.methods.Calculations;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.GroundItems;
- import org.rsbot.script.methods.Mouse;
- import org.rsbot.script.methods.Players;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.methods.Walking;
- import org.rsbot.script.methods.tabs.Inventory;
- import org.rsbot.script.methods.ui.Interfaces;
- import org.rsbot.script.wrappers.Tile;
- @ScriptManifest(authors = "NEXBot (Muhatashim)", name = "NEXBury", version = .8, description = "Finds bones, buries them")
- public class NEXBury extends Script implements PaintListener, MouseListener {
- long Time = System.currentTimeMillis();
- boolean lookForEmote = false;
- boolean showPaint = true;
- boolean isPressed = false;
- int bonesBuried = 0;
- Tile LastLocation = null;
- int EXPGained = 0;
- int startEXP = 0;
- int currentEXP = 0;
- int LVLGained = 0;
- int startLVL = 0;
- int currentLVL = 0;
- long startTime = 0;
- long currentTime = 0;
- long timeout2Start = 0;
- long timeout2Curr = 0;
- double divide = 0;
- double expPrHr = 0;
- public boolean onStart() {
- startEXP = Skills.getExperience(5);
- startLVL = Skills.getLevel(5);
- startTime = System.currentTimeMillis();
- return true;
- }
- @Override
- public int loop() {
- if (Walking.getEnergy() >= random(40, 60)) {
- Walking.setRun(true);
- }
- if ((Players.getLocal().isMoving() && GroundItems.getNearest("Bones").isOnScreen() && LastLocation != GroundItems.getNearest("Bones").getLocation()) || Calculations.distanceTo(LastLocation) <= 2) {
- Mouse.setPrecisionSpeed(random(3, 10));
- int x = GroundItems.getNearest("Bones").getPoint().x + random(-10, 10);
- int y = GroundItems.getNearest("Bones").getPoint().y + random(-10, 10);
- Mouse.move(x, y);
- LastLocation = GroundItems.getNearest("Bones").getLocation();
- GroundItems.getNearest("Bones").interact("Bones");
- sleep(600);
- }
- try {
- if (!Players.getLocal().isMoving() && LastLocation != GroundItems.getNearest("Bones").getLocation()) {
- if (GroundItems.getNearest("Bones") != null) {
- Mouse.setPrecisionSpeed(random(3, 8));
- if (GroundItems.getNearest("Bones").isOnScreen()) {
- LastLocation = GroundItems.getNearest("Bones").getLocation();
- GroundItems.getNearest("Bones").interact("Bones");
- sleep(600);
- }
- try {
- if (!GroundItems.getNearest("Bones").isOnScreen()) {
- Walking.walkTileMM(GroundItems.getNearest("Bones").getLocation());
- }
- } catch (Exception ignored) {
- }
- }
- }
- } catch (Exception ignored) {
- }
- if (GroundItems.getNearest("ones") == null || (Inventory.isFull()) || (Inventory.getCount() >= random(10, 100) && (Calculations.distanceTo(GroundItems.getNearest("Bones").getLocation()) >= 4)) || expPrHr <= 2000 && Inventory.contains(Inventory.getItemID("one"))) {
- int x = 0;
- if (lookForEmote == true) {
- if (Players.getLocal().getAnimation() == 827) {
- bonesBuried++;
- log(bonesBuried);
- lookForEmote = false;
- }
- }
- while (x != 28) {
- Mouse.setPrecisionSpeed(random(5, 10));
- if (Inventory.contains(Inventory.getItemID("one"))) {
- if (x != 28) {
- if (Inventory.getCount() <= random(1, 6)) {
- break;
- }
- try {
- if (Inventory.getItemAt(x).getName().contains("ones")) {
- Inventory.getItemAt(x).interact("ury");
- sleep(random(200, 300));
- x++;
- } else {
- if (Inventory.getItemAt(x).getName() != null && Inventory.getItemAt(x).hasAction("drop")) {
- Inventory.getItemAt(x).interact("drop");
- }
- x++;
- }
- } catch (Exception ignored) {
- }
- }
- }
- }
- }
- return (random(
- 10, 50));
- }
- private final Color color1 = new Color(255, 255, 255);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(230, 227, 179);
- private final Color color4 = new Color(224, 8, 0);
- private final Color color5 = new Color(51, 51, 255);
- private final Color color6 = new Color(1, 1, 1);
- private final Color color7 = new Color(102, 102, 255);
- private final Color color8 = new Color(0, 0, 0);
- private final Color color9 = new Color(153, 255, 255);
- private final Color color10 = new Color(255, 51, 51);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 15);
- public void onRepaint(Graphics g1) {
- if (Game.isLoggedIn()) {
- long Mill = System.currentTimeMillis() - Time;
- long Hrs = Mill / (1000 * 60 * 60);
- Mill -= Hrs * (1000 * 60 * 60);
- long Min = Mill / (1000 * 60);
- Mill -= Min * (1000 * 60);
- long Sec = Mill / 1000;
- Graphics2D g = (Graphics2D) g1;
- if (showPaint) {
- g.setColor(color1);
- g.fillRect(10, 458, 139, 15);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(10, 458, 139, 15);
- g.setColor(color3);
- g.fillRect(9, 346, 489, 108);
- g.setColor(color2);
- g.drawLine(500, 458, 515, 471);
- g.setColor(color4);
- g.fillRect(152, 459, 346, 14);
- g.setColor(color2);
- g.drawRect(152, 459, 346, 14);
- g.setFont(font1);
- g.drawString("NEXBot's NEXBury", 305, 443);
- g.drawString("Current action:", 306, 410);
- g.setColor(color6);
- g.drawString("Run time:", 14, 364);
- g.drawString(Hrs + ":" + Min + ":" + Sec, 83, 365);
- }
- //
- currentEXP = Skills.getExperience(5);
- EXPGained = currentEXP - startEXP;
- currentLVL = Skills.getLevel(5);
- LVLGained = currentLVL - startLVL;
- LVLGained = currentLVL - startLVL;
- try {
- currentTime = System.currentTimeMillis();
- divide = currentTime - startTime;
- divide = divide / 1000 / 60 / 60;
- expPrHr = EXPGained / divide;
- } catch (NullPointerException e) {
- }
- g.setColor(color5);
- //
- g.setColor(color7);
- g.fillRoundRect(289, 250, 228, 87, 16, 16);
- g.setColor(color8);
- g.setStroke(stroke1);
- g.drawRoundRect(289, 250, 228, 87, 16, 16);
- g.setFont(font1);
- g.setColor(color9);
- g.drawString("EXP Gained: " + EXPGained, 295, 268);
- g.drawString("LVLS Gained: " + LVLGained, 295, 287);
- g.drawString("Current Level : " + currentLVL, 295, 303);
- g.drawString("Current EXP: " + currentEXP, 295, 320);
- g.drawString("EXP Per HR: " + expPrHr, 295, 337);
- //Mouse
- g.drawOval(Mouse.getLocation().x - 11, Mouse.getLocation().y - 11, 22, 22);
- g.drawOval(Mouse.getLocation().x - 3, Mouse.getLocation().y - 3, 6, 6);
- //Mouse click
- if (Mouse.isPressed() || isPressed) {
- isPressed = true;
- if (timeout2Start != 0) {
- timeout2Curr = System.currentTimeMillis();
- if (timeout2Curr - timeout2Start >= 5000) {
- timeout2Start = 0;
- timeout2Curr = 0;
- isPressed = false;
- }
- }
- if (timeout2Start == 0) {
- timeout2Start = System.currentTimeMillis();
- }
- g.setColor(color10);
- g.drawOval(Mouse.getPressLocation().x - 11, Mouse.getPressLocation().y - 11, 22, 22);
- }
- if (showPaint) {
- g.setColor(color4);
- }
- }
- }
- public void mouseClicked(MouseEvent e) {
- if (Interfaces.getComponent(137, 0).contains(e.getPoint())) {
- showPaint = !showPaint;
- }
- }
- public void mousePressed(MouseEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- public void mouseReleased(MouseEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- public void mouseEntered(MouseEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- public void mouseExited(MouseEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
Add Comment
Please, Sign In to add comment