Jump to content

check box


Recommended Posts

#include <GUIConstants.au3>
$test = GUICreate("test", 192, 166, 194, 174)
$menufile = GUICtrlCreateMenu("&File", -1)
GUICtrlCreateMenuitem("check", $menufile)
$check1 = GUICtrlCreateCheckbox("check", 0, 16, 17, 17)
GUICtrlSetState(-1, $GUI_CHECKED) ;ok my check box is checked 
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
EndSelect
WEnd
Exit

ok so if you run the script click file, then hit check it will uncheck the check box how would i do this?

[s]Autoit[/s]
Link to comment
Share on other sites

Don't think can from the parent item in the menu:

#include <GUIConstants.au3>
$test = GUICreate("test", 192, 166, 194, 174)
$menufile = GUICtrlCreateMenu("&File", -1)
$menufileCheck = GUICtrlCreateMenuitem("&Check Item", $menufile)
$check1 = GUICtrlCreateCheckbox("check", 0, 16, 17, 17)
GUICtrlSetState(-1, $GUI_CHECKED) ;ok my check box is checked
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $menufileCheck
            If GUICtrlRead($check1) = $GUI_CHECKED Then
                GUICtrlSetState($check1, $GUI_UNCHECKED)
            Else
                GUICtrlSetState($check1, $GUI_CHECKED)
            EndIf
    EndSelect
WEnd
Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Don't think can from the parent item in the menu:

#include <GUIConstants.au3>
$test = GUICreate("test", 192, 166, 194, 174)
$menufile = GUICtrlCreateMenu("&File", -1)
$menufileCheck = GUICtrlCreateMenuitem("&Check Item", $menufile)
$check1 = GUICtrlCreateCheckbox("check", 0, 16, 17, 17)
GUICtrlSetState(-1, $GUI_CHECKED) ;ok my check box is checked
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $menufileCheck
            If GUICtrlRead($check1) = $GUI_CHECKED Then
                GUICtrlSetState($check1, $GUI_UNCHECKED)
            Else
                GUICtrlSetState($check1, $GUI_CHECKED)
            EndIf
    EndSelect
WEnd
Exit
thanks
[s]Autoit[/s]
Link to comment
Share on other sites

you will need the above code to read the check boxes

#include <GUIConstants.au3>
#include <INet.au3>
;Opt("GUIoneventmode",1)

Dim $username, $MaskEdit1, $password


$PasswordDlg1 = GUICreate("D2 Lod Bot", 250, 92, 309, 248)
GUISetIcon("")
GUISetBkColor(0x000000)
GUICtrlCreateLabel("Username", 8, 12, 77, 17)
GUICtrlSetColor(-1, 0xF1EFE2)
GUICtrlSetBkColor(-1, 0x000000)
$username = GUICtrlCreateInput("username", 8, 32, 233, 21)
$Button1 = GUICtrlCreateButton("&OK", 86, 64, 75, 25)
$Button2 = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25)
;GuiCtrlSetOnEvent($Button1 , "_ok")
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button1
            $username = GUICtrlRead($username)
            GUIDelete($PasswordDlg1)
            _ok()
        Case $msg = $Button2
            ExitLoop
    EndSelect
WEnd
Exit


Func _ok()
    $PasswordDlg2 = GUICreate("D2 Lod Bot", 250, 92, 309, 248)
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)
    $password = GUICtrlCreateInput("password", 8, 32, 233, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE)
    $Button1 = GUICtrlCreateButton("&OK", 86, 64, 75, 25)
    $Button2 = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25)
   ;GuiCtrlSetOnEvent($Button1 , "_ok2")
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button1
                $password = GUICtrlRead($password)
                GUIDelete($PasswordDlg2)
                _ok2()
            Case $msg = $Button2
                ExitLoop
        EndSelect
    WEnd
    Exit
EndFunc  ;==>_ok


