Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import com.rsbuddy.event.events.MessageEvent;
- import com.rsbuddy.event.listeners.MessageListener;
- import com.rsbuddy.event.listeners.PaintListener;
- import com.rsbuddy.script.ActiveScript;
- import com.rsbuddy.script.Manifest;
- import com.rsbuddy.script.methods.Bank;
- import com.rsbuddy.script.methods.Camera;
- import com.rsbuddy.script.methods.Environment;
- import com.rsbuddy.script.methods.Inventory;
- import com.rsbuddy.script.methods.Mouse;
- import com.rsbuddy.script.util.Random;
- import com.rsbuddy.script.util.Timer;
- import com.rsbuddy.script.wrappers.Item;
- @Manifest(authors={"Remi"}, name="RCrusher", keywords={"Money, Making, chocolate, bar, remi"}, version=1, description="Start by any bank or chest.")
- public class RCrusher extends ActiveScript implements PaintListener, MessageListener {
- private int crushed; //how many inventories you've crushed, after each inv, should add +1
- private Timer t; //for paint/ is runtime
- private long startTime;
- private long seconds = 0, minutes = 0, hours = 0;
- long runTime = System.currentTimeMillis() - startTime;
- private static String status = "Unknown";
- final Font comicPlain10 = new Font("Comic Sans MS", Font.PLAIN, 10);
- final Color black = new Color(0, 0, 0);
- private void idle() { //antiban
- if (Random.nextInt(0, 500) == 0) {
- Mouse.setSpeed(10);
- int rand2 = Random.nextInt(1, 3);
- for (int i = 0; i < rand2; i++) {
- Mouse.move(Random.nextInt(100, 700), Random.nextInt(100, 500));
- sleep(Random.nextInt(200, 700));
- }
- Mouse.move(Random.nextInt(0, 800), 647, 50, 100);
- sleep(Random.nextInt(100, 1500));
- Mouse.move(Random.nextInt(75, 400), Random.nextInt(75, 400), 30);
- Mouse.setSpeed(Random.nextInt(3, 5));
- }
- if (Random.nextInt(0, 500) == 0) {
- Mouse.setSpeed(10);
- Point curPos = Mouse.getLocation();
- Mouse.move(Random.nextInt(0, 750), Random.nextInt(0, 500), 20);
- sleep(Random.nextInt(100, 300));
- Mouse.move(curPos, 20, 20);
- Mouse.setSpeed(Random.nextInt(3, 5));
- }
- if (Random.nextInt(0, 500) == 0) {
- int angle = Camera.getCompassAngle();
- int rand = Random.nextInt(0, 40);
- if (Random.nextInt(0, 2) == 0) {
- angle += rand;
- } else {
- angle -= rand;
- }
- if (angle < 0) {
- angle += 359;
- }
- if (angle > 359) {
- angle -= 359;
- }
- Camera.setCompassAngle(angle);
- }
- if (Random.nextInt(0, 500) == 0) {
- if (Random.nextInt(0, 4) == 0) {
- Camera.setPitch(Random.nextInt(50, 80));
- } else {
- Camera.setPitch(true);
- }
- }
- }
- @Override
- public int loop() {
- if (Inventory.isFull() && Inventory.contains(1973) && Inventory.contains(233)) { //if your inventory is full, has a chocolate bar and mortar, then it'll do //everything under it until the } part
- status = "Crushing"; //for the paint.
- Item item1 = Inventory.getItem(233); //this is like Mortar
- Item item2 = Inventory.getItem(1973); //and this is a chocolate bar
- Inventory.useItem(item1, item2); //uses mortar on chocolate bar
- sleep(500, 1000); //waits for the interface to pop-up
- Mouse.click(257, 423, true); //clicks 'Make-All'
- sleep(17000); //waits until the current inventory is done, 1000 = 1 second
- } else //ends the above method, then starts the next one
- if (Inventory.contains(1975) && !Inventory.contains(1973)) {
- bank();
- } else
- if (Bank.getCount(1975) == 0 && Inventory.getCount(1975) == 0) { //checks if the inventory and bank dont have any chocolate bars left
- log("No Chocolate Bars found, stopping script.");
- stop(); //stops script
- }
- return 500;
- }
- private void bank() { //obvious enough
- //insert banking function here
- }
- public void messageReceived(MessageEvent me) {
- String s = me.getMessage();
- if (s.contains("grind the")) {
- // what will the script do if it reads this from ingame?
- }
- }
- @Override
- public boolean onStart() {
- idle(); //antiban
- Mouse.setSpeed(1);
- t = new Timer(0); //for paint
- return true;
- }
- @Override
- public void onFinish() {
- Environment.saveScreenshot(true);
- }
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= (minutes * 60);
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= (hours * 60);
- // add your paint here ↓
- g.drawstring("crushed: " +crushed, 30, 30);
- }
- }
Add Comment
Please, Sign In to add comment