Sign in to follow this  
Followers 0
Justcook90

Using more the one checkbox

5 posts in this topic

ok, i have a code, it uses check boxes i want it to where i click the check box the action happens and well that is working, but i want to be able to click more the one check box and have both actions run. but it isn't working out the way i want i click more the one and it is only running the first commaned in the line from the check boxs. this is happening to more the just one of my scripts. here is one of them, please tell me how to fix it to run more the just the first of the checked checkboxs.

#include <GuiConstants.au3>
#include <Color.au3>
Opt("GUIOnEventMode",1)
HotKeySet("{F5}", "_Start")
HotKeySet("{ESC}","Terminate")
$ClickIt = 0
GUICreate("Auto-Potter", 200, 150)
GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")
$Checkbox_1 = GUICtrlCreateCheckbox("Auto-Pot HP", 20, 40, 150, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("Auto-Pot MP", 20, 80, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit
Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
            If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            $nColor = ( 0x52617B )
            while 1
                If $nColor = PixelGetColor( 30, 736 ) Then
                    Send('{F7}')
                    Sleep(1500)
                EndIf
            WEnd
                Sleep(100)
        EndIf
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
            $nColor = ( 0x425963 )
            while 1
                If $nColor = PixelGetColor( 52, 726 ) Then
                    Send('{F8}')
                    Sleep(1500)
                EndIf
            WEnd
                Sleep(100)
        EndIf
    WEnd
EndFunc ;==>_Start
Func Terminate ()
    Exit
EndFunc ;==>Terminate

Share this post


Link to post
Share on other sites



ok, i have a code, it uses check boxes i want it to where i click the check box the action happens and well that is working, but i want to be able to click more the one check box and have both actions run. but it isn't working out the way i want i click more the one and it is only running the first commaned in the line from the check boxs. this is happening to more the just one of my scripts. here is one of them, please tell me how to fix it to run more the just the first of the checked checkboxs.

#include <GuiConstants.au3>
#include <Color.au3>
Opt("GUIOnEventMode",1)
HotKeySet("{F5}", "_Start")
HotKeySet("{ESC}","Terminate")
$ClickIt = 0
GUICreate("Auto-Potter", 200, 150)
GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")
$Checkbox_1 = GUICtrlCreateCheckbox("Auto-Pot HP", 20, 40, 150, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("Auto-Pot MP", 20, 80, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit
Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
            If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            $nColor = ( 0x52617B )
            while 1
                If $nColor = PixelGetColor( 30, 736 ) Then
                    Send('{F7}')
                    Sleep(1500)
                EndIf
            WEnd
                Sleep(100)
        EndIf
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
            $nColor = ( 0x425963 )
            while 1
                If $nColor = PixelGetColor( 52, 726 ) Then
                    Send('{F8}')
                    Sleep(1500)
                EndIf
            WEnd
                Sleep(100)
        EndIf
    WEnd
EndFunc;==>_Start
Func Terminate ()
    Exit
EndFunc;==>Terminate
You could use radios 'GuiCtrlCreateRadio'

Share this post


Link to post
Share on other sites

You could use radios 'GuiCtrlCreateRadio'

could you give me a example of it, becuase i am still a noob at this, i realy don't understand much just want i have and not why it isn't working, that is what i want to know... i hope u understand that

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i want to be able to click more the one check box and have both actions run.

You could use radios 'GuiCtrlCreateRadio'

Justcook90... Look at your checkbox-check. In this check you have added a loop which cannot

be exited. Because of this loop your second checkbox-check is never reached. Remove those

two loops in the checks and you might be one step closer to the grail of skill in gaming. Or not.

Edited by Helge

Share this post


Link to post
Share on other sites

i fixed it the "while 1" i had befor each ceckbox-check made it go into a inf loop, i think that is what that other person was trying to say, and a radio isn't the thing for this...

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