Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.*;
- import java.awt.*;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class simplebot {
- public static int constx = 1180; //CHANGE// - X coordinate of your top left berry
- public static int consty = 653; //CHANGE// - Y coordinate of your top left berry
- public static void main(String[] args) throws AWTException {
- int runTimes = 1;
- Robot r = new Robot();
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- System.out
- .println("Times to run (always goes once, so enter 0 for one run)");
- try {
- runTimes = Integer.parseInt(br.readLine());
- } catch (IOException e) {
- e.printStackTrace();
- }
- System.out.println("Type 1 when ready to run " + runTimes + " times");
- String runBot = null;
- try {
- runBot = br.readLine();
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (Integer.parseInt(runBot) == 1) {
- doWork(runTimes, r);
- } else
- System.out.println("NOPE" + runBot);
- }
- public static void doWork(int runTimes, Robot r) {
- r.delay(2000);
- for (int i = 0; i <= runTimes; i++) {
- for (int y = 0; y < 2; y++) { //change the 2 to how many rows of berries you have
- for (int x = 0; x < 9; x++) { //change the 9 to how many collums in your bags
- r.mouseMove(constx + x * 38, consty + y * 38); //38 pixels is the distance between each item in my bags
- r.delay(70);
- r.mousePress(InputEvent.BUTTON3_MASK);
- r.delay(20);
- r.mouseRelease(InputEvent.BUTTON3_MASK);
- r.delay(20);
- }
- }
- }
- //uncomment if you want it to split your stacks of berries
- /*for (int i = 0; i <= runTimes; i++) {
- for (int y = 0; y < 7; y++) { //change the 7 to how many rows of berries you have
- for (int x = 0; x < 9; x++) { //change the 9 to how many collums in your bags
- r.mouseMove(constx, consty);
- r.delay(5);
- r.keyPress(KeyEvent.VK_SHIFT);
- r.delay(5);
- r.mousePress(InputEvent.BUTTON1_MASK);
- r.delay(20);
- r.mouseRelease(InputEvent.BUTTON1_MASK);
- r.delay(5);
- r.keyRelease(KeyEvent.VK_SHIFT);
- r.delay(5);
- r.keyPress(KeyEvent.VK_H);
- r.delay(5);
- r.mouseMove(constx + (x) * 38, consty + y * 38);
- r.delay(20);
- r.keyRelease(KeyEvent.VK_H);
- r.delay(700);
- r.mousePress(InputEvent.BUTTON1_MASK);
- r.delay(20);
- r.mouseRelease(InputEvent.BUTTON1_MASK);
- r.delay(800);
- }
- }
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment