Jump to content

Using more the one checkbox


Recommended Posts

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
Link to comment
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'
Link to comment
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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...