Jump to content
Sign in to follow this  
Neversleep

Pause a script if pixel becomes of a specific color

Recommended Posts

Neversleep

Hi, I have a simple script that works perfectly, but I would like to put another piece of script that, if a specific point becomes orange (let's say) , the script that I have now pauses and in the meantime autoit should:

1) Click in the coords I give him

2) Waits until a specific pixel becomes white

3) Presses "J"

4) Presses "J" again (after 10 seconds)

The script that I have now should remain paused until the pixel is NOT orange

Until now I have made something, but then I erased it because it did not work

I've thought something like:

If ;don't know how to tell him "If coord is orange"

mousemove (x, y, 1)

mouseclick (x, y, 1)

sleep Until ; don't know how to tell him "Until Pixel at coords X1, Y1 becomes white"

""press J""

sleep (10000)

""press J""

sleep (10000)

;and from now on I don't have idea how to proceed...

Share this post


Link to post
Share on other sites
water

Can you please tell us what kind of application you try to automate?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Neversleep

I've read the rules, it's not a bot if you're thinking about it ;) It has to do with skype or msn: practically when someone tells you something the icon (don't know how to say it in English) becomes orange and blinks

Share this post


Link to post
Share on other sites
Neversleep

Nothing ?

Share this post


Link to post
Share on other sites
Venix

Something along the lines of this might help you, if you receive errors let me know.

In the PixelGetColor statements you will need to change the number values to the hexadecimal colour value that you want to use to get this value you can use something like this.

$Colour = PixelGetColor(0, 0)
MsgBox(64, "Colour", $Colour)
ClipPut($Colour)

If PixelGetColor(0, 0) = "0000000" Then
MouseMove(100, 100, 1) ; This line is actually pointless because mouseclick deals with this but you asked for it.
MouseClick("Left", 100, 100, 1, 1)
Do
Until PixelGetColor(100, 100) = "FFFFFFF" ; I am using a do until statement to pause the script however im sure there are better ways to do this.
Send("J")
Sleep(10000)
Send("J")
EndIf
Edited by Venix

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  

×