shea851 Posted April 3, 2007 Posted April 3, 2007 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:Understand what i'm trying to do? Is this possible with Autoit? If not, is there a program that will do this?
jvanegmond Posted April 3, 2007 Posted April 3, 2007 #include <GUIConstants.au3> GUICreate("", 5,5,50,50,$WS_POPUP) GUISetBkColor(0x00FF00) GUISetState() While 1 If GUIGetMsg() = -3 Then ExitLoop EndIf WEnd github.com/jvanegmond
jvanegmond Posted April 3, 2007 Posted April 3, 2007 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 github.com/jvanegmond
shea851 Posted April 3, 2007 Author Posted April 3, 2007 Thanks so much for the quick and informative reply!That's exactly what I needed, Autoit is such a powerful tool...
jvanegmond Posted April 3, 2007 Posted April 3, 2007 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.. github.com/jvanegmond
shea851 Posted April 3, 2007 Author Posted April 3, 2007 (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 Edited April 3, 2007 by shea851
jvanegmond Posted April 3, 2007 Posted April 3, 2007 It's a common error made.. 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 github.com/jvanegmond
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now