Index: /java-automator/.classpath
===================================================================
--- /java-automator/.classpath	(revision 90)
+++ /java-automator/.classpath	(revision 90)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /java-automator/.project
===================================================================
--- /java-automator/.project	(revision 90)
+++ /java-automator/.project	(revision 90)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>java-automator</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /java-automator/src/nl/rickvanderzwet/farmville/Automator.java
===================================================================
--- /java-automator/src/nl/rickvanderzwet/farmville/Automator.java	(revision 90)
+++ /java-automator/src/nl/rickvanderzwet/farmville/Automator.java	(revision 90)
@@ -0,0 +1,118 @@
+/*
+ * Rick van der Zwet <info@rickvanderzwet.nl>
+ * License BSDLike http://rickvanderzwet.nl/LICENSE
+ */
+
+package nl.rickvanderzwet.farmville;
+
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.PointerInfo;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.util.Random;
+import java.awt.MouseInfo;
+import java.io.IOException;
+
+
+
+public class Automator {
+	
+	public enum Direction {
+	    UP, DOWN, LEFT, RIGHT
+	}
+
+	private static Robot bot = null;
+	private static Random randomGenerator = null;
+	
+	private static void pressMouse() throws InterruptedException {
+		bot.mousePress(InputEvent.BUTTON1_MASK);
+		// Constant values are tricky, computers can only do that
+		Thread.sleep(500 + randomGenerator.nextInt(250));
+		bot.mouseRelease(InputEvent.BUTTON1_MASK);
+		
+	}
+	
+	/**
+	 * @param args
+	 * @throws InterruptedException 
+	 * @throws IOException 
+	 */
+	public static void main(String[] args) throws InterruptedException, IOException {
+		try {
+			//bot.mouseMove(100, 100);
+			bot = new Robot();
+			PointerInfo pointer = null;
+		    randomGenerator = new Random();
+			// Allow time to focus firefox window
+			Thread.sleep(2000);
+
+			int x = 0 ,y = 0;
+			/*
+			bot.mouseMove(500, 500);
+			bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+			bot.mouseMove(700, 700);
+			bot.mouseRelease(InputEvent.BUTTON1_MASK);
+			*/
+			
+			Boolean press_mouse = false;
+			Integer farm_size_y = 4;
+			Integer farm_size_x = 19;
+			/* 0 = up, 1 = down, 2 = left, 3 = right */
+			Direction direction = Direction.UP;
+			
+		    if (press_mouse) {
+		    	pressMouse();
+		    }
+			// Save the mouse button :-)
+		    for (int i = 0; i < farm_size_y; i++) {
+		    	for (int j = 0; j < farm_size_x; j++) {
+		    		pointer = MouseInfo.getPointerInfo();
+
+		    		x = pointer.getLocation().x;
+		    		y = pointer.getLocation().y;
+		    		System.out.println("x: " + x + ", y: " + y);
+
+
+		    		/* Too difficult to diffentiate, try larger parts */
+		    		Color p = bot.getPixelColor(x, y);	
+		    		System.out.println("Pixel color R:" + p.getRed() + ",G:" + 
+		    				p.getGreen() + ",B:" + p.getBlue());
+
+		    		/* Relocate to next field */
+		    		switch (direction) {
+		    			case UP:
+			    			bot.mouseMove(x - 24, y - 12);
+			    			break;
+		    			case DOWN:
+			    			bot.mouseMove(x + 24, y + 12);
+			    			break;
+		    			case LEFT:
+			    			bot.mouseMove(x - 24, y + 12);
+			    			break;
+		    			case RIGHT:
+			    			bot.mouseMove(x + 24, y - 12);
+			    			break;
+		    		}
+		    		
+					Thread.sleep(100);
+
+		    		if (press_mouse) {
+		    			pressMouse();
+		    		}
+		    	}
+		    	
+		    }
+		} catch (AWTException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		// TODO Auto-generated method stub
+
+	}
+
+
+
+}
