Sign in to follow this  
Followers 0
shea851

Can autoit display colors?

7 posts in this topic

Can Autoit be used to create scripts that will display/change pixels on the screen to certain colors the entire time the script is running?

For instance, while a script is running, could it change a pixel or a group of pixels on the screen to the color green, so that I could set a fuction in that script to search for those green pixels and easily find it/click it?

Here is an example of what I want to do:

Posted Image

Understand what i'm trying to do? Is this possible with Autoit? If not, is there a program that will do this?

Share this post


Link to post
Share on other sites



This is a bit more advanced:

#include <GUIConstants.au3>

HotKeySet("{ESC}","_Exit")

Dim $i = True

$GUI = GUICreate("", 5,5,0,0,$WS_POPUP,$WS_EX_TOOLWINDOW)
GUISetBkColor(0x00FF00)

GUISetState()
WinSetOnTop($GUI,"",1)

AdlibEnable("SwitchColor",800)

While 1
    If GUIGetMsg() = -3 Then
        ExitLoop
    EndIf
WEnd

Func SwitchColor()
    $i = Not $i
    If $i Then
        GUISetBkColor(0x00FF00)
    Else
        GUISetBkColor(0xFF0000)
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

Thanks so much for the quick and informative reply!

That's exactly what I needed, Autoit is such a powerful tool...

Share this post


Link to post
Share on other sites

Thanks so much for the quick and informative reply!

That's exactly what I needed, Autoit is such a powerful tool...

Only in the right hands, shea, only in the right hands...

Just kidding, you're welcome.. :shocked:

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Well, I thought I had everything I needed but i've run into a bit of a problem. I've been successful in creating a box or a line using the code you pasted above, but anytime I try to add another box or line, it only displays one... Here is what I have:

#include <GUIConstants.au3>


GUICreate("", 263,1,874,39,$WS_POPUP,$WS_EX_TOPMOST)
GUICreate("", 1,831,874,39,$WS_POPUP,$WS_EX_TOPMOST)
GUISetBkColor(0x00FF00)

GUISetState()

While 1
    If GUIGetMsg() = -3 Then
        ExitLoop
    EndIf
WEnd

However it only displays one of the GUIcreate.

I basically need to make random lines/boxes in certain places on my screen all in 1 script. In theory it seemed easy, just keep adding GUIcreates of what I need, then run it. But it seems like I can only have ONE GUIcreate....

What do I need to do? Sorry for the newb questions :shocked:

Edited by shea851

Share this post


Link to post
Share on other sites

It's a common error made.. :shocked: Don't stress yourself too much.

#include <GUIConstants.au3>


GUICreate("", 263,1,874,39,$WS_POPUP,$WS_EX_TOPMOST)
GUISetBkColor(0x00FF00)

GUISetState()

GUICreate("", 1,831,874,39,$WS_POPUP,$WS_EX_TOPMOST)
GUISetBkColor(0x00FF00)

GUISetState()

While 1
    If GUIGetMsg() = -3 Then
        ExitLoop
    EndIf
WEnd

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  
Followers 0