Jump to content

Can autoit display colors?


Recommended Posts

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?

Link to comment
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
Link to comment
Share on other sites

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...