Registering for Freerolls

These days the phlegmatic programmer participates in the National Headsup Poker Championship at Fulltilt Poker. They run lots of qualifiers. The good thing: these qualifiers are free, and they run every 3 minutes. The bad thing: there are only 180 entries in a first round qualifier, so you have to hit the button which registers you for the tournament basically as soon as it appears. Yep, these qualifier tournaments are filled within about 1 second.  Jesus.

Luckily, the phlegmatic programmer speaks Java. Here is his solution to the problem 🙂


package autoclick;

import java.awt.*;
import java.awt.event.InputEvent;

public class Main {

  public static void main(String[] args) throws Exception {
    int x = Integer.parseInt(args[0]);
    int y = Integer.parseInt(args[1]);
    Robot robot = new Robot();
    Color color = null;
    do {
      Color c = robot.getPixelColor(x, y);
      if (color == null) {
        color = c;
      } else {
        if (!color.equals(c)) {
          robot.mouseMove(x, y);
          robot.mousePress(InputEvent.BUTTON1_MASK);
          System.exit(0);
        }
      }
      try {
        Thread.sleep(1);
      } catch (Exception e) {}
    } while(true);
  }

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: