Clipper34 Posted May 8, 2008 Posted May 8, 2008 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.
someone Posted May 8, 2008 Posted May 8, 2008 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
Clipper34 Posted May 8, 2008 Author Posted May 8, 2008 And also, when i try MouseClick("left", x,y [,clicks] [,speed) it doesnt work any ideas? Thanks
AdmiralAlkex Posted May 8, 2008 Posted May 8, 2008 To get the title of the currently running window use WinGetTitle("[ACTIVE]") .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
AdmiralAlkex Posted May 8, 2008 Posted May 8, 2008 And also, when i try MouseClick("left", x,y [,clicks] [,speed) it doesnt work any ideas? ThanksExactly what code did you use?? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Moderators SmOke_N Posted May 8, 2008 Moderators Posted May 8, 2008 And also, when i try MouseClick("left", x,y [,clicks] [,speed) it doesnt work any ideas? ThanksIt 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.
Clipper34 Posted May 8, 2008 Author Posted May 8, 2008 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?
MikeP Posted May 8, 2008 Posted May 8, 2008 $color = 0x00FF0F $p = PixelSearch(0,@desktopwidth, 0, @desktopheight, $color) MouseClick("left",$p[0],$p[1],1,0)
Moderators SmOke_N Posted May 8, 2008 Moderators Posted May 8, 2008 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.
Clipper34 Posted May 8, 2008 Author Posted May 8, 2008 I don't exactly understand how to use PixelSearch, can you explain it briefly? thanks
Moderators SmOke_N Posted May 8, 2008 Moderators Posted May 8, 2008 (edited) I don't exactly understand how to use PixelSearch, can you explain it briefly? thanksThere'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+MouseClickClick 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 May 8, 2008 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now