Sign in to follow this  
Followers 0
Duran

Custom script need help.

3 posts in this topic

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. :rolleyes:

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 :rambo: 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 :x

Share this post


Link to post
Share on other sites



what part of your code is it that detects the color exactly? and why can pixel test not do this?

Share this post


Link to post
Share on other sites

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 :rambo: , 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 :rolleyes:

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