Jump to content
Sign in to follow this  
javas

AutoIt Functions in Java

Recommended Posts

javas

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.

Share this post


Link to post
Share on other sites
Authenticity

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

Share this post


Link to post
Share on other sites
Richard Robertson

It won't be easy. Java is designed for MANY environments and not all environments will support those kinds of things. The only way to do some of them is by calling dll functions which ruins the whole point of java.

Why do you want to write these in java?

Share this post


Link to post
Share on other sites
javas

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.

Share this post


Link to post
Share on other sites
Richard Robertson

In my experience, AutoIt is significantly better than java for Windows work.

Share this post


Link to post
Share on other sites
Nutster

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...

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.