Jump to content

If (pic) = active Then


_Kurt
 Share

Recommended Posts

Hey guys,

Is it possible to see if (example.gif) is active at ($X, $Y) or something similar? PixelCheckSum is not what i need since the program just needs to see if the pic is there, rather than to check if something changed.

(sorry for no example script)

Thanks,

Kurt

** EDIT ** 100 POSTS WOOHOO

Edited by _Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

  • Moderators

Is this in your own app?

ControlCommand + IsVisible or IsEnabled

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

Or if applicable, perhaps IsObj?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Well, to elaborate on my problem, say you're playing an internet game and a big happy face appears if (for example) you click. If I take a screenshot, cut out the happy face and save it as a .gif in the scripts directory, would I be able to see if that happy face is active (when playing the game).

Example:

$pic = "picture.gif"
If $pic = (active) Then
    Msgbox(0,"","Happy Face Appeared!")
EndIf

Kurt

Awaiting Diablo III..

Link to comment
Share on other sites

You want to get a PixelCheckSum of a certain region in advance and code the return value in your script. Make your AutoIt script poll constantly to see wether the current PixelCheckSum is equal to that of the earlier captured checksum that showed the smiley face.. When the checksums are equal, the test has passed.

Don't argue with me over this, this is the most reliable and easiest way to do this. ;)

Edited by Manadar
Link to comment
Share on other sites

  • Moderators

The problem is, the "screen" is always moving, if it detects a change in $X and $Y, it will do my function. The happy face may pop up at any time.

The answer as stated is PixelCheckSum()... or if the picture has a control value to check if it's enabled or disabled, if it's a browser based game then look at the getcollection (I think that's the name) of the IE* functions... other than that, you have 3 choices, the first being the hardest because now you have to get a multitude of sums to make it work.

What game is it... maybe someone has already done 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

Game: Diablo 2

Purpose: To click on the "accept box" as soon as the other person has checked the accept box. Basically for the fun game known as "green box" where the other person flashes the accept box on and off quickly, than it's your turn to do the same.

Awaiting Diablo III..

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