HcClassic Posted February 1, 2010 Share Posted February 1, 2010 I need some help If this is the Screen ____________________ | x.................| |...................| |...................| |...................| |..................x| i want to start at the first x and end at the last x but by move the mouse over all the x and y till it reaches the last x like in a maze hope u understand Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 hope u understandYes, so what have you tried before posting this question? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
HcClassic Posted February 1, 2010 Author Share Posted February 1, 2010 Yes, so what have you tried before posting this question?well i trying this atmMouseMove(0,0)Mousemove(1151,0)Mousemove(0,1)Mousemove(1151,1)Mousemove(0,2)Mousemove(1151,2)but will take long time till finished but that wont be a problemi was just hoping there was a faster wayand while it was moving and it detects an certain color on the ( example x = 324 y = 242)it had to click there and stop moving with the mouse Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 well i trying this atmMouseMove(0,0)Mousemove(1151,0)Mousemove(0,1)Mousemove(1151,1)Mousemove(0,2)Mousemove(1151,2)but will take long time till finished but that wont be a problemi was just hoping there was a faster wayand while it was moving and it detects an certain color on the ( example x = 324 y = 242)it had to click there and stop moving with the mouseThink about using a For-Next loop and look at the Parameters for the MousMove() function in the Helpfile to speed it up.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
HcClassic Posted February 1, 2010 Author Share Posted February 1, 2010 Think about using a For-Next loop and look at the Parameters for the MousMove() function in the Helpfile to speed it up.Josi do not really get the For-Next loop can u explain it a bit to me please?if u can't do it in english dutch is fine for me too Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 if u can't do it in english dutch is fine for me tooDon't know why but this remark did put a smile on my face. By the way: The script will look "more or less" the same in Dutch and English.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DustinBowers Posted February 1, 2010 Share Posted February 1, 2010 Hi there. I think this is what youre looking to do but it does take a while for the process to play itself out. If you want to make it faster, you could add something like a Step to it to skip a few actual pixel locations on the screen. Example() Func Example() For $y = 0 To @DesktopHeight For $x = 0 To @DesktopWidth HotKeySet("{ESC}", "Stop") MouseMove($x, $y) Next Next EndFunc Func Stop() Exit EndFunc Link to comment Share on other sites More sharing options...
HcClassic Posted February 1, 2010 Author Share Posted February 1, 2010 (edited) Don't know why but this remark did put a smile on my face. By the way: The script will look "more or less" the same in Dutch and English.Joswell i still dont understand iti readed helpstill no clue how it worksedit : i try DustinBowers his way Edited February 1, 2010 by HcClassic Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 (edited) well i still dont understand iti readed help-snipstill no clue how it worksNo need to Cut&Paste the Helpfile page. What part is unclear to you?Is it what a For-Next is supposed to do or how to apply it for your purpose?Anyway, look one post above yours for some hints.Jos Edited February 1, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DustinBowers Posted February 1, 2010 Share Posted February 1, 2010 If all youre trying to do is locate a color on the screen and click it when it appears use the pixelsearch. Ive included a quick example, I hope it helps. I didnt realize you were looking for a color the first time i read your post. Hope this helps a little more. should work a lot quicker too. Example2() Func Example2() $Color = "0xFFFFFF" While 1 Sleep(50) $XY = PixelSearch( 0, 0, @DesktopWidth, @DesktopHeight, $Color) HotKeySet("{ESC}", "Stop") If Not @error Then MouseClick("Left", $XY[0], $XY[1], 1, 10) MsgBox(0, "Found", $Color & " was found at:" & $XY[0] & "," & $XY[1], @DesktopWidth/2, @DesktopHeight/2) Stop() EndIf WEnd EndFunc Func Stop() Exit EndFunc Link to comment Share on other sites More sharing options...
HcClassic Posted February 1, 2010 Author Share Posted February 1, 2010 If all youre trying to do is locate a color on the screen and click it when it appears use the pixelsearch. Ive included a quick example, I hope it helps. I didnt realize you were looking for a color the first time i read your post. Hope this helps a little more. should work a lot quicker too. Example2() Func Example2() $Color = "0xFFFFFF" While 1 Sleep(50) $XY = PixelSearch( 0, 0, @DesktopWidth, @DesktopHeight, $Color) HotKeySet("{ESC}", "Stop") If Not @error Then MouseClick("Left", $XY[0], $XY[1], 1, 10) MsgBox(0, "Found", $Color & " was found at:" & $XY[0] & "," & $XY[1], @DesktopWidth/2, @DesktopHeight/2) Stop() EndIf WEnd EndFunc Func Stop() Exit EndFunc well if i move my mouse from x=0 and y=0 over till @desktopwidth , @desktopheight then if a red pixel for example suddenly appears when my mouse were at x = 241 y = 141 ( just some random y - x ) i want it to click at my current mouseposition which would be x = 241 and y = 141 then(mouseclick "left" 241,141,1) and when it click at the postition i want it to stop move my mouse and just do some other random action Link to comment Share on other sites More sharing options...
DustinBowers Posted February 1, 2010 Share Posted February 1, 2010 Ok i think i understand what you want to do so try this : Example() Func Example() $Color = "0xFFFFFF" For $y = 0 To @DesktopHeight For $x = 0 To @DesktopWidth HotKeySet("{ESC}", "Stop") MouseMove($x, $y) $GetColor = PixelGetColor($x, $y) If $GetColor = $Color Then MouseClick("Left", $x, $y, 1, 10) Stop() EndIf Next Next EndFunc Func Stop() Exit EndFunc 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