muzle6074 Posted January 31, 2008 Posted January 31, 2008 $j = 543824 $w = "i" WinWaitActive($w) WinMove($w, "", 0, 0) While 1 Sleep(10) $c = PixelSearch(0, 0, 800, 600, Hex($j, 6)) WEnd If the pixelsearch is successful I want to be able to move the mouse to where this pixel value is located. How can I do that using mouse move?
BrettF Posted January 31, 2008 Posted January 31, 2008 (edited) $j = 543824 $w = "i" WinWaitActive($w) WinMove($w, "", 0, 0) While 1 Sleep(10) $c = PixelSearch(0, 0, 800, 600, Hex($j, 6)) WEnd If the pixelsearch is successful I want to be able to move the mouse to where this pixel value is located. How can I do that using mouse move?Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y) MouseMove ($array[0], $array[1]) And RTFM. That took me 2 seconds in the helpfile. 1 to look for PixelSearch return values, and the other to see the syntax for MouseMove. Edited January 31, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
muzle6074 Posted January 31, 2008 Author Posted January 31, 2008 Thanks for quick response Bert. I was aware of the returning values but I don't know how to declare an array that stores the returning values of a PixelSearch(). I'm new to AutoIt please help
BrettF Posted January 31, 2008 Posted January 31, 2008 Thanks for quick response Bert. I was aware of the returning values but I don't know how to declare an array that stores the returning values of a PixelSearch(). I'm new to AutoIt please help $array = PixelSearch () $x = $array[0] I'm sure you can work out the rest Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
muzle6074 Posted January 31, 2008 Author Posted January 31, 2008 While 1 Sleep(10) $array = PixelSearch(0, 0, 800, 600, Hex($javelin, 6)) $x = $array[0] $y = $array[1] MouseMove($x, $y) WEnd Says "Error: Subscript used with non-Array varaible." Please dont laugh @ me
BrettF Posted January 31, 2008 Posted January 31, 2008 While 1 Sleep(10) $array = PixelSearch(0, 0, 800, 600, Hex($javelin, 6)) $x = $array[0] $y = $array[1] MouseMove($x, $y) WEnd Says "Error: Subscript used with non-Array varaible." Please dont laugh @ me What does it return if there is an error? Hmmm? That and conditional statements. I'm not going to do all the work for u. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
muzle6074 Posted January 31, 2008 Author Posted January 31, 2008 Ok, I came up with this. It didnt throw an error but it didnt work either #include <Array.au3> $j = "543824" $w = "i" WinWaitActive($w) WinMove($w, "", 0, 0) While 1 Sleep(10) $coords = PixelSearch(0, 0, 800, 600, Hex($j, 6)) if Not @error Then $x = $coords[0] $y = $coords[1] MouseMove($x, $y) EndIf WEnd
BrettF Posted January 31, 2008 Posted January 31, 2008 #include <Array.au3> $j = "FFFFFF" $w = "i" ;WinWaitActive($w) ;WinMove($w, "", 0, 0) While 1 Sleep(10) $coords = PixelSearch(0, 0, 800, 600, "0x" & $j, 20) ConsoleWrite (@error & @CRLF) if Not @error Then $x = $coords[0] $y = $coords[1] MouseMove($x, $y) EndIf WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
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