Func _ok2()
    $PasswordDlg3 = GUICreate("D2 Lod Bot", 250, 92, 309, 248)
    GUISetIcon("")
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Character", 8, 12, 77, 17)
    GUICtrlSetColor(-1, 0xF1EFE2)
    GUICtrlSetBkColor(-1, 0x000000)
    $MaskEdit1 = GUICtrlCreateInput("Character name", 8, 32, 233, 21)
    $Button1 = GUICtrlCreateButton("&OK", 86, 64, 75, 25)
    $Button2 = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25)
   ;GuiCtrlSetOnEvent($Button1 , "_ok3")
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button1
                $MaskEdit1 = GUICtrlRead($MaskEdit1)
                GUIDelete($PasswordDlg3)
                _ok3()
            Case $msg = $Button2
                ExitLoop
        EndSelect
    WEnd
    Exit
EndFunc  ;==>_ok2


Func _ok3()
    $Form1 = GUICreate("Diablo 2 Lod Bot", 254, 403, 210, 124)
    GUISetBkColor(0x000000)
    $Group1 = GUICtrlCreateGroup("SETTINGS", 8, 16, 241, 385)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Chickens", 24, 32, 69, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox1 = GUICtrlCreateCheckbox("ACheckbox1", 16, 56, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox2 = GUICtrlCreateCheckbox("ACheckbox1", 16, 80, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox3 = GUICtrlCreateCheckbox("ACheckbox1", 112, 56, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Life", 32, 56, 21, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Mana", 128, 56, 31, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Ping", 32, 80, 25, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Runs", 16, 112, 42, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox4 = GUICtrlCreateCheckbox("ACheckbox4", 16, 136, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Baal", 112, 136, 25, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox5 = GUICtrlCreateCheckbox("ACheckbox5", 16, 152, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox6 = GUICtrlCreateCheckbox("ACheckbox5", 16, 168, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox7 = GUICtrlCreateCheckbox("ACheckbox5", 16, 184, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox8 = GUICtrlCreateCheckbox("ACheckbox5", 88, 136, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Andariel", 40, 136, 42, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Duriel", 40, 152, 31, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Mephisto", 40, 168, 47, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Diablo", 40, 184, 34, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox9 = GUICtrlCreateCheckbox("ACheckbox5", 88, 152, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Baal's Minions", 112, 152, 71, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox10 = GUICtrlCreateCheckbox("ACheckbox5", 88, 168, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Chaso", 112, 168, 34, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox11 = GUICtrlCreateCheckbox("ACheckbox5", 88, 184, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Everything", 112, 184, 54, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Fear spots", 16, 232, 80, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox12 = GUICtrlCreateCheckbox("ACheckbox5", 16, 256, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Chaso", 32, 256, 34, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox13 = GUICtrlCreateCheckbox("ACheckbox5", 16, 272, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Baal's Minions", 32, 272, 71, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox14 = GUICtrlCreateCheckbox("ACheckbox5", 16, 288, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Suicide Minions", 32, 288, 78, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox15 = GUICtrlCreateCheckbox("ACheckbox5", 112, 256, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Bone Fetish", 128, 256, 60, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Checkbox16 = GUICtrlCreateCheckbox("ACheckbox5", 112, 272, 17, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Council Member", 128, 272, 80, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    $Button1 = GUICtrlCreateButton("Save Settings", 16, 344, 121, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    $Input1 = GUICtrlCreateInput("Run's -1", 16, 320, 89, 21, -1, $WS_EX_CLIENTEDGE)
    GUICtrlSetColor(-1, 0xFF0000)
    $Button2 = GUICtrlCreateButton("Start Bot", 16, 360, 121, 17)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button1
                MsgBox(64, "Ok", "now saving settings")
            Case $msg = $Button2
                MsgBox(64, "Ok", "now starting bot" & @CRLF & $username & @CRLF & $password & @CRLF & $MaskEdit1)
            Case Else
               ;;;;;;;
        EndSelect
    WEnd
    Exit
EndFunc  ;==>_ok3

NEWHeader1.png

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