Jump to content

Noob Question - Please Help


Recommended Posts

Hi!

What I want my script to do:

Nothing until a certain window appears

Then click the right of two buttons

Then do noting again, waiting for the same thing.

using AU3info I gathered this info

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Testprog

Class: #32770

Size: X: 449 Y: 460 W: 389 H: 119

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 570 Y: 528

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xD4D0C8 Dec: 13947080

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

&Yes

&No

Would you like to proceed?

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

my first attempt :think: looked something like this:

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

WinWaitActive ( "Testprog", ["&Yes &No"], [timeout] )

ControlClick ( "Testprog", "&Yes &No", controlID [, "right"] [, clicks]] )

but obviously missing a lot :( , can you please help me?

Thanks

Eric

Edited by Heracles
Link to comment
Share on other sites

  • Moderators

A lot of nice tips there!

Figured out a much easier approach:

#include <GUIConstants.au3>

$i = 0

Do

WinWaitActive ("Testprog")

send("{TAB}")

send("{ENTER}")

Until $i = 1

And it works like a charm! :think:

Thanks a lot!

Your loop never stops... Might try this:
HotKeySet('{ESC}', 'ExitNow')

While 1
    WinWaitActive('Testprog')
    Send('{Tab}')
    Send('{ENTER}')
    Sleep(10)
WEnd

Func ExitNow()
    Exit
EndFunc
The Hotkey will let you press Esc to exit the script, so at least you have some control over it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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