Jump to content
Sign in to follow this  
joebob764

How to Select Input Box

Recommended Posts

joebob764

Hey,

I've been fiddling around with AutoIT recently to make a "helper" for an online game I play (Travian). Anyways, I've gone through the tuts in AutoIT 1-2-3 and the threads of people doing similar things and I'm stuck. Right now I have a script that uses my preset pixel coordinates to click around the screen, ultimately sending some troops. However, I'd like to have the script automatically select the correct input box so that it can the number of troops to send. I've looked at the source code and the input's name is "t1" but I can't figure out how to get my script to automatically move the cursor to that input and/or type into that box. Any help is appreciated, I know there are other scripts like mine but I enjoy the process of writing it myself.

Share this post


Link to post
Share on other sites
bundyxc

Take a look at these two functions:

_IEGetObjByName()

_IEFormElementSetValue ()

:)


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
joebob764

Hey,

Since I'm still pretty new to AutoIT (only done a few scripts, all of which only used simple key and mouse automations) it took me a bit to get the commands to work but I ended up using _IEFormGetObjByName , _IEFormElementGetObjByName , _IEFormElementSetValue. It works like a charm, funny to see how amazing it felt to just see a little digital "5" appear in a small form box. I'll use the same logic to select the other necessary things and send. Thanks for the help!

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.