Sign in to follow this  
Followers 0
darksoltan

Chasing a Color + Action (GIF Example)

5 posts in this topic

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

Share this post


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

Share this post


Link to post
Share on other sites

Thread smells like a game as mentioned in duplicate thread here:


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

darksoltan,

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0