Sign in to follow this  
Followers 0
Bl4ckB0xX

If GUICtrlRead with a Combo?

6 posts in this topic

Hi

I want to do a PixelScan with a choice the user has made in a Combo..

The problem is when I use this code I get a Syntax Error..

If GUICtrlRead ( $ColChoose ) = Dark Green Then
        While 1=1
        $Mob = PixelSearch( $tlx, $tly, $brx, $bry, 5928743, $dif, $sk )
            While @error = 0
                Send ( "DDDDDDDDDDDDDDDDDDD" )
                MouseMove ( $Mob[0], $Mob[1] )
                MouseClick ( "left" )
                Sleep( 10000 )
            WEnd
        WEnd
    EndIf

The HelpFile said the return of a Combo is the chosen value so I used it but I get a Syntax Error pointed at DarkGreen which is the chosen value

Anyone can tell me what i have to use instead of ComboValue?

thanks for any answeres that could help and sry for any bad english ^.^

greetz

Share this post


Link to post
Share on other sites



Hi

I want to do a PixelScan with a choice the user has made in a Combo..

The problem is when I use this code I get a Syntax Error..

If GUICtrlRead ( $ColChoose ) = Dark Green Then
        While 1=1
        $Mob = PixelSearch( $tlx, $tly, $brx, $bry, 5928743, $dif, $sk )
            While @error = 0
                Send ( "DDDDDDDDDDDDDDDDDDD" )
                MouseMove ( $Mob[0], $Mob[1] )
                MouseClick ( "left" )
                Sleep( 10000 )
            WEnd
        WEnd
    EndIf

The HelpFile said the return of a Combo is the chosen value so I used it but I get a Syntax Error pointed at DarkGreen which is the chosen value

Anyone can tell me what i have to use instead of ComboValue?

thanks for any answeres that could help and sry for any bad english ^.^

greetz

If GUICtrlRead ( $ColChoose ) = "Dark Green"

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Ah okay so easy :)

Thanks GEOSoft it works :) :)

Share this post


Link to post
Share on other sites

By the way an easier way to do this would be to write a function to get the value of the color'

Func _GetColor()
   Local $cVal = ""
   Switch GUICtrlRead($ColChoose )
      Case "Dark Green"
         $rVal = 5928743
      Case "Red"
         $rVal = <value for red>
   EndSwitch
   Return $cVal
EndFunc

Call it by using

$dColor = _GetColor()

And replace $Mob = PixelSearch( $tlx, $tly, $brx, $bry, 5928743, $dif, $sk ) with

$Mob = PixelSearch( $tlx, $tly, $brx, $bry, $dcolor, $dif, $sk )
and remove the If statement entirely.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Ah okay so easy :)

Thanks GEOSoft it works :) :)

YW Glad it helped.

Just remember that anything except a numeric value has to be quoted when using GUICtrlRead()


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

yea i forgot that =/

and to your easyer way .. i will test it when i released the v1.0 .. actually im in v0.5 :)

but thx anyways it really seems to be easier than the If statement

Edited by Bl4ckB0xX

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