Sign in to follow this  
Followers 0
Clipper34

help with WinExists

12 posts in this topic

hey guys, i got another question. I'm having trouble with WinExists() when ever i use i get an error, is their a different function that identifies the current window opened while running the script? heres the script i'm working on

$start = 1
Sleep(6000)
While $start > 0
    If WinExists("Window here") Then
        MouseMove(402, 466)
        MouseClick("left",404,476,1,3)
    EndIf
    WEnd
Thanks.

Share this post


Link to post
Share on other sites



What error are you getting? You should put a sleep in your While loop but other then that it looks ok to me...


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

And also, when i try

MouseClick("left", x,y [,clicks] [,speed)
it doesnt work any ideas? Thanks

Share this post


Link to post
Share on other sites

And also, when i try

MouseClick("left", x,y [,clicks] [,speed)
it doesnt work any ideas? Thanks
It doesn't work, or you are running it in a Virtual Environment?

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.

Share this post


Link to post
Share on other sites

i just figured it out, thanks for the replys guys. One more question, in the window spy theres a color code when you put your cursor over anything on the screen, is there a way to call MouseClick to click that certain color code?

Share this post


Link to post
Share on other sites

i just figured it out, thanks for the replys guys. One more question, in the window spy theres a color code when you put your cursor over anything on the screen, is there a way to call MouseClick to click that certain color code?

PixelSearch will return an array if the color searched for is found. You can pass the var[0] (x coord) and the var[1] (y coord) to MouseClick after checking (with @error or IsArray) if PixelSearch was successful.

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.

Share this post


Link to post
Share on other sites

#10 ·  Posted

I don't exactly understand how to use PixelSearch, can you explain it briefly? thanks

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I don't exactly understand how to use PixelSearch, can you explain it briefly? thanks

There's a help file with an example. Pretty self explanatory.

Edit:

And that's not easy enough with the "right" example, we have this nifty thing here called a search feature.

If you go to advanced, you could put in something like:

PixelSearch+MouseClick

Click Titles only as well if you want...

And you might turn up a few (thousand) results with examples and solutions to other peoples problems you might run into like this: http://www.autoitscript.com/forum/index.ph...ch%2BMouseclick

Edited by SmOke_N

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.

Share this post


Link to post
Share on other sites

#12 ·  Posted

Ok sorry Sm0ke, and thanks for all 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  
Followers 0