Duran Posted June 20, 2007 Share Posted June 20, 2007 ok well I have been building a script for the last few days and I am stumpt on how to get it to work how it suppose to. Maybe someone on here might know what I am doing wrong. So far it looks like this: GUICreate("###########"); Title HotKeySet("{F1}", "_Sleep"); Hotkey to get out of the mode. Opt("GUICoordMode",2) $Button_1 = GUICtrlCreateButton ("Run Test", 10, 30, 100); Start button $Button_2 = GUICtrlCreateButton ( "Stop Test", 0, -25); close GUI $Kolor = 0xFF9933 GUISetState () ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select; Buttons to choose from. Case $msg = $Button_2 ExitLoop Case $msg = $Button_1 While $Kolor = 0xFF9933 MouseClick("left", 609, 554, 2) If $Kolor = 0xFFFFCC Then sleep(30000) $Kolor = 0xFF9933 EndIf WEnd EndSelect Wend Func _Sleep(); Function to change value of the varible. $Kolor = 0xFFFFCC EndFunc Well the main thing is I want to change the color varible to find a olor and when it does not have the color in the area anymore to sleep for 30 seconds. But this is about as much as I got up with from reading the functions and how they work. I tried to use pixelsearch and pixelgetcolor but i have had no luck with them Also the reason the varible is named kolor is because my "C" button is messed up right now and need to change my keyboard o.O glad to have on screen keyboards Link to comment Share on other sites More sharing options...
DW1 Posted June 20, 2007 Share Posted June 20, 2007 what part of your code is it that detects the color exactly? and why can pixel test not do this? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Duran Posted June 20, 2007 Author Share Posted June 20, 2007 I had it set up with pixelgetcolor like: HotKeySet("{ESC}", "Terminate") $Pix = PixelGetColor(609, 554) $Color = Hex($Pix, 8) $Var = $Color $Bad = 0xFFFFCC While $Var <> $Bad Sleep("100") MouseClick("left", 609, 554, 2) $Pix = PixelGetColor(609, 554) $Color = Hex($Pix, 8) WEnd If $Var = $Bad Then Sleep(33000) $Pix = PixelGetColor(609, 554) EndIf Func Terminate() Exit 0 EndFuncc But I think I confused my self later on and forgot how to make sure its checking for the right color , I think I might have taken the whole pixelgetcolor and search out of context and dont know how to get it to work. This is the script I should have posted first sorry Link to comment Share on other sites More sharing options...
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