Jump to content

Chasing a Color + Action (GIF Example)


Recommended Posts

Hey guys, this is what I'm trying to do... have autoit search for a blue moving bar, based on the location of mouse position, so the mouse dictates the pixelsearch parameters. While at the same time the mouse clicks the black box below the blue bar every half a second.

I've rattled my brain for 2 hours now and can't come up with a solution. Any guesses?

http://imgur.com/4zkpe

HotKeySet('{ESC}','_exit')
sleep(2000)

While 1
Global $mouse = MouseGetPos()

            $Coord = PixelSearch( $mouse[0]-150, $mouse[1]-45, $mouse[0]+150, $mouse[1]+45, 0x3F48CC, 5, 5) ; Search a blue bar near mouse position
                While @error = 0
                MouseClick("left",$coord[0]+45,$coord[1]+40)
                MouseMove($coord[0], $coord[1], 1)
                $Coord = PixelSearch( $mouse[0]-40, $mouse[1]-40, $mouse[0]+40, $mouse[1]+40, 0x3F48CC, 5, 5)
                WEnd

sleep(100)
WEnd

Func _exit()
    Exit
EndFunc

post-69555-0-73948300-1327890907_thumb.g

Link to post
Share on other sites

try this in stead of the second loop

While @error = 0
    MouseMove($coord[0], $coord[1], 1)
    Sleep(500)
    $mouse = MouseGetPos()
                $Coord = PixelSearch( $mouse[0]-60, $mouse[1]-60, $mouse[0]+60, $mouse[1]+60, 0x3F48CC, 5, 5)
    If @error Then ExitLoop
    MouseClick("left",$coord[0]+45,$coord[1]+40,1,1)
                WEnd

it will click every half second

raised the speed to not click outside the box

enlarged secon search area to avoid errors

included mousegetpos in the loop to refresh coord

Link to post
Share on other sites
  • Moderators

And darksoltan, I still don't see where you've complied with the Mod's request to provide a legitimate reason for your request...

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites
  • Moderators

darksoltan,

2200 UTC and no explanation. Do not start a third thread on this subject.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...