Jump to content

(resolved) Run checked "checkboxes" when "Start" button pressed?


 Share

Recommended Posts

I have a "Start" button (run script) which i want to read which checkboxes are checked, and execute on them. Here is my code:

#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#Include <GuiToolBar.au3>
#Include <Array.au3>
#Include <Misc.au3>


#Region ### START Koda GUI section ### Form=
$Index = GUICreate("Archer Buddy 2.1", 296, 363, 193, 125)
GUISetIcon("C:\Documents and Settings\Mom\Desktop\Porky-no-bow.ico")
GUISetFont(10, 400, 0, "Palatino Linotype")
$Tab1 = GUICtrlCreateTab(8, 104, 281, 153)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("Set Path", 56, 272, 179, 25, 0)
$Button2 = GUICtrlCreateButton("Start (end to end activity)", 64, 304, 163, 25, 0)
GUICtrlSetBkColor(-1, 0xFF00FF)
$Group1 = GUICtrlCreateGroup("Set Actions", 16, 104, 263, 145)
$Checkbox1 = GUICtrlCreateCheckbox("Auto jump", 24, 128, 249, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Auto right click (scatter)", 24, 152, 249, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Auto heal (F2. Heals every 20 minutes)", 24, 176, 249, 17)
$Label6 = GUICtrlCreateLabel("Log out after:", 48, 208, 83, 30)
GUICtrlCreateCombo("", 136, 208, 105, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("1. Set desired actions. Important!", 40, 24, 200, 22)
$Label2 = GUICtrlCreateLabel("2. Set path. Follow the instructions.", 40, 48, 214, 22)
$Label3 = GUICtrlCreateLabel("3. Click start to execute.", 40, 72, 144, 22)
$Label5 = GUICtrlCreateLabel("Another small contribution by Joshperson", 48, 344, 210, 20)
GUICtrlSetFont(-1, 8, 400, 0, "Palatino Linotype")
$Label4 = GUICtrlCreateLabel("Steps:", 8, 0, 39, 22)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

        
If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then
    Send("{LCTRL Down}")
    Do
        sleep(0) 
    Until _IsPressed ("23")
           EndIf

            If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then
                 Do
                   MouseClick ("SECONDARY") 
     Sleep(1); 1= .01sec
Until _IsPressed ("23")
           EndIf

For example, I want checkbox 1 and checkbox 2 to begin executing what their supposed to when "Start" is pressed. How can I do this?

Edited by Joshuaaaa
Link to comment
Share on other sites

Case $Button2
            If BitAnd(GUICtrlRead($Checkbox1), $GUI_CHECKED) AND BitAnd(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then
                MsgBox(0, "", "Start!")
            Else
                ; nothing
                ContinueLoop
            EndIf

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