Hyflex Posted November 1, 2006 Share Posted November 1, 2006 I want help for If Pixel Search finds a color for it to move the mouse to that color. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 1, 2006 Share Posted November 1, 2006 HELP FILE, pixelsearch returns the coords in an array assigned to the variable so if you go open the help file type in pixelsearch MAGICALLY IT SHOWS U Link to comment Share on other sites More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 (edited) I have PixelSearch searcing in a certain location for a certain color how do i do a While 1 ><><><>< HERE ><><><><; I want mouse to move the what PixelSerch Finds. WEndoÝ÷ ØAºÚ"µÍÌÍÔ]ÝHL[ÈÔÙ][ÌJ BÚ[HB ÌÍØÛÛÜH^[ÙXÚ MÍLMÎL K ÌÍÔ]ÝH BYÜ[ÒTIÌÌÎÉÌÌÎÉÌÌÎÂ[YÑ[[[ÂIm guessing its got something to do with: http://www.autoitscript.com/autoit3/docs/f...s/MouseMove.htm Edited November 1, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 Well put that link together with this one and you've got your answer. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 (edited) Does the following then look right? ; Hotkey Settings HotKeySet("{END}","Escape") ; Hotkey Settings End ; Main Settings / Constants $AAIM = 0x6A0065 ; Main Settings / Constants End ; Start While 1 $coord = PixelSearch( 180, 46, 185, 53, $AAIM, 1 ) If @error Then MouseMove($coord[0], $coord[1]) EndIf WEnd ;End ; Exit Program Func Escape() Exit EndFunc ; Exit Program End Edited November 1, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 (edited) HotKeySet("{END}","Escape") $AAIM = 0x6A0065 While 1 $coord = PixelSearch( 180, 46, 185, 53, $AAIM, 1 ) If not @Error Then MouseMove($coord[0], $coord[1]) WEnd Func Escape() Exit EndFunc Edited November 1, 2006 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 1, 2006 Share Posted November 1, 2006 (edited) No. If @error means that if something goes wrong, it process the commands inside the If. TryIf Not @error Then ...Edit: Evil PaulIA. You posted while I was posting. Edited November 1, 2006 by Icekirby1 Link to comment Share on other sites More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 (edited) Thanks so i was nearly there But lastly is there a way i can make it move down a certain ammount? and is there a way i can get it to click when it gets to the color.? Edited November 1, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 Hmmm... Let's see. If I wanted to move the mouse and then click what function would I be looking for. Ah, why I'd want to use the nifty AutoIt Help File to look for MouseClick which does the same thing as MouseMove, but also clicks the mouse.AutoIt Help: Read it, know it, use it. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 1, 2006 Moderators Share Posted November 1, 2006 Hmmm... Let's see. If I wanted to move the mouse and then click what function would I be looking for. Ah, why I'd want to use the nifty AutoIt Help File to look for MouseClick which does the same thing as MouseMove, but also clicks the mouse.AutoIt Help: Read it, know it, use it. In short RTFM? 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 More sharing options...
PaulIA Posted November 1, 2006 Share Posted November 1, 2006 In short RTFM?Exactly... Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 Thanks, that helped ALOT!, i cant find anywhere in help files and online documentation on how to move down X ammount from the thing the pixel search finds. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 1, 2006 Moderators Share Posted November 1, 2006 Thanks, that helped ALOT!, i cant find anywhere in help files and online documentation on how to move down X ammount from the thing the pixel search finds.Generally we use math to do that. 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 More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 SmOke_N, .... how exactly just giv me some hits and an exaple for me t play with. See below it has: MouseMove($coord[0], $coord[1]) how do i do like a move down x ammount? HotKeySet("{END}","Escape") $AAIM = 0x6A0065 While 1 $coord = PixelSearch( 180, 46, 185, 53, $AAIM, 1 ) If not @Error Then MouseMove($coord[0], $coord[1]) WEnd Func Escape() Exit EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 1, 2006 Moderators Share Posted November 1, 2006 (edited) SmOke_N, .... how exactly just giv me some hits and an exaple for me t play with. See below it has: MouseMove($coord[0], $coord[1]) how do i do like a move down x ammount? HotKeySet("{END}","Escape") $AAIM = 0x6A0065 While 1 $coord = PixelSearch( 180, 46, 185, 53, $AAIM, 1 ) If not @Error Then MouseMove($coord[0], $coord[1]) WEnd Func Escape() Exit EndFuncExamples of what? You haven't asked a question really other than how to offset the movement. Well if $coord[0] = The x coord, and I want to move in either a left or right direction, I would use - or + ($coord[0] - something) or ($coord[0] + something). And $coord[1] = the Y position. (Up or down) Anything other than that, you need to be ALOT!!! more specific, with explicit details, most of us aren't mind readers. Edited November 1, 2006 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. Link to comment Share on other sites More sharing options...
Hyflex Posted November 1, 2006 Author Share Posted November 1, 2006 Sorry im not the best at explaing, thanks but im confused how would i calculate how far down... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 1, 2006 Moderators Share Posted November 1, 2006 Sorry im not the best at explaing, thanks but im confused how would i calculate how far down...If you want to move to a specific color then you have all that you need. $iPix = PixelSearch(xTopLeft, yTopLeft, xBottomRight, xBottomLeft, Color) If IsArray($iPix) Then MouseMove($iPix[0], $iPix[1])That's it man. If your going off Client Coords / or Window Coords / or Screen Coords, then you need to look at "Opt" in the help file and find PixelCoordMode / MouseCoordMode and what to set those too. If that isn't enough, then you're SOL. 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 More sharing options...
Hyflex Posted November 2, 2006 Author Share Posted November 2, 2006 If you want to move to a specific color then you have all that you need. $iPix = PixelSearch(xTopLeft, yTopLeft, xBottomRight, xBottomLeft, Color) If IsArray($iPix) Then MouseMove($iPix[0], $iPix[1])That's it man. If your going off Client Coords / or Window Coords / or Screen Coords, then you need to look at "Opt" in the help file and find PixelCoordMode / MouseCoordMode and what to set those too. If that isn't enough, then you're SOL. Thanks again another way wat will work but like u said on it before with the - Y how can i tell how many to deduct form coord[1] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 2, 2006 Moderators Share Posted November 2, 2006 Thanks again another way wat will work but like u said on it before with the - Y how can i tell how many to deduct form coord[1]The above code(s) posted click the exact spot where the color was found. It returns the coords as I explained previously. Why are you talking about deduct... what do you want to deduct and why? 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 More sharing options...
Hyflex Posted November 2, 2006 Author Share Posted November 2, 2006 right when it finds the exact spot where the color is, i wan it to move to that spot but down a bit.... Link to comment Share on other sites More sharing options...
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