Jump to content
Sign in to follow this  
computergroove

If (596,433) is hexcolor=000000 then mouseclick

Recommended Posts

computergroove

I need to know how to scan xposition 596 and y position 433 and if the color is 000000 the mouseclick(left,596,433) else scan (596,433) again. Heres what I have so far:

While 1
    Sleep(100)
WEnd


Func start()
    IF 
    MouseClick ("left",596,433)
    
EndFunc

Func _quit()
    Exit
EndFunc

Thanks in advance


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Pain

try with PixelGetColor (596, 433)

Share this post


Link to post
Share on other sites
computergroove

So:

While 1
    Sleep(100)
WEnd


Func start()
    PixelGetColor (596,433)
IF PixelGetcolor = "000000"
    MouseClick ("left",596,433)
Else call start 
EndFunc

Func _quit()
    Exit
EndFunc

Am I close?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Valuater

Maybe....

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused, $Runner, $begin, $wait = 3 ; wait = 3 seconds
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")

Opt("MouseCoordMode", 1)        ;1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 1)        ;1=absolute, 0=relative, 2=client


;;;; Body of program would go here ;;;;
While 1
    Sleep(10)
    If $Runner Then
        $dif = Int(TimerDiff($begin) / 1000)
        If $dif >= $wait Then
            If PixelGetColor(596, 433) = 000000 Then MouseClick("left", 596, 433)
            $begin = TimerInit()
        EndIf
    EndIf
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func ShowMe()
    $Runner = Not $Runner
    $begin = TimerInit()
EndFunc   ;==>ShowMe

8)


NEWHeader1.png

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  

×