Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.AWTException;
- import java.awt.Color;
- import java.awt.Robot;
- import java.awt.event.KeyEvent;
- public class FFXCheater {
- public static void main(String[] args) throws AWTException {
- final Robot r = new Robot();
- new Thread() {
- @Override
- public void run() {
- int i = 0;
- while (true) {
- Color c = r.getPixelColor(600, 500);
- if (isWhite(c)) {
- wait(50 + getRandom(5));
- r.keyPress(KeyEvent.VK_SPACE);
- i++;
- System.out.println("SPAZIO! (" + i + ")");
- wait(1000);
- }
- wait(10);
- }
- }
- private boolean isWhite(Color c) {
- return c.getRed() > 150 && c.getGreen() > 150 && c.getBlue() > 150;
- }
- private void wait(int i) {
- try {
- sleep(i);
- } catch (InterruptedException ex) {
- }
- }
- private int getRandom(int e) {
- return (int) (Math.random() * 2 * e) - e;
- }
- }.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement