Jump to content
Sign in to follow this  
molo69

Help

Recommended Posts

molo69

hello,

I want that when a color appears 0xff910b mouse click them what code should I save?

(sorry i'm french )

Share this post


Link to post
Share on other sites
jokke

Something like this ?

While 1
    $mpos = MouseGetPos()
    $color = PixelGetColor ( $mpos[0] , $mpos[1] )
    
    TrayTip("Mouse Pointer","Color under Mouse Pointer: "&hex($color)&@CRLF&" Mouse pos X: "&$mpos[0]&" Y: "&$mpos[1],5)

    Sleep(200)
WEnd
Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
molo69

no it's not that i like to when the color appears the mouse click on this color.

the color is 00febc6c

Edited by molo69

Share this post


Link to post
Share on other sites
jokke

Then you need to use PixelSearch.

Then use it like this:

While 1
    $search = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,"00febc6c",20)
    If UBound($search) > 0 Then ;Found color.
        ConsoleWrite("Found color at pos X:" &$search[0]&" Y:"&$search[1]& @CRLF)
        
        MouseClick("left",$search[0],$search[1],"1","1")
        
        Exit ;Remove this if everything works as it should.
    EndIf
    
    Sleep(25) ;removing some cpu usage.
WEnd

Edit, typo.

Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
molo69

i have a problem when i use this script this close the windows

Share this post


Link to post
Share on other sites
jokke

The code itself is correct, how its used i dont know, it might be the search paramerters that need's tweaking.


UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
molo69

the mouse is teleport on the top right of the screen when i use the script.

Share this post


Link to post
Share on other sites
jokke

You need to edit this line of code:

$search = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,"00febc6c",20)

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
James

Welcome to the forums, as your new a bit of friendly advice. Please don't post with "Help, I need help" in your title. This gives most people who help here no reason to help you.

You need to look at PixelSearch.

Try this:

Opt("PixelCoordMode", 1)
Opt("ColorMode", 0)
$Color = Hex(0xff910b)
ConsoleWrite($Color & @CRLF)
$Search = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $Color,0)
If Not @error Then
    MsgBox(0, @ScriptName, "Found color!")
EndIf

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  

×