Sign in to follow this  
Followers 0
Hyflex

FAst help please

22 posts in this topic

I want help for If Pixel Search finds a color for it to move the mouse to that color.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by XxXGoD

Share this post


Link to post
Share on other sites

Well put that link together with this one and you've got your answer.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by XxXGoD

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

No. If @error means that if something goes wrong, it process the commands inside the If. Try

If Not @error Then ...

Edit: Evil PaulIA. You posted while I was posting.

Edited by Icekirby1

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks so i was nearly there :whistle:

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 by XxXGoD

Share this post


Link to post
Share on other sites

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. :whistle:


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

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. :whistle:

In short RTFM?

[center]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.[/center]

Share this post


Link to post
Share on other sites

In short RTFM?

Exactly...

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#15 ·  Posted (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
EndFunc
Examples 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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

Sorry im not the best at explaing, thanks but im confused how would i calculate how far down...

Share this post


Link to post
Share on other sites

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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?

[center]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.[/center]

Share this post


Link to post
Share on other sites

right when it finds the exact spot where the color is, i wan it to move to that spot but down a bit....

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