Jump to content

AutoIt Functions in Java


javas
 Share

Recommended Posts

I'm trying to imitate some of the functions from AutoIt in java. Is it possible to write functions like mouseclickdrag and pixelsearch in java? I heard there was some 'robot' class in the util files in java. Any help getting me pointed in the right direction would be appreciated.

Link to comment
Share on other sites

Maybe using one of the API keybd_event or SendInput. Once you send mouse down input you need to send mouse up input to release the button pressed. By that time you can move the mouse and it'll remain pressed until the next mouse up input is sent. This is quite how it's achieved.

Edit: Moi mistake ;], it's mouse_event of course.

Edited by Authenticity
Link to comment
Share on other sites

Well I wanted to do it in java because I know it better than C++ but I thought that instead of writing my programs in autoit which is what Ive done for a while, they might be more efficient if I customized the functions, removed some extra parameters, and etc.

Link to comment
Share on other sites

Well I wanted to do it in java because I know it better than C++ but I thought that instead of writing my programs in autoit which is what Ive done for a while, they might be more efficient if I customized the functions, removed some extra parameters, and etc.

So, you want to trade off one interpreted language (AutoIt) for another (Java). In order for Java to run in so many different environments, Java gets compiled to a byte-code that then gets interpreted on the target machine.

If you know Java, learning C++ is not that difficult. C++ requires the programmer to be paying a little more attention to details than you can get away with in Java, but that gives you more control as well. Take a look at this university professor's site for an pretty thorough outline of the differences between Java and C++. Here is another site talking about the differences between C++ and Java. Learn these, download a free C++ compiler (like Microsoft's VC++2008) and experiment, reading the docs as you go. Have fun! :D

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...