Author |
Message |
mrnitler
|
Posted: Sun Apr 18, 2010 3:41 pm Post subject: Clicker help |
|
|
My mission in all of this is to create a program to click my desktop screen every few minutes
For example:
My desktop resolution is 1200x1200, and I want to click on pixel 800x800 every 3 minutes.
How would I go about doing that? Help is much appreciated. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Euphoracle
![](http://compsci.ca/v3/uploads/user_avatars/11170373664bf5f25f636f1.png)
|
Posted: Sun Apr 18, 2010 4:39 pm Post subject: RE:Clicker help |
|
|
look into java.awt.Robot maybe? |
|
|
|
|
![](images/spacer.gif) |
mrnitler
|
Posted: Wed Apr 21, 2010 10:20 pm Post subject: Re: Clicker help |
|
|
where can i find that? |
|
|
|
|
![](images/spacer.gif) |
Euphoracle
![](http://compsci.ca/v3/uploads/user_avatars/11170373664bf5f25f636f1.png)
|
|
|
|
![](images/spacer.gif) |
Barbarrosa
![](http://compsci.ca/v3/uploads/user_avatars/12538789384c18775f61c5e.jpg)
|
Posted: Thu Apr 22, 2010 7:56 pm Post subject: Re: Clicker help |
|
|
I recommend Robot and MouseInfo (just google "java (Class/Interface)"). Don't forget to add a stopping mechanism, like a button or something.
I did 2 similar projects (which are posted in the Java Submissions section) that you may want to look at. |
|
|
|
|
![](images/spacer.gif) |
andrew.
|
Posted: Thu Apr 22, 2010 9:08 pm Post subject: Re: Clicker help |
|
|
Look into Robot. Here is an example:
Java: | import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.AWTException;
public class RobotTest2
{
public static void main (String [] args )
{
try
{
while (true)
{
Robot robot = new Robot(); // Create a new robot
robot. mouseMove(800, 800); // Move the mouse to 800, 800
robot. mousePress(InputEvent. BUTTON1_MASK); // Press mouse button
robot. mouseRelease(InputEvent. BUTTON1_MASK); // Release mouse button
robot. delay(60000); // 1 minute = 60000 ms
robot. delay(60000);
robot. delay(60000); // Do it 3 times
}
}
catch (AWTException e )
{
e. printStackTrace();
}
}
} |
That should work. |
|
|
|
|
![](images/spacer.gif) |
